Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
machine
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hooloo
android
machine
Commits
8097f831
Commit
8097f831
authored
May 24, 2022
by
wjg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
daa586fa
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
255 additions
and
77 deletions
+255
-77
app/src/main/java/com/ihaoin/hooloo/device/adapter/GoodsAdapter.java
+9
-27
app/src/main/java/com/ihaoin/hooloo/device/adapter/TrolleyAdapter.java
+5
-5
app/src/main/java/com/ihaoin/hooloo/device/component/IntroViewPager.java
+92
-0
app/src/main/java/com/ihaoin/hooloo/device/util/Utils.java
+39
-0
app/src/main/java/com/ihaoin/hooloo/device/view/GoodsDetailDialog.java
+0
-0
app/src/main/java/com/ihaoin/hooloo/device/view/LauncherActivity.java
+14
-6
app/src/main/java/com/ihaoin/hooloo/device/view/TrolleyView.java
+1
-1
app/src/main/res/drawable/bg_image_placeholder.xml
+21
-0
app/src/main/res/drawable/ic_dot_unchecked.xml
+11
-0
app/src/main/res/drawable/sel_intro_indicator.xml
+5
-0
app/src/main/res/layout/item_goods.xml
+7
-7
app/src/main/res/layout/item_recommend.xml
+16
-8
app/src/main/res/layout/item_spec_rule_recommend.xml
+0
-11
app/src/main/res/layout/item_trolley.xml
+4
-4
app/src/main/res/layout/view_goods_detail.xml
+31
-8
No files found.
app/src/main/java/com/ihaoin/hooloo/device/adapter/GoodsAdapter.java
View file @
8097f831
...
...
@@ -24,8 +24,6 @@ import com.ihaoin.hooloo.device.util.StringUtils;
import
com.ihaoin.hooloo.device.util.Utils
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Optional
;
public
class
GoodsAdapter
extends
BaseSectionQuickAdapter
<
ScrollBean
,
BaseViewHolder
>
{
private
Context
mContext
;
...
...
@@ -74,16 +72,16 @@ public class GoodsAdapter extends BaseSectionQuickAdapter<ScrollBean, BaseViewHo
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
)
{
helper
.
setText
(
R
.
id
.
txt_price
,
String
.
valueOf
(
goods
.
getPrice
()));
helper
.
setText
(
R
.
id
.
txt_discount
,
String
.
valueOf
(
goods
.
getDiscount
()));
helper
.
setText
(
R
.
id
.
txt_price
,
Utils
.
toString
(
goods
.
getPrice
()));
helper
.
setText
(
R
.
id
.
txt_discount
,
Utils
.
toString
(
goods
.
getDiscount
()));
helper
.
setGone
(
R
.
id
.
txt_sellout
,
true
);
helper
.
setGone
(
R
.
id
.
butn_add
,
false
);
}
else
{
helper
.
setText
(
R
.
id
.
txt_price
,
String
.
valueOf
(
sku
.
getPrice
()));
helper
.
setText
(
R
.
id
.
txt_discount
,
String
.
valueOf
(
sku
.
getDiscount
()));
helper
.
setText
(
R
.
id
.
txt_price
,
Utils
.
toString
(
sku
.
getPrice
()));
helper
.
setText
(
R
.
id
.
txt_discount
,
Utils
.
toString
(
sku
.
getDiscount
()));
if
(
Base
.
TRUE
.
equals
(
sku
.
getState
()))
{
helper
.
setGone
(
R
.
id
.
txt_sellout
,
false
);
...
...
@@ -105,10 +103,10 @@ public class GoodsAdapter extends BaseSectionQuickAdapter<ScrollBean, BaseViewHo
helper
.
setGone
(
R
.
id
.
img_recommend
,
false
);
}
TextView
ico
Discount
=
helper
.
getView
(
R
.
id
.
ico_discount
);
TextView
txt
Discount
=
helper
.
getView
(
R
.
id
.
txt_discount
);
ico
Discount
.
setPaintFlags
(
icoDiscount
.
getPaintFlags
()
|
Paint
.
STRIKE_THRU_TEXT_FLAG
);
txt
Discount
.
setPaintFlags
(
txtDiscount
.
getPaintFlags
()
|
Paint
.
STRIKE_THRU_TEXT_FLAG
);
TextView
ico
Price
=
helper
.
getView
(
R
.
id
.
ico_price
);
TextView
txt
Price
=
helper
.
getView
(
R
.
id
.
txt_price
);
ico
Price
.
setPaintFlags
(
icoPrice
.
getPaintFlags
()
|
Paint
.
STRIKE_THRU_TEXT_FLAG
);
txt
Price
.
setPaintFlags
(
txtPrice
.
getPaintFlags
()
|
Paint
.
STRIKE_THRU_TEXT_FLAG
);
View
layoutItem
=
helper
.
getView
(
R
.
id
.
layout_item
);
layoutItem
.
setOnClickListener
(
v
->
Utils
.
showGoodsDetail
(
mContext
,
goods
));
...
...
@@ -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
;
public
boolean
isTrolleyState
()
{
...
...
app/src/main/java/com/ihaoin/hooloo/device/adapter/TrolleyAdapter.java
View file @
8097f831
...
...
@@ -38,9 +38,9 @@ public class TrolleyAdapter extends BaseAdapter {
ImageView
imgThumbnail
=
convertView
.
findViewById
(
R
.
id
.
img_thumbnail
);
TextView
txtName
=
convertView
.
findViewById
(
R
.
id
.
txt_name
);
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
txtDiscount
=
convertView
.
findViewById
(
R
.
id
.
txt_discount
);
TextView
icoDiscount
=
convertView
.
findViewById
(
R
.
id
.
ico_discount
);
View
butnSubtract
=
convertView
.
findViewById
(
R
.
id
.
butn_subtract
);
TextView
txtCount
=
convertView
.
findViewById
(
R
.
id
.
txt_count
);
View
butnAdd
=
convertView
.
findViewById
(
R
.
id
.
butn_add
);
...
...
@@ -67,11 +67,11 @@ public class TrolleyAdapter extends BaseAdapter {
txtOptions
.
setVisibility
(
View
.
GONE
);
}
txtPrice
.
setText
(
goods
.
getPrice
().
toString
(
));
txtDiscount
.
setText
(
goods
.
getDiscount
().
toString
(
));
txtPrice
.
setText
(
Utils
.
toString
(
goods
.
getPrice
()
));
txtDiscount
.
setText
(
Utils
.
toString
(
goods
.
getDiscount
()
));
ico
Discount
.
setPaintFlags
(
icoDiscount
.
getPaintFlags
()
|
Paint
.
STRIKE_THRU_TEXT_FLAG
);
txt
Discount
.
setPaintFlags
(
txtDiscount
.
getPaintFlags
()
|
Paint
.
STRIKE_THRU_TEXT_FLAG
);
ico
Price
.
setPaintFlags
(
icoPrice
.
getPaintFlags
()
|
Paint
.
STRIKE_THRU_TEXT_FLAG
);
txt
Price
.
setPaintFlags
(
txtPrice
.
getPaintFlags
()
|
Paint
.
STRIKE_THRU_TEXT_FLAG
);
txtCount
.
setText
(
goods
.
getCount
().
toString
());
butnSubtract
.
setOnClickListener
(
v
->
trolleyView
.
subtractGoods
(
position
));
butnAdd
.
setOnClickListener
(
v
->
trolleyView
.
addGoods
(
position
));
...
...
app/src/main/java/com/ihaoin/hooloo/device/component/IntroViewPager.java
0 → 100644
View file @
8097f831
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
;
}
};
}
app/src/main/java/com/ihaoin/hooloo/device/util/Utils.java
View file @
8097f831
...
...
@@ -8,6 +8,7 @@ import android.util.DisplayMetrics;
import
android.view.TouchDelegate
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.widget.RadioGroup
;
import
androidx.coordinatorlayout.widget.ViewGroupUtils
;
...
...
@@ -22,7 +23,10 @@ import com.ihaoin.hooloo.device.view.GoodsDetailDialog;
import
com.ihaoin.hooloo.device.view.SettingsActivity
;
import
com.ihaoin.hooloo.device.view.TipsDialog
;
import
java.math.BigDecimal
;
import
java.text.DecimalFormat
;
import
java.util.List
;
import
java.util.Optional
;
public
class
Utils
{
...
...
@@ -123,4 +127,39 @@ public class Utils {
}));
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
());
}
}
app/src/main/java/com/ihaoin/hooloo/device/view/GoodsDetailDialog.java
View file @
8097f831
This diff is collapsed.
Click to expand it.
app/src/main/java/com/ihaoin/hooloo/device/view/LauncherActivity.java
View file @
8097f831
...
...
@@ -73,13 +73,12 @@ public class LauncherActivity extends Activity {
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
Log
.
d
(
AppConfig
.
DEBUG_TAG
,
"onCreate"
);
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_launcher
);
getWindow
().
setFlags
(
WindowManager
.
LayoutParams
.
FLAG_FULLSCREEN
,
WindowManager
.
LayoutParams
.
FLAG_FULLSCREEN
);
mContext
=
this
;
setMachineCode
();
requestPermissions
();
trolleyView
=
findViewById
(
R
.
id
.
view_trolley
);
...
...
@@ -87,7 +86,6 @@ public class LauncherActivity extends Activity {
recGoods
=
findViewById
(
R
.
id
.
rec_right
);
recRecommends
=
findViewById
(
R
.
id
.
rec_recommend
);
initRecommends
();
setRecommendsData
();
...
...
@@ -347,15 +345,28 @@ public class LauncherActivity extends Activity {
@Override
protected
void
onDestroy
()
{
Log
.
d
(
AppConfig
.
DEBUG_TAG
,
"onDestroy"
);
super
.
onDestroy
();
exit
();
}
private
void
exit
()
{
Log
.
d
(
AppConfig
.
DEBUG_TAG
,
"exit"
);
this
.
unregistTrolleyGoodsChangedReceiver
();
this
.
unregistTrolleyStateChangedReceiver
();
this
.
unregistSettingChangedReceiver
();
System
.
exit
(
0
);
}
@Override
public
void
onBackPressed
()
{
super
.
onBackPressed
();
exit
();
}
private
TrolleyGoodsChangedReceiver
trolleyGoodsChangedReceiver
=
null
;
private
TrolleyStateChangedReceiver
trolleyStateChangedReceiver
=
null
;
private
SettingChangedReceiver
settingChangedReceiver
;
/** 注册购物车广播 */
private
void
registTrolleyGoodsChangedReceiver
()
{
...
...
@@ -426,9 +437,6 @@ public class LauncherActivity extends Activity {
}
}
private
SettingChangedReceiver
settingChangedReceiver
;
private
void
registSettingChangedReceiver
()
{
settingChangedReceiver
=
new
SettingChangedReceiver
();
IntentFilter
filter
=
new
IntentFilter
();
...
...
app/src/main/java/com/ihaoin/hooloo/device/view/TrolleyView.java
View file @
8097f831
...
...
@@ -174,7 +174,7 @@ public class TrolleyView extends RelativeLayout {
public
void
goodsChanged
()
{
this
.
trolleyAdapter
.
notifyDataSetChanged
();
this
.
txtCount
.
setText
(
getCheckedCount
().
toString
());
this
.
txtTotal
.
setText
(
getCheckedTotal
().
toString
(
));
this
.
txtTotal
.
setText
(
Utils
.
toString
(
getCheckedTotal
()
));
this
.
setView
();
this
.
measureListHeight
();
}
...
...
app/src/main/res/drawable/bg_image_placeholder.xml
0 → 100644
View file @
8097f831
<?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>
app/src/main/res/drawable/ic_dot_unchecked.xml
0 → 100644
View file @
8097f831
<?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>
app/src/main/res/drawable/sel_intro_indicator.xml
0 → 100644
View file @
8097f831
<?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>
app/src/main/res/layout/item_goods.xml
View file @
8097f831
...
...
@@ -63,7 +63,7 @@
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/padding3"
>
<TextView
android:id=
"@+id/ico_
price
"
android:id=
"@+id/ico_
discount
"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentBottom=
"true"
...
...
@@ -72,32 +72,32 @@
android:textColor=
"@color/textRed"
android:textSize=
"@dimen/ts_goods_item_price"
/>
<TextView
android:id=
"@+id/txt_
price
"
android:id=
"@+id/txt_
discount
"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentBottom=
"true"
android:layout_toRightOf=
"@id/ico_
price
"
android:layout_toRightOf=
"@id/ico_
discount
"
android:text=
"19.9"
android:textColor=
"@color/textRed"
android:textSize=
"@dimen/ts_goods_item_price"
android:textStyle=
"bold"
/>
<TextView
android:id=
"@+id/ico_
discount
"
android:id=
"@+id/ico_
price
"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentBottom=
"true"
android:layout_marginStart=
"@dimen/padding5"
android:layout_toEndOf=
"@id/txt_
price
"
android:layout_toEndOf=
"@id/txt_
discount
"
android:text=
"¥"
android:textColor=
"@color/textSecondPrimary"
android:textSize=
"@dimen/ts_goods_item_discount"
/>
<TextView
android:id=
"@+id/txt_
discount
"
android:id=
"@+id/txt_
price
"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentBottom=
"true"
android:layout_toEndOf=
"@id/ico_
discount
"
android:layout_toEndOf=
"@id/ico_
price
"
android:text=
"29.9"
android:textColor=
"@color/textSecondPrimary"
android:textSize=
"@dimen/ts_goods_item_discount"
/>
...
...
app/src/main/res/layout/item_recommend.xml
View file @
8097f831
<?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:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
...
...
@@ -8,25 +9,32 @@
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:adjustViewBounds=
"true"
android:scaleType=
"centerCrop"
/>
android:scaleType=
"centerCrop"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
android:id=
"@+id/txt_name"
android:layout_width=
"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:textColor=
"@color/white"
android:textSize=
"@dimen/ts_recommend_name"
android:textStyle=
"bold"
/>
android:textStyle=
"bold"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
android:id=
"@+id/txt_intro"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_below=
"@+id/txt_name"
android:layout_marginStart=
"@dimen/padding20"
android:layout_margin
Top=
"@dimen/padding10
"
android:layout_margin
Bottom=
"@dimen/padding15
"
android:singleLine=
"true"
android:textColor=
"@color/white"
android:textSize=
"@dimen/ts_recommend_desc"
android:textStyle=
"bold"
/>
</RelativeLayout>
\ No newline at end of file
android:textStyle=
"bold"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintLeft_toLeftOf=
"parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/item_spec_rule_recommend.xml
deleted
100644 → 0
View file @
daa586fa
<?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"
/>
app/src/main/res/layout/item_trolley.xml
View file @
8097f831
...
...
@@ -50,14 +50,14 @@
android:gravity=
"bottom"
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/ico_
price
"
android:id=
"@+id/ico_
discount
"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"¥"
android:textColor=
"@color/textRed"
android:textSize=
"@dimen/ts_goods_item_price"
/>
<TextView
android:id=
"@+id/txt_
price
"
android:id=
"@+id/txt_
discount
"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"19.9"
...
...
@@ -65,7 +65,7 @@
android:textSize=
"@dimen/ts_goods_item_price"
android:textStyle=
"bold"
/>
<TextView
android:id=
"@+id/ico_
discount
"
android:id=
"@+id/ico_
price
"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"@dimen/padding5"
...
...
@@ -73,7 +73,7 @@
android:textColor=
"@color/textSecondPrimary"
android:textSize=
"@dimen/ts_goods_item_discount"
/>
<TextView
android:id=
"@+id/txt_
discount
"
android:id=
"@+id/txt_
price
"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
...
...
app/src/main/res/layout/view_goods_detail.xml
View file @
8097f831
<?xml version="1.0" encoding="utf-8"?>
<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:layout_width=
"@dimen/dialog_detail_width"
android:layout_height=
"match_parent"
>
...
...
@@ -17,13 +18,27 @@
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
android:padding=
"@dimen/padding10"
>
<ImageView
android:id=
"@+id/img_intro"
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_margin=
"@dimen/padding10"
android:layout_weight=
"1"
android:adjustViewBounds=
"true"
/>
android:layout_weight=
"1"
>
<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
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
...
...
@@ -43,6 +58,14 @@
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
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
android:id=
"@+id/layout_images"
android:layout_width=
"match_parent"
...
...
@@ -72,14 +95,14 @@
android:gravity=
"bottom"
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/ico_
price
"
android:id=
"@+id/ico_
discount
"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"¥"
android:textColor=
"@color/textRed"
android:textSize=
"@dimen/ts_detail_price"
/>
<TextView
android:id=
"@+id/txt_
price
"
android:id=
"@+id/txt_
discount
"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:gravity=
"center_vertical"
...
...
@@ -89,7 +112,7 @@
android:textStyle=
"bold"
/>
<TextView
android:id=
"@+id/ico_
discount
"
android:id=
"@+id/ico_
price
"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"@dimen/padding5"
...
...
@@ -97,7 +120,7 @@
android:textColor=
"@color/textSecondPrimary"
android:textSize=
"@dimen/ts_detail_discount"
/>
<TextView
android:id=
"@+id/txt_
discount
"
android:id=
"@+id/txt_
price
"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:gravity=
"center_vertical"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment