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
0ef0f1f0
Commit
0ef0f1f0
authored
Aug 31, 2022
by
wjg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add update
parent
52c48c55
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
76 additions
and
16 deletions
+76
-16
app/src/main/java/com/ihaoin/hooloo/device/component/FixedSpeedScroller.java
+38
-0
app/src/main/java/com/ihaoin/hooloo/device/component/IntroViewPager.java
+9
-8
app/src/main/java/com/ihaoin/hooloo/device/home/dialog/GoodsDetailDialog.java
+3
-3
app/src/main/java/com/ihaoin/hooloo/device/kds/view/MenuPresentation.java
+22
-1
app/src/main/res/values-w800dp/dimens.xml
+2
-2
app/src/main/res/values/dimens.xml
+2
-2
No files found.
app/src/main/java/com/ihaoin/hooloo/device/component/FixedSpeedScroller.java
0 → 100644
View file @
0ef0f1f0
package
com
.
ihaoin
.
hooloo
.
device
.
component
;
import
android.content.Context
;
import
android.view.animation.Interpolator
;
import
android.widget.Scroller
;
public
class
FixedSpeedScroller
extends
Scroller
{
private
int
mDuration
=
1500
;
public
FixedSpeedScroller
(
Context
context
)
{
super
(
context
);
}
public
FixedSpeedScroller
(
Context
context
,
Interpolator
interpolator
)
{
super
(
context
,
interpolator
);
}
@Override
public
void
startScroll
(
int
startX
,
int
startY
,
int
dx
,
int
dy
,
int
duration
)
{
// Ignore received duration, use fixed one instead
super
.
startScroll
(
startX
,
startY
,
dx
,
dy
,
mDuration
);
}
@Override
public
void
startScroll
(
int
startX
,
int
startY
,
int
dx
,
int
dy
)
{
// Ignore received duration, use fixed one instead
super
.
startScroll
(
startX
,
startY
,
dx
,
dy
,
mDuration
);
}
public
void
setmDuration
(
int
time
)
{
mDuration
=
time
;
}
public
int
getmDuration
()
{
return
mDuration
;
}
}
\ No newline at end of file
app/src/main/java/com/ihaoin/hooloo/device/component/IntroViewPager.java
View file @
0ef0f1f0
...
@@ -51,20 +51,21 @@ public class IntroViewPager extends ViewPager {
...
@@ -51,20 +51,21 @@ public class IntroViewPager extends ViewPager {
if
(
CollectionUtils
.
isEmpty
(
introViews
))
{
if
(
CollectionUtils
.
isEmpty
(
introViews
))
{
return
null
;
return
null
;
}
}
return
introViews
.
get
(
index
);
return
introViews
.
get
(
index
%
introViews
.
size
()
);
}
}
public
int
getCount
()
{
public
int
getCount
()
{
if
(
pagerAdapter
==
null
)
{
return
Integer
.
MAX_VALUE
;
return
0
;
// if (pagerAdapter == null) {
}
// return 0;
return
pagerAdapter
.
getCount
();
// }
// return pagerAdapter.getCount();
}
}
private
PagerAdapter
pagerAdapter
=
new
PagerAdapter
()
{
private
PagerAdapter
pagerAdapter
=
new
PagerAdapter
()
{
@Override
@Override
public
int
getCount
()
{
public
int
getCount
()
{
return
CollectionUtils
.
isEmpty
(
introViews
)
?
0
:
introViews
.
size
()
;
return
CollectionUtils
.
isEmpty
(
introViews
)
?
0
:
Integer
.
MAX_VALUE
;
}
}
@Override
@Override
...
@@ -74,7 +75,7 @@ public class IntroViewPager extends ViewPager {
...
@@ -74,7 +75,7 @@ public class IntroViewPager extends ViewPager {
@Override
@Override
public
void
destroyItem
(
@NonNull
ViewGroup
container
,
int
position
,
@NonNull
Object
object
)
{
public
void
destroyItem
(
@NonNull
ViewGroup
container
,
int
position
,
@NonNull
Object
object
)
{
View
view
=
introViews
.
get
(
position
);
View
view
=
getView
(
position
);
container
.
removeView
(
view
);
container
.
removeView
(
view
);
}
}
...
@@ -84,7 +85,7 @@ public class IntroViewPager extends ViewPager {
...
@@ -84,7 +85,7 @@ public class IntroViewPager extends ViewPager {
if
(
CollectionUtils
.
isEmpty
(
introViews
))
{
if
(
CollectionUtils
.
isEmpty
(
introViews
))
{
return
null
;
return
null
;
}
}
View
view
=
introViews
.
get
(
position
);
View
view
=
getView
(
position
);
container
.
addView
(
view
);
container
.
addView
(
view
);
return
view
;
return
view
;
}
}
...
...
app/src/main/java/com/ihaoin/hooloo/device/home/dialog/GoodsDetailDialog.java
View file @
0ef0f1f0
...
@@ -27,11 +27,10 @@ import androidx.viewpager.widget.ViewPager;
...
@@ -27,11 +27,10 @@ import androidx.viewpager.widget.ViewPager;
import
com.fasterxml.jackson.databind.JsonNode
;
import
com.fasterxml.jackson.databind.JsonNode
;
import
com.ihaoin.hooloo.device.HLApplication
;
import
com.ihaoin.hooloo.device.HLApplication
;
import
com.ihaoin.hooloo.device.R
;
import
com.ihaoin.hooloo.device.R
;
import
com.ihaoin.hooloo.device.component.AutoWrapLayout
;
import
com.ihaoin.hooloo.device.component.IntroViewPager
;
import
com.ihaoin.hooloo.device.network.NetworkHandler
;
import
com.ihaoin.hooloo.device.base.AppConfig
;
import
com.ihaoin.hooloo.device.base.AppConfig
;
import
com.ihaoin.hooloo.device.base.Base
;
import
com.ihaoin.hooloo.device.base.Base
;
import
com.ihaoin.hooloo.device.component.AutoWrapLayout
;
import
com.ihaoin.hooloo.device.component.IntroViewPager
;
import
com.ihaoin.hooloo.device.data.enums.SkuState
;
import
com.ihaoin.hooloo.device.data.enums.SkuState
;
import
com.ihaoin.hooloo.device.data.vo.Goods
;
import
com.ihaoin.hooloo.device.data.vo.Goods
;
import
com.ihaoin.hooloo.device.data.vo.GoodsRule
;
import
com.ihaoin.hooloo.device.data.vo.GoodsRule
;
...
@@ -40,6 +39,7 @@ import com.ihaoin.hooloo.device.data.vo.SkuRule;
...
@@ -40,6 +39,7 @@ import com.ihaoin.hooloo.device.data.vo.SkuRule;
import
com.ihaoin.hooloo.device.data.vo.SkuStateChangedVo
;
import
com.ihaoin.hooloo.device.data.vo.SkuStateChangedVo
;
import
com.ihaoin.hooloo.device.home.view.LauncherActivity
;
import
com.ihaoin.hooloo.device.home.view.LauncherActivity
;
import
com.ihaoin.hooloo.device.network.HttpUtil
;
import
com.ihaoin.hooloo.device.network.HttpUtil
;
import
com.ihaoin.hooloo.device.network.NetworkHandler
;
import
com.ihaoin.hooloo.device.util.CollectionUtils
;
import
com.ihaoin.hooloo.device.util.CollectionUtils
;
import
com.ihaoin.hooloo.device.util.JsonUtils
;
import
com.ihaoin.hooloo.device.util.JsonUtils
;
import
com.ihaoin.hooloo.device.util.StringUtils
;
import
com.ihaoin.hooloo.device.util.StringUtils
;
...
...
app/src/main/java/com/ihaoin/hooloo/device/kds/view/MenuPresentation.java
View file @
0ef0f1f0
...
@@ -15,6 +15,7 @@ import android.util.DisplayMetrics;
...
@@ -15,6 +15,7 @@ import android.util.DisplayMetrics;
import
android.view.Display
;
import
android.view.Display
;
import
android.view.View
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.view.ViewGroup
;
import
android.view.animation.LinearInterpolator
;
import
android.widget.ImageView
;
import
android.widget.ImageView
;
import
android.widget.LinearLayout
;
import
android.widget.LinearLayout
;
import
android.widget.TextView
;
import
android.widget.TextView
;
...
@@ -23,12 +24,15 @@ import androidx.annotation.NonNull;
...
@@ -23,12 +24,15 @@ import androidx.annotation.NonNull;
import
androidx.recyclerview.widget.LinearLayoutManager
;
import
androidx.recyclerview.widget.LinearLayoutManager
;
import
androidx.recyclerview.widget.LinearSmoothScroller
;
import
androidx.recyclerview.widget.LinearSmoothScroller
;
import
androidx.recyclerview.widget.RecyclerView
;
import
androidx.recyclerview.widget.RecyclerView
;
import
androidx.viewpager.widget.ViewPager
;
import
com.ihaoin.hooloo.device.HLApplication
;
import
com.ihaoin.hooloo.device.HLApplication
;
import
com.ihaoin.hooloo.device.R
;
import
com.ihaoin.hooloo.device.R
;
import
com.ihaoin.hooloo.device.component.IntroViewPager
;
import
com.ihaoin.hooloo.device.base.Base
;
import
com.ihaoin.hooloo.device.base.Base
;
import
com.ihaoin.hooloo.device.component.FixedSpeedScroller
;
import
com.ihaoin.hooloo.device.component.IntroViewPager
;
import
com.ihaoin.hooloo.device.data.MainData
;
import
com.ihaoin.hooloo.device.data.MainData
;
import
com.ihaoin.hooloo.device.data.vo.Images
;
import
com.ihaoin.hooloo.device.data.vo.KDSMsg
;
import
com.ihaoin.hooloo.device.data.vo.KDSMsg
;
import
com.ihaoin.hooloo.device.data.vo.KDSOrder
;
import
com.ihaoin.hooloo.device.data.vo.KDSOrder
;
import
com.ihaoin.hooloo.device.kds.KDSSocket
;
import
com.ihaoin.hooloo.device.kds.KDSSocket
;
...
@@ -37,7 +41,9 @@ import com.ihaoin.hooloo.device.util.CollectionUtils;
...
@@ -37,7 +41,9 @@ import com.ihaoin.hooloo.device.util.CollectionUtils;
import
com.ihaoin.hooloo.device.util.StringUtils
;
import
com.ihaoin.hooloo.device.util.StringUtils
;
import
com.ihaoin.hooloo.device.util.Utils
;
import
com.ihaoin.hooloo.device.util.Utils
;
import
java.lang.reflect.Field
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.List
;
public
class
MenuPresentation
extends
Presentation
{
public
class
MenuPresentation
extends
Presentation
{
...
@@ -121,10 +127,25 @@ public class MenuPresentation extends Presentation {
...
@@ -121,10 +127,25 @@ public class MenuPresentation extends Presentation {
AnimationDrawable
anim
=
(
AnimationDrawable
)
getContext
().
getDrawable
(
R
.
drawable
.
menu_avatar
);
AnimationDrawable
anim
=
(
AnimationDrawable
)
getContext
().
getDrawable
(
R
.
drawable
.
menu_avatar
);
imgAvatar
.
setBackground
(
anim
);
imgAvatar
.
setBackground
(
anim
);
anim
.
start
();
anim
.
start
();
try
{
Field
field
=
ViewPager
.
class
.
getDeclaredField
(
"mScroller"
);
field
.
setAccessible
(
true
);
FixedSpeedScroller
scroller
=
new
FixedSpeedScroller
(
imagePager
.
getContext
(),
new
LinearInterpolator
());
field
.
set
(
imagePager
,
scroller
);
scroller
.
setmDuration
(
500
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
private
void
showImages
()
{
private
void
showImages
()
{
MainData
mainData
=
HLApplication
.
getMainData
();
MainData
mainData
=
HLApplication
.
getMainData
();
// TODO TEST
List
<
String
>
imgs
=
Arrays
.
asList
(
"https://hooloo-saas-test.oss-cn-beijing.aliyuncs.com/hooloo/2022/07/04/%E7%82%B9%E5%8D%95%E5%B1%8F%E5%86%85%E5%AE%B9%E5%9B%BE3.png"
,
"https://hooloo-saas-test.oss-cn-beijing.aliyuncs.com/hooloo/2022/07/04/%E7%82%B9%E5%8D%95%E5%B1%8F%E5%86%85%E5%AE%B9%E5%9B%BE3.png"
,
"https://hooloo-saas-test.oss-cn-beijing.aliyuncs.com/hooloo/2022/07/04/%E7%82%B9%E5%8D%95%E5%B1%8F%E5%86%85%E5%AE%B9%E5%9B%BE3.png"
);
Images
img
=
new
Images
();
img
.
setLeft
(
imgs
);
mainData
.
setImages
(
img
);
if
(
mainData
==
null
||
mainData
.
getImages
()
==
null
)
{
if
(
mainData
==
null
||
mainData
.
getImages
()
==
null
)
{
return
;
return
;
}
}
...
...
app/src/main/res/values-w800dp/dimens.xml
View file @
0ef0f1f0
...
@@ -34,8 +34,8 @@
...
@@ -34,8 +34,8 @@
<dimen
name=
"goods_price_margin"
>
5px
</dimen>
<dimen
name=
"goods_price_margin"
>
5px
</dimen>
<dimen
name=
"category_padding_top"
>
17px
</dimen>
<dimen
name=
"category_padding_top"
>
17px
</dimen>
<dimen
name=
"category_padding_bottom"
>
32px
</dimen>
<dimen
name=
"category_padding_bottom"
>
32px
</dimen>
<dimen
name=
"category_padding_top_noimg"
>
28
px
</dimen>
<dimen
name=
"category_padding_top_noimg"
>
56
px
</dimen>
<dimen
name=
"category_padding_bottom_noimg"
>
33
px
</dimen>
<dimen
name=
"category_padding_bottom_noimg"
>
70
px
</dimen>
<dimen
name=
"category_padding_hor"
>
35px
</dimen>
<dimen
name=
"category_padding_hor"
>
35px
</dimen>
<dimen
name=
"category_drawable_padding"
>
10px
</dimen>
<dimen
name=
"category_drawable_padding"
>
10px
</dimen>
<dimen
name=
"category_drawable_width"
>
100px
</dimen>
<dimen
name=
"category_drawable_width"
>
100px
</dimen>
...
...
app/src/main/res/values/dimens.xml
View file @
0ef0f1f0
...
@@ -34,8 +34,8 @@
...
@@ -34,8 +34,8 @@
<dimen
name=
"goods_price_margin"
>
5px
</dimen>
<dimen
name=
"goods_price_margin"
>
5px
</dimen>
<dimen
name=
"category_padding_top"
>
17px
</dimen>
<dimen
name=
"category_padding_top"
>
17px
</dimen>
<dimen
name=
"category_padding_bottom"
>
32px
</dimen>
<dimen
name=
"category_padding_bottom"
>
32px
</dimen>
<dimen
name=
"category_padding_top_noimg"
>
2
8
px
</dimen>
<dimen
name=
"category_padding_top_noimg"
>
2
0
px
</dimen>
<dimen
name=
"category_padding_bottom_noimg"
>
33
px
</dimen>
<dimen
name=
"category_padding_bottom_noimg"
>
70
px
</dimen>
<dimen
name=
"category_padding_hor"
>
35px
</dimen>
<dimen
name=
"category_padding_hor"
>
35px
</dimen>
<dimen
name=
"category_drawable_padding"
>
10px
</dimen>
<dimen
name=
"category_drawable_padding"
>
10px
</dimen>
<dimen
name=
"category_drawable_width"
>
100px
</dimen>
<dimen
name=
"category_drawable_width"
>
100px
</dimen>
...
...
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