Commit 00b09a2b by wjg

v2

parent 4749ba25
...@@ -71,7 +71,7 @@ public class IntroViewPager extends ViewPager { ...@@ -71,7 +71,7 @@ public class IntroViewPager extends ViewPager {
v.measure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED)); v.measure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));
height = v.getMeasuredHeight(); height = v.getMeasuredHeight();
} }
Utils.i("onMeasure v=" + (v != null) + ", index=" + index + ", h=" + height); // Utils.i("onMeasure v=" + (v != null) + ", index=" + index + ", h=" + height);
heightMeasureSpec = MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY); heightMeasureSpec = MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY);
super.onMeasure(widthMeasureSpec, heightMeasureSpec); super.onMeasure(widthMeasureSpec, heightMeasureSpec);
} }
...@@ -121,7 +121,7 @@ public class IntroViewPager extends ViewPager { ...@@ -121,7 +121,7 @@ public class IntroViewPager extends ViewPager {
if (CollectionUtils.isEmpty(introUrls)) { if (CollectionUtils.isEmpty(introUrls)) {
return null; return null;
} }
Utils.i("instantiateItem: " + position); // Utils.i("instantiateItem: " + position);
View view = getView(position); View view = getView(position);
container.addView(view); container.addView(view);
return view; return view;
...@@ -131,7 +131,7 @@ public class IntroViewPager extends ViewPager { ...@@ -131,7 +131,7 @@ public class IntroViewPager extends ViewPager {
private View getView(Integer position) { private View getView(Integer position) {
ImageView imageView = (ImageView) LayoutInflater.from(getContext()).inflate(R.layout.intro_image, null); ImageView imageView = (ImageView) LayoutInflater.from(getContext()).inflate(R.layout.intro_image, null);
String url = introUrls.get(position % introUrls.size()); String url = introUrls.get(position % introUrls.size());
Utils.i("getView: " + (position % introUrls.size())); // Utils.i("getView: " + (position % introUrls.size()));
Utils.getGlide(getContext()).load(url).diskCacheStrategy(DiskCacheStrategy.ALL).into(imageView); Utils.getGlide(getContext()).load(url).diskCacheStrategy(DiskCacheStrategy.ALL).into(imageView);
return imageView; return imageView;
} }
......
...@@ -291,6 +291,7 @@ public class ConfirmOrderDialog extends Dialog { ...@@ -291,6 +291,7 @@ public class ConfirmOrderDialog extends Dialog {
if (!StringUtils.isEmpty(HLApplication.RECOGNIZE_PERSON)) { if (!StringUtils.isEmpty(HLApplication.RECOGNIZE_PERSON)) {
url += "recognizePerson=" + HLApplication.RECOGNIZE_PERSON; url += "recognizePerson=" + HLApplication.RECOGNIZE_PERSON;
} }
Utils.i("url=" + url);
int width = Utils.dpToPx(getContext(), 800); // 图像宽度 int width = Utils.dpToPx(getContext(), 800); // 图像宽度
int height = Utils.dpToPx(getContext(), 800); // 图像高度 int height = Utils.dpToPx(getContext(), 800); // 图像高度
Map<EncodeHintType, Object> hints = new HashMap(); Map<EncodeHintType, Object> hints = new HashMap();
......
...@@ -127,7 +127,7 @@ public class LauncherActivity extends Activity { ...@@ -127,7 +127,7 @@ public class LauncherActivity extends Activity {
startMachineClient(); startMachineClient();
startTimeoutThread(); startTimeoutThread();
getMachineCode(); getMachineCode();
startUpdateSocket(); // startUpdateSocket();
// new UpdateService().start(); // new UpdateService().start();
View.OnClickListener l = v -> { View.OnClickListener l = v -> {
...@@ -146,7 +146,7 @@ public class LauncherActivity extends Activity { ...@@ -146,7 +146,7 @@ public class LauncherActivity extends Activity {
// msg.setSentences(Utils.getSents("HOO感谢你啊", "感谢在美好的时间遇到了你", "感谢在美好的时间遇到了你", "感谢在美好的时间遇到了你")); // msg.setSentences(Utils.getSents("HOO感谢你啊", "感谢在美好的时间遇到了你", "感谢在美好的时间遇到了你", "感谢在美好的时间遇到了你"));
// break; // break;
case R.id.butn_3: case R.id.butn_3:
msg = JsonUtils.readValue("{\"state\":2,\"stateDesc\":\"男\",\"sentences\":[{\"turn\":1,\"fontSize\":50,\"sentence\":\"小哥哥晚上好啊\"},{\"turn\":2,\"fontSize\":40,\"sentence\":\"打工辛苦\"},{\"turn\":3,\"fontSize\":40,\"sentence\":\"上衣尤其有个性\"}],\"cutToPicture\":\"hoo转场\",\"picture\":\"hoo接待\",\"background\":\"hoo接待\",\"backgroundDesc\":\"中秋晚上多云沙漠\",\"recommendGoods\":\"拿铁\",\"goodsId\":15000,\"goodsIcon\":\"https://hooloo-saas-test.oss-cn-beijing.aliyuncs.com/hooloo/2022/07/09/图片规格 [已恢复]-14.png\",\"recommendSentence\":\"喝杯拿铁吧,下面有菜单哈\",\"recognizePerson\":\"\",\"isContinue\":1,\"isBreak\":0}", InteractionMsg.class); msg = JsonUtils.readValue("{\"state\":2,\"stateDesc\":\"男\",\"sentences\":[{\"turn\":1,\"fontSize\":100,\"sentence\":\"小哥哥晚上好啊\"},{\"turn\":2,\"fontSize\":60,\"sentence\":\"打工辛苦\"},{\"turn\":3,\"fontSize\":60,\"sentence\":\"上衣尤其有个性\"}],\"cutToPicture\":\"hoo转场\",\"picture\":\"hoo接待\",\"background\":\"hoo接待\",\"backgroundDesc\":\"中秋晚上多云沙漠\",\"recommendGoods\":\"拿铁\",\"goodsId\":15000,\"goodsIcon\":\"https://hooloo-saas-test.oss-cn-beijing.aliyuncs.com/hooloo/2022/07/09/图片规格 [已恢复]-14.png\",\"recommendSentence\":\"喝杯拿铁吧,下面有菜单哈\",\"recognizePerson\":\"\",\"isContinue\":1,\"isBreak\":0}", InteractionMsg.class);
break; break;
case R.id.butn_4: case R.id.butn_4:
msg = JsonUtils.readValue("{\"state\":2,\"stateDesc\":\"男\",\"sentences\":[{\"turn\":1,\"fontSize\":50,\"sentence\":\"大哥哥上午好呐\"},{\"turn\":2,\"fontSize\":40,\"sentence\":\"出门打工\"},{\"turn\":3,\"fontSize\":40,\"sentence\":\"衬衫真有个性\"}],\"cutToPicture\":\"hoo转场2\",\"picture\":\"hoo接待\",\"background\":\"hoo接待\",\"backgroundDesc\":\"中秋上午多云沙漠\",\"recommendGoods\":\"拿铁\",\"goodsId\":180,\"goodsIcon\":\"https://hooloo-saas-test.oss-cn-beijing.aliyuncs.com/hooloo/2022/07/09/图片规格[已恢复]-14.png\",\"recommendSentence\":\"来杯拿铁补充原动力吧,希望给你带来好心情2\",\"recognizePerson\":\"person_2\",\"isContinue\":0,\"isBreak\":0}", InteractionMsg.class); msg = JsonUtils.readValue("{\"state\":2,\"stateDesc\":\"男\",\"sentences\":[{\"turn\":1,\"fontSize\":50,\"sentence\":\"大哥哥上午好呐\"},{\"turn\":2,\"fontSize\":40,\"sentence\":\"出门打工\"},{\"turn\":3,\"fontSize\":40,\"sentence\":\"衬衫真有个性\"}],\"cutToPicture\":\"hoo转场2\",\"picture\":\"hoo接待\",\"background\":\"hoo接待\",\"backgroundDesc\":\"中秋上午多云沙漠\",\"recommendGoods\":\"拿铁\",\"goodsId\":180,\"goodsIcon\":\"https://hooloo-saas-test.oss-cn-beijing.aliyuncs.com/hooloo/2022/07/09/图片规格[已恢复]-14.png\",\"recommendSentence\":\"来杯拿铁补充原动力吧,希望给你带来好心情2\",\"recognizePerson\":\"person_2\",\"isContinue\":0,\"isBreak\":0}", InteractionMsg.class);
......
...@@ -36,6 +36,7 @@ import androidx.annotation.NonNull; ...@@ -36,6 +36,7 @@ import androidx.annotation.NonNull;
import com.bumptech.glide.load.engine.DiskCacheStrategy; import com.bumptech.glide.load.engine.DiskCacheStrategy;
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.base.AppConfig;
import com.ihaoin.hooloo.device.base.Base; import com.ihaoin.hooloo.device.base.Base;
import com.ihaoin.hooloo.device.component.AnimationListener; import com.ihaoin.hooloo.device.component.AnimationListener;
import com.ihaoin.hooloo.device.component.AnimatorListener; import com.ihaoin.hooloo.device.component.AnimatorListener;
...@@ -122,7 +123,9 @@ public class InteractionPresentation extends Presentation { ...@@ -122,7 +123,9 @@ public class InteractionPresentation extends Presentation {
} }
private void setInteractionMsg(InteractionMsg msg) { private void setInteractionMsg(InteractionMsg msg) {
Utils.showToast(getContext(), String.format("交互屏消息,队列:%s, 转场:%s, 动画:%s, 重复:%s, 打断:%s, 商品:%s", mMsgQueue.size(), msg.getCutToPicture(), msg.getPicture(), msg.getIsContinue(), msg.getIsBreak(), msg.getGoodsId()), Toast.LENGTH_LONG); if (AppConfig.DEBUG) {
Utils.showToast(getContext(), String.format("交互屏消息,队列:%s, 转场:%s, 动画:%s, 重复:%s, 打断:%s, 商品:%s", mMsgQueue.size(), msg.getCutToPicture(), msg.getPicture(), msg.getIsContinue(), msg.getIsBreak(), msg.getGoodsId()), Toast.LENGTH_LONG);
}
HLApplication.RECOGNIZE_PERSON = msg.getRecognizePerson(); HLApplication.RECOGNIZE_PERSON = msg.getRecognizePerson();
if (Base.TRUE.equals(msg.getIsBreak()) || mMsgQueue.size() >= 2) { if (Base.TRUE.equals(msg.getIsBreak()) || mMsgQueue.size() >= 2) {
mMsgQueue.clear(); mMsgQueue.clear();
...@@ -153,7 +156,6 @@ public class InteractionPresentation extends Presentation { ...@@ -153,7 +156,6 @@ public class InteractionPresentation extends Presentation {
InteractionMsg msg = (InteractionMsg) message.obj; InteractionMsg msg = (InteractionMsg) message.obj;
if (message.what == 1) { // 播放文字动画 if (message.what == 1) { // 播放文字动画
startTextInAnim(msg); startTextInAnim(msg);
startRecommendInAnim(msg);
} else if (message.what == 2) { // 清除文字动画 } else if (message.what == 2) { // 清除文字动画
clearTextAnim(msg); clearTextAnim(msg);
startRecommendOutAnim(msg); startRecommendOutAnim(msg);
...@@ -181,7 +183,7 @@ public class InteractionPresentation extends Presentation { ...@@ -181,7 +183,7 @@ public class InteractionPresentation extends Presentation {
recommendText.setText(""); recommendText.setText("");
recommendIcon.setImageDrawable(null); recommendIcon.setImageDrawable(null);
smasher.reShowView(layoutRecommend); smasher.reShowView(layoutRecommend);
startRecommendInAnim(msg); // startRecommendInAnim(msg);
} }
}).start(); }).start();
...@@ -197,14 +199,14 @@ public class InteractionPresentation extends Presentation { ...@@ -197,14 +199,14 @@ public class InteractionPresentation extends Presentation {
// animation.start(); // animation.start();
} }
private void startRecommendInAnim(InteractionMsg msg) { private void startRecommendInAnim(InteractionMsg msg, Integer delay) {
if (msg == null || StringUtils.isEmpty(msg.getRecommendSentence()) || StringUtils.isEmpty(msg.getRecommendGoods())) { if (msg == null || StringUtils.isEmpty(msg.getRecommendSentence()) || StringUtils.isEmpty(msg.getRecommendGoods())) {
return; return;
} }
int start = msg.getRecommendSentence().indexOf(msg.getRecommendGoods()); int start = msg.getRecommendSentence().indexOf(msg.getRecommendGoods());
int end = start + msg.getRecommendGoods().length(); int end = start + msg.getRecommendGoods().length();
SpannableStringBuilder builder = new SpannableStringBuilder(msg.getRecommendSentence()); SpannableStringBuilder builder = new SpannableStringBuilder(msg.getRecommendSentence());
builder.setSpan(new ForegroundColorSpan(getContext().getColor(R.color.colorLogo)), start, end, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); builder.setSpan(new ForegroundColorSpan(getContext().getColor(R.color.recommendPink)), start, end, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
builder.setSpan(new AbsoluteSizeSpan(Utils.getDimens(getContext(), R.dimen.ts_interaction_recommend_big)), start, end, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); builder.setSpan(new AbsoluteSizeSpan(Utils.getDimens(getContext(), R.dimen.ts_interaction_recommend_big)), start, end, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
recommendText.setText(builder); recommendText.setText(builder);
Utils.getGlide(getContext()).load(Utils.getThumbnailUrl(msg.getGoodsIcon())).diskCacheStrategy(DiskCacheStrategy.ALL).into(recommendIcon); Utils.getGlide(getContext()).load(Utils.getThumbnailUrl(msg.getGoodsIcon())).diskCacheStrategy(DiskCacheStrategy.ALL).into(recommendIcon);
...@@ -212,9 +214,12 @@ public class InteractionPresentation extends Presentation { ...@@ -212,9 +214,12 @@ public class InteractionPresentation extends Presentation {
Animation alphaAnimation = new AlphaAnimation(0, 1); Animation alphaAnimation = new AlphaAnimation(0, 1);
TranslateAnimation leftAnimation = new TranslateAnimation(-light1.getWidth(), 1080, 0, 0); TranslateAnimation leftAnimation = new TranslateAnimation(-light1.getWidth(), 1080, 0, 0);
TranslateAnimation rightAnimation = new TranslateAnimation(light2.getWidth(), -1080, 0, 0); TranslateAnimation rightAnimation = new TranslateAnimation(light2.getWidth(), -1080, 0, 0);
alphaAnimation.setDuration(600); alphaAnimation.setStartOffset(delay);
leftAnimation.setDuration(600); leftAnimation.setStartOffset(delay);
rightAnimation.setDuration(600); rightAnimation.setStartOffset(delay);
alphaAnimation.setDuration(3000);
leftAnimation.setDuration(2000);
rightAnimation.setDuration(2000);
layoutRecommend.setVisibility(View.VISIBLE); layoutRecommend.setVisibility(View.VISIBLE);
light1.setVisibility(View.VISIBLE); light1.setVisibility(View.VISIBLE);
...@@ -472,6 +477,10 @@ public class InteractionPresentation extends Presentation { ...@@ -472,6 +477,10 @@ public class InteractionPresentation extends Presentation {
layout.addView(popText); layout.addView(popText);
layout.setVisibility(View.VISIBLE); layout.setVisibility(View.VISIBLE);
if (j == sentenceStr.length() - 1) {
startRecommendInAnim(msg, delay);
}
// 文字弹出动画 // 文字弹出动画
ScaleAnimation scaleAnimation = new ScaleAnimation(0, 1, 0, 1, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); ScaleAnimation scaleAnimation = new ScaleAnimation(0, 1, 0, 1, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
scaleAnimation.setAnimationListener(new AnimationListener() { scaleAnimation.setAnimationListener(new AnimationListener() {
......
...@@ -325,7 +325,7 @@ public class Utils { ...@@ -325,7 +325,7 @@ public class Utils {
} }
public static Typeface getInteractionFont(Context context) { public static Typeface getInteractionFont(Context context) {
return Typeface.createFromAsset(context.getAssets(), "fonts/SourceHanSansCN-Bold.otf"); return Typeface.createFromAsset(context.getAssets(), "fonts/MFXiYou_Noncommercial-Regular.otf");
} }
public static Typeface getAmountFont(Context context) { public static Typeface getAmountFont(Context context) {
......
...@@ -69,7 +69,8 @@ ...@@ -69,7 +69,8 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_margin="@dimen/interaction_recommend_margin" android:layout_marginHorizontal="@dimen/interaction_recommend_margin"
android:layout_marginBottom="@dimen/interaction_recommend_margin_bottom"
android:gravity="bottom" android:gravity="bottom"
android:orientation="horizontal" android:orientation="horizontal"
android:visibility="invisible"> android:visibility="invisible">
...@@ -79,6 +80,7 @@ ...@@ -79,6 +80,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginRight="@dimen/interaction_recommend_image_margin" android:layout_marginRight="@dimen/interaction_recommend_image_margin"
android:layout_weight="1" android:layout_weight="1"
android:lineSpacingExtra="40px"
android:singleLine="false" android:singleLine="false"
android:text="" android:text=""
android:textColor="@color/black" android:textColor="@color/black"
......
...@@ -147,6 +147,7 @@ ...@@ -147,6 +147,7 @@
<dimen name="interaction_text_space">80px</dimen> <dimen name="interaction_text_space">80px</dimen>
<dimen name="interaction_recommend_margin">80px</dimen> <dimen name="interaction_recommend_margin">80px</dimen>
<dimen name="interaction_recommend_margin_bottom">140px</dimen>
<dimen name="interaction_recommend_image_margin">80px</dimen> <dimen name="interaction_recommend_image_margin">80px</dimen>
<dimen name="interaction_goods_icon_width">260px</dimen> <dimen name="interaction_goods_icon_width">260px</dimen>
<dimen name="interaction_goods_icon_height">260px</dimen> <dimen name="interaction_goods_icon_height">260px</dimen>
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
<color name="white">#FFFFFFFF</color> <color name="white">#FFFFFFFF</color>
<color name="black">#FF000000</color> <color name="black">#FF000000</color>
<color name="colorPink">#FFFF72C1</color> <color name="colorPink">#FFFF72C1</color>
<color name="recommendPink">#FFFC00CD</color>
<color name="progress">#FFCDE3F6</color> <color name="progress">#FFCDE3F6</color>
<color name="menu_order_bg">#FF4A71FF</color> <color name="menu_order_bg">#FF4A71FF</color>
<color name="menu_state_bg">#FFDEF0FF</color> <color name="menu_state_bg">#FFDEF0FF</color>
......
...@@ -163,6 +163,7 @@ ...@@ -163,6 +163,7 @@
<dimen name="interaction_text_space">80px</dimen> <dimen name="interaction_text_space">80px</dimen>
<dimen name="interaction_recommend_margin">80px</dimen> <dimen name="interaction_recommend_margin">80px</dimen>
<dimen name="interaction_recommend_margin_bottom">140px</dimen>
<dimen name="interaction_recommend_image_margin">80px</dimen> <dimen name="interaction_recommend_image_margin">80px</dimen>
<dimen name="interaction_goods_icon_width">260px</dimen> <dimen name="interaction_goods_icon_width">260px</dimen>
<dimen name="interaction_goods_icon_height">260px</dimen> <dimen name="interaction_goods_icon_height">260px</dimen>
......
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