Commit 8097f831 by wjg

init

parent daa586fa
...@@ -24,8 +24,6 @@ import com.ihaoin.hooloo.device.util.StringUtils; ...@@ -24,8 +24,6 @@ import com.ihaoin.hooloo.device.util.StringUtils;
import com.ihaoin.hooloo.device.util.Utils; import com.ihaoin.hooloo.device.util.Utils;
import java.util.Arrays; import java.util.Arrays;
import java.util.List;
import java.util.Optional;
public class GoodsAdapter extends BaseSectionQuickAdapter<ScrollBean, BaseViewHolder> { public class GoodsAdapter extends BaseSectionQuickAdapter<ScrollBean, BaseViewHolder> {
private Context mContext; private Context mContext;
...@@ -74,16 +72,16 @@ public class GoodsAdapter extends BaseSectionQuickAdapter<ScrollBean, BaseViewHo ...@@ -74,16 +72,16 @@ public class GoodsAdapter extends BaseSectionQuickAdapter<ScrollBean, BaseViewHo
Glide.with(mContext).load(goods.getPics().getThumbnail()).apply(options).into(imgThumbnail); Glide.with(mContext).load(goods.getPics().getThumbnail()).apply(options).into(imgThumbnail);
} }
Sku sku = getDefaultSku(goods.getSkus()); Sku sku = Utils.getDefaultSku(goods.getSkus());
if (sku == null) { if (sku == null) {
helper.setText(R.id.txt_price, String.valueOf(goods.getPrice())); helper.setText(R.id.txt_price, Utils.toString(goods.getPrice()));
helper.setText(R.id.txt_discount, String.valueOf(goods.getDiscount())); helper.setText(R.id.txt_discount, Utils.toString(goods.getDiscount()));
helper.setGone(R.id.txt_sellout, true); helper.setGone(R.id.txt_sellout, true);
helper.setGone(R.id.butn_add, false); helper.setGone(R.id.butn_add, false);
} else { } else {
helper.setText(R.id.txt_price, String.valueOf(sku.getPrice())); helper.setText(R.id.txt_price, Utils.toString(sku.getPrice()));
helper.setText(R.id.txt_discount, String.valueOf(sku.getDiscount())); helper.setText(R.id.txt_discount, Utils.toString(sku.getDiscount()));
if (Base.TRUE.equals(sku.getState())) { if (Base.TRUE.equals(sku.getState())) {
helper.setGone(R.id.txt_sellout, false); helper.setGone(R.id.txt_sellout, false);
...@@ -105,10 +103,10 @@ public class GoodsAdapter extends BaseSectionQuickAdapter<ScrollBean, BaseViewHo ...@@ -105,10 +103,10 @@ public class GoodsAdapter extends BaseSectionQuickAdapter<ScrollBean, BaseViewHo
helper.setGone(R.id.img_recommend, false); helper.setGone(R.id.img_recommend, false);
} }
TextView icoDiscount = helper.getView(R.id.ico_discount); TextView icoPrice = helper.getView(R.id.ico_price);
TextView txtDiscount = helper.getView(R.id.txt_discount); TextView txtPrice = helper.getView(R.id.txt_price);
icoDiscount.setPaintFlags(icoDiscount.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG); icoPrice.setPaintFlags(icoPrice.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
txtDiscount.setPaintFlags(txtDiscount.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG); txtPrice.setPaintFlags(txtPrice.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
View layoutItem = helper.getView(R.id.layout_item); View layoutItem = helper.getView(R.id.layout_item);
layoutItem.setOnClickListener(v -> Utils.showGoodsDetail(mContext, goods)); layoutItem.setOnClickListener(v -> Utils.showGoodsDetail(mContext, goods));
...@@ -123,22 +121,6 @@ public class GoodsAdapter extends BaseSectionQuickAdapter<ScrollBean, BaseViewHo ...@@ -123,22 +121,6 @@ public class GoodsAdapter extends BaseSectionQuickAdapter<ScrollBean, BaseViewHo
} }
} }
/** 获取SKU,优选获取默认的SKU */
private Sku getDefaultSku(List<Sku> skus) {
if (CollectionUtils.isEmpty(skus)) {
return null;
}
Optional<Sku> optional = skus.stream().filter(x -> Base.TRUE.equals(x.getIsDefault()) && Base.TRUE.equals(x.getState())).findAny();
if (optional.isPresent()) {
return optional.get();
}
optional = skus.stream().filter(x -> Base.TRUE.equals(x.getState())).findAny();
if (optional.isPresent()) {
return optional.get();
}
return skus.get(0);
}
private boolean trolleyState = false; private boolean trolleyState = false;
public boolean isTrolleyState() { public boolean isTrolleyState() {
......
...@@ -38,9 +38,9 @@ public class TrolleyAdapter extends BaseAdapter { ...@@ -38,9 +38,9 @@ public class TrolleyAdapter extends BaseAdapter {
ImageView imgThumbnail = convertView.findViewById(R.id.img_thumbnail); ImageView imgThumbnail = convertView.findViewById(R.id.img_thumbnail);
TextView txtName = convertView.findViewById(R.id.txt_name); TextView txtName = convertView.findViewById(R.id.txt_name);
TextView txtOptions = convertView.findViewById(R.id.txt_options); TextView txtOptions = convertView.findViewById(R.id.txt_options);
TextView icoPrice = convertView.findViewById(R.id.ico_price);
TextView txtPrice = convertView.findViewById(R.id.txt_price); TextView txtPrice = convertView.findViewById(R.id.txt_price);
TextView txtDiscount = convertView.findViewById(R.id.txt_discount); TextView txtDiscount = convertView.findViewById(R.id.txt_discount);
TextView icoDiscount = convertView.findViewById(R.id.ico_discount);
View butnSubtract = convertView.findViewById(R.id.butn_subtract); View butnSubtract = convertView.findViewById(R.id.butn_subtract);
TextView txtCount = convertView.findViewById(R.id.txt_count); TextView txtCount = convertView.findViewById(R.id.txt_count);
View butnAdd = convertView.findViewById(R.id.butn_add); View butnAdd = convertView.findViewById(R.id.butn_add);
...@@ -67,11 +67,11 @@ public class TrolleyAdapter extends BaseAdapter { ...@@ -67,11 +67,11 @@ public class TrolleyAdapter extends BaseAdapter {
txtOptions.setVisibility(View.GONE); txtOptions.setVisibility(View.GONE);
} }
txtPrice.setText(goods.getPrice().toString()); txtPrice.setText(Utils.toString(goods.getPrice()));
txtDiscount.setText(goods.getDiscount().toString()); txtDiscount.setText(Utils.toString(goods.getDiscount()));
icoDiscount.setPaintFlags(icoDiscount.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG); icoPrice.setPaintFlags(icoPrice.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
txtDiscount.setPaintFlags(txtDiscount.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG); txtPrice.setPaintFlags(txtPrice.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
txtCount.setText(goods.getCount().toString()); txtCount.setText(goods.getCount().toString());
butnSubtract.setOnClickListener(v -> trolleyView.subtractGoods(position)); butnSubtract.setOnClickListener(v -> trolleyView.subtractGoods(position));
butnAdd.setOnClickListener(v -> trolleyView.addGoods(position)); butnAdd.setOnClickListener(v -> trolleyView.addGoods(position));
......
package com.ihaoin.hooloo.device.component;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.viewpager.widget.PagerAdapter;
import androidx.viewpager.widget.ViewPager;
import com.ihaoin.hooloo.device.util.CollectionUtils;
import java.util.List;
public class IntroViewPager extends ViewPager {
public IntroViewPager(@NonNull Context context) {
super(context);
}
public IntroViewPager(@NonNull Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
if (getAdapter() == null) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
return;
}
int index = getCurrentItem();
int height = 0;
View v = getView(index);
if (v != null) {
v.measure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));
height = v.getMeasuredHeight();
}
heightMeasureSpec = MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY);
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
private List<View> introViews;
public void setIntroViews(List<View> introViews) {
this.introViews = introViews;
this.setAdapter(pagerAdapter);
}
public View getView(int index) {
if (CollectionUtils.isEmpty(introViews)) {
return null;
}
return introViews.get(index);
}
public int getCount() {
if (pagerAdapter == null) {
return 0;
}
return pagerAdapter.getCount();
}
private PagerAdapter pagerAdapter = new PagerAdapter() {
@Override
public int getCount() {
return CollectionUtils.isEmpty(introViews) ? 0 : introViews.size();
}
@Override
public boolean isViewFromObject(@NonNull View view, @NonNull Object object) {
return view == object;
}
@Override
public void destroyItem(@NonNull ViewGroup container, int position, @NonNull Object object) {
View view = introViews.get(position);
container.removeView(view);
}
@NonNull
@Override
public Object instantiateItem(@NonNull ViewGroup container, int position) {
if (CollectionUtils.isEmpty(introViews)) {
return null;
}
View view = introViews.get(position);
container.addView(view);
return view;
}
};
}
...@@ -8,6 +8,7 @@ import android.util.DisplayMetrics; ...@@ -8,6 +8,7 @@ import android.util.DisplayMetrics;
import android.view.TouchDelegate; import android.view.TouchDelegate;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.RadioGroup;
import androidx.coordinatorlayout.widget.ViewGroupUtils; import androidx.coordinatorlayout.widget.ViewGroupUtils;
...@@ -22,7 +23,10 @@ import com.ihaoin.hooloo.device.view.GoodsDetailDialog; ...@@ -22,7 +23,10 @@ import com.ihaoin.hooloo.device.view.GoodsDetailDialog;
import com.ihaoin.hooloo.device.view.SettingsActivity; import com.ihaoin.hooloo.device.view.SettingsActivity;
import com.ihaoin.hooloo.device.view.TipsDialog; import com.ihaoin.hooloo.device.view.TipsDialog;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.List; import java.util.List;
import java.util.Optional;
public class Utils { public class Utils {
...@@ -123,4 +127,39 @@ public class Utils { ...@@ -123,4 +127,39 @@ public class Utils {
})); }));
group.setTouchDelegate(composite); group.setTouchDelegate(composite);
} }
public static String toString(BigDecimal num) {
DecimalFormat df = new DecimalFormat("#.00");
return df.format(num);
}
/** 获取SKU,优选获取默认的SKU */
public static Sku getDefaultSku(List<Sku> skus) {
if (CollectionUtils.isEmpty(skus)) {
return null;
}
Optional<Sku> optional = skus.stream().filter(x -> Base.TRUE.equals(x.getIsDefault()) && Base.TRUE.equals(x.getState())).findAny();
if (optional.isPresent()) {
return optional.get();
}
optional = skus.stream().filter(x -> Base.TRUE.equals(x.getState())).findAny();
if (optional.isPresent()) {
return optional.get();
}
return skus.get(0);
}
public static void check(RadioGroup group, int position) {
if (group == null) {
return;
}
if (group.getChildCount() < position) {
return;
}
View v = group.getChildAt(position);
if (v == null) {
return;
}
group.check(v.getId());
}
} }
...@@ -73,13 +73,12 @@ public class LauncherActivity extends Activity { ...@@ -73,13 +73,12 @@ public class LauncherActivity extends Activity {
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
Log.d(AppConfig.DEBUG_TAG, "onCreate");
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_launcher); setContentView(R.layout.activity_launcher);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
mContext = this; mContext = this;
setMachineCode();
requestPermissions(); requestPermissions();
trolleyView = findViewById(R.id.view_trolley); trolleyView = findViewById(R.id.view_trolley);
...@@ -87,7 +86,6 @@ public class LauncherActivity extends Activity { ...@@ -87,7 +86,6 @@ public class LauncherActivity extends Activity {
recGoods = findViewById(R.id.rec_right); recGoods = findViewById(R.id.rec_right);
recRecommends = findViewById(R.id.rec_recommend); recRecommends = findViewById(R.id.rec_recommend);
initRecommends(); initRecommends();
setRecommendsData(); setRecommendsData();
...@@ -347,15 +345,28 @@ public class LauncherActivity extends Activity { ...@@ -347,15 +345,28 @@ public class LauncherActivity extends Activity {
@Override @Override
protected void onDestroy() { protected void onDestroy() {
Log.d(AppConfig.DEBUG_TAG, "onDestroy");
super.onDestroy(); super.onDestroy();
exit();
}
private void exit() {
Log.d(AppConfig.DEBUG_TAG, "exit");
this.unregistTrolleyGoodsChangedReceiver(); this.unregistTrolleyGoodsChangedReceiver();
this.unregistTrolleyStateChangedReceiver(); this.unregistTrolleyStateChangedReceiver();
this.unregistSettingChangedReceiver(); this.unregistSettingChangedReceiver();
System.exit(0); System.exit(0);
} }
@Override
public void onBackPressed() {
super.onBackPressed();
exit();
}
private TrolleyGoodsChangedReceiver trolleyGoodsChangedReceiver = null; private TrolleyGoodsChangedReceiver trolleyGoodsChangedReceiver = null;
private TrolleyStateChangedReceiver trolleyStateChangedReceiver = null; private TrolleyStateChangedReceiver trolleyStateChangedReceiver = null;
private SettingChangedReceiver settingChangedReceiver;
/** 注册购物车广播 */ /** 注册购物车广播 */
private void registTrolleyGoodsChangedReceiver() { private void registTrolleyGoodsChangedReceiver() {
...@@ -426,9 +437,6 @@ public class LauncherActivity extends Activity { ...@@ -426,9 +437,6 @@ public class LauncherActivity extends Activity {
} }
} }
private SettingChangedReceiver settingChangedReceiver;
private void registSettingChangedReceiver() { private void registSettingChangedReceiver() {
settingChangedReceiver = new SettingChangedReceiver(); settingChangedReceiver = new SettingChangedReceiver();
IntentFilter filter = new IntentFilter(); IntentFilter filter = new IntentFilter();
......
...@@ -174,7 +174,7 @@ public class TrolleyView extends RelativeLayout { ...@@ -174,7 +174,7 @@ public class TrolleyView extends RelativeLayout {
public void goodsChanged() { public void goodsChanged() {
this.trolleyAdapter.notifyDataSetChanged(); this.trolleyAdapter.notifyDataSetChanged();
this.txtCount.setText(getCheckedCount().toString()); this.txtCount.setText(getCheckedCount().toString());
this.txtTotal.setText(getCheckedTotal().toString()); this.txtTotal.setText(Utils.toString(getCheckedTotal()));
this.setView(); this.setView();
this.measureListHeight(); this.measureListHeight();
} }
......
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<!-- <corners android:radius="2dp" />-->
<solid
android:width="1dp"
android:color="@color/textSecondPrimary" />
</shape>
</item>
<!-- <item-->
<!-- android:bottom="10dp"-->
<!-- android:left="10dp"-->
<!-- android:right="10dp"-->
<!-- android:top="10dp">-->
<!-- <bitmap-->
<!-- android:gravity="center"-->
<!-- android:src="@mipmap/jiahao_2x" />-->
<!-- </item>-->
</layer-list>
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="oval">
<solid android:color="@color/textDisable" />
<size
android:width="30dp"
android:height="30dp" />
</shape>
</item>
</layer-list>
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">
<item android:drawable="@drawable/ic_dot" android:state_checked="true" />
<item android:drawable="@drawable/ic_dot_unchecked" />
</selector>
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/padding3"> android:layout_marginTop="@dimen/padding3">
<TextView <TextView
android:id="@+id/ico_price" android:id="@+id/ico_discount"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
...@@ -72,32 +72,32 @@ ...@@ -72,32 +72,32 @@
android:textColor="@color/textRed" android:textColor="@color/textRed"
android:textSize="@dimen/ts_goods_item_price" /> android:textSize="@dimen/ts_goods_item_price" />
<TextView <TextView
android:id="@+id/txt_price" android:id="@+id/txt_discount"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_toRightOf="@id/ico_price" android:layout_toRightOf="@id/ico_discount"
android:text="19.9" android:text="19.9"
android:textColor="@color/textRed" android:textColor="@color/textRed"
android:textSize="@dimen/ts_goods_item_price" android:textSize="@dimen/ts_goods_item_price"
android:textStyle="bold" /> android:textStyle="bold" />
<TextView <TextView
android:id="@+id/ico_discount" android:id="@+id/ico_price"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_marginStart="@dimen/padding5" android:layout_marginStart="@dimen/padding5"
android:layout_toEndOf="@id/txt_price" android:layout_toEndOf="@id/txt_discount"
android:text="¥" android:text="¥"
android:textColor="@color/textSecondPrimary" android:textColor="@color/textSecondPrimary"
android:textSize="@dimen/ts_goods_item_discount" /> android:textSize="@dimen/ts_goods_item_discount" />
<TextView <TextView
android:id="@+id/txt_discount" android:id="@+id/txt_price"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_toEndOf="@id/ico_discount" android:layout_toEndOf="@id/ico_price"
android:text="29.9" android:text="29.9"
android:textColor="@color/textSecondPrimary" android:textColor="@color/textSecondPrimary"
android:textSize="@dimen/ts_goods_item_discount" /> android:textSize="@dimen/ts_goods_item_discount" />
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/layout_item" android:id="@+id/layout_item"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
...@@ -8,25 +9,32 @@ ...@@ -8,25 +9,32 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:adjustViewBounds="true" android:adjustViewBounds="true"
android:scaleType="centerCrop" /> android:scaleType="centerCrop"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView <TextView
android:id="@+id/txt_name" android:id="@+id/txt_name"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="@dimen/padding20" android:layout_marginStart="@dimen/padding20"
android:layout_marginTop="@dimen/padding20"
android:singleLine="true" android:singleLine="true"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="@dimen/ts_recommend_name" android:textSize="@dimen/ts_recommend_name"
android:textStyle="bold" /> android:textStyle="bold"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView <TextView
android:id="@+id/txt_intro" android:id="@+id/txt_intro"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/txt_name" android:layout_below="@+id/txt_name"
android:layout_marginStart="@dimen/padding20" android:layout_marginStart="@dimen/padding20"
android:layout_marginTop="@dimen/padding10" android:layout_marginBottom="@dimen/padding15"
android:singleLine="true" android:singleLine="true"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="@dimen/ts_recommend_desc" android:textSize="@dimen/ts_recommend_desc"
android:textStyle="bold" /> android:textStyle="bold"
</RelativeLayout> app:layout_constraintBottom_toBottomOf="parent"
\ No newline at end of file app:layout_constraintLeft_toLeftOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/txt_recommend"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/bg_spec_recommend"
android:paddingHorizontal="@dimen/padding5"
android:paddingVertical="@dimen/padding3"
android:text="推荐"
android:textColor="@color/white"
android:textSize="@dimen/ts_detail_spec_rec" />
...@@ -50,14 +50,14 @@ ...@@ -50,14 +50,14 @@
android:gravity="bottom" android:gravity="bottom"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:id="@+id/ico_price" android:id="@+id/ico_discount"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="¥" android:text="¥"
android:textColor="@color/textRed" android:textColor="@color/textRed"
android:textSize="@dimen/ts_goods_item_price" /> android:textSize="@dimen/ts_goods_item_price" />
<TextView <TextView
android:id="@+id/txt_price" android:id="@+id/txt_discount"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="19.9" android:text="19.9"
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
android:textSize="@dimen/ts_goods_item_price" android:textSize="@dimen/ts_goods_item_price"
android:textStyle="bold" /> android:textStyle="bold" />
<TextView <TextView
android:id="@+id/ico_discount" android:id="@+id/ico_price"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/padding5" android:layout_marginStart="@dimen/padding5"
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
android:textColor="@color/textSecondPrimary" android:textColor="@color/textSecondPrimary"
android:textSize="@dimen/ts_goods_item_discount" /> android:textSize="@dimen/ts_goods_item_discount" />
<TextView <TextView
android:id="@+id/txt_discount" android:id="@+id/txt_price"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/layout_root" android:id="@+id/layout_root"
android:layout_width="@dimen/dialog_detail_width" android:layout_width="@dimen/dialog_detail_width"
android:layout_height="match_parent"> android:layout_height="match_parent">
...@@ -17,13 +18,27 @@ ...@@ -17,13 +18,27 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal" android:orientation="horizontal"
android:padding="@dimen/padding10"> android:padding="@dimen/padding10">
<ImageView <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/img_intro"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="@dimen/padding10" android:layout_margin="@dimen/padding10"
android:layout_weight="1" android:layout_weight="1">
android:adjustViewBounds="true" /> <com.ihaoin.hooloo.device.component.IntroViewPager
android:id="@+id/intro_pager"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<RadioGroup
android:id="@+id/intro_indicator"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/padding10"
android:gravity="center"
android:orientation="horizontal"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<LinearLayout <LinearLayout
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
...@@ -43,6 +58,14 @@ ...@@ -43,6 +58,14 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" /> android:orientation="vertical" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/padding10"
android:text="商品详细"
android:textColor="@color/textPrimary"
android:textSize="@dimen/ts_detail_spec"
android:textStyle="bold" />
<LinearLayout <LinearLayout
android:id="@+id/layout_images" android:id="@+id/layout_images"
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -72,14 +95,14 @@ ...@@ -72,14 +95,14 @@
android:gravity="bottom" android:gravity="bottom"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:id="@+id/ico_price" android:id="@+id/ico_discount"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="¥" android:text="¥"
android:textColor="@color/textRed" android:textColor="@color/textRed"
android:textSize="@dimen/ts_detail_price" /> android:textSize="@dimen/ts_detail_price" />
<TextView <TextView
android:id="@+id/txt_price" android:id="@+id/txt_discount"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center_vertical" android:gravity="center_vertical"
...@@ -89,7 +112,7 @@ ...@@ -89,7 +112,7 @@
android:textStyle="bold" /> android:textStyle="bold" />
<TextView <TextView
android:id="@+id/ico_discount" android:id="@+id/ico_price"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/padding5" android:layout_marginStart="@dimen/padding5"
...@@ -97,7 +120,7 @@ ...@@ -97,7 +120,7 @@
android:textColor="@color/textSecondPrimary" android:textColor="@color/textSecondPrimary"
android:textSize="@dimen/ts_detail_discount" /> android:textSize="@dimen/ts_detail_discount" />
<TextView <TextView
android:id="@+id/txt_discount" android:id="@+id/txt_price"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center_vertical" android:gravity="center_vertical"
......
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