d
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
package com.fenghoo.seven.dialog;
|
||||
|
||||
/**
|
||||
* Time: 2020/9/15
|
||||
* Author: jianbo
|
||||
* Description:
|
||||
*/
|
||||
class DishesVoBean {
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.fenghoo.seven.dialog;
|
||||
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
|
||||
import com.fenghoo.seven.R;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
/**
|
||||
* Time: 2020/9/15
|
||||
* Author: jianbo
|
||||
* Description:
|
||||
*/
|
||||
public class HomeShopDialog extends Dialog {
|
||||
public HomeShopDialog(@NonNull Context context) {
|
||||
super(context);
|
||||
}
|
||||
private Context context;
|
||||
private DishesVoBean dishesVo;
|
||||
private OnItemClickListener onItemClickListener;
|
||||
private String strShop;
|
||||
public void setOnItemClickListener(OnItemClickListener onItemClickListener) {
|
||||
this.onItemClickListener = onItemClickListener;
|
||||
}
|
||||
|
||||
public HomeShopDialog(@NonNull Context context, DishesVoBean dishesVos) {
|
||||
super(context);
|
||||
this.context=context;
|
||||
this.dishesVo=dishesVo;
|
||||
}
|
||||
public HomeShopDialog(@NonNull Context context, int themeResId, DishesVoBean dishesVo) {
|
||||
super(context, themeResId);
|
||||
this.context=context;
|
||||
this.dishesVo=dishesVo;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
//设置布局
|
||||
setContentView(R.layout.dialog_home_shop);
|
||||
}
|
||||
public interface OnItemClickListener{
|
||||
void onBtnPlusClick(View view, ShoppingCartBean data, DishesVoBean datas);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.fenghoo.seven.dialog;
|
||||
|
||||
|
||||
/**
|
||||
* Time: 2020/9/15
|
||||
* Author: jianbo
|
||||
* Description:
|
||||
*/
|
||||
class ShoppingCartBean {
|
||||
}
|
||||
@@ -166,30 +166,30 @@ public class AddCusFragment extends MobanFragment implements View.OnClickListene
|
||||
if(addCustomerBeans.size()>0){
|
||||
|
||||
|
||||
addCustomerBean addCustomerBean = addCustomerBeans.get(0);
|
||||
Log.e("数据的个数==", addCustomerBeans.size()+"");
|
||||
WidgetTools.setTextsix(textView0, "", addCustomerBean.getName());
|
||||
WidgetTools.setTextsix(textView4, "", addCustomerBean.getPhone());
|
||||
WidgetTools.setTextsix(textView6, "", addCustomerBean.getWechat());
|
||||
WidgetTools.setTextsix(textView8, "", addCustomerBean.getAddress());
|
||||
GlideTools.init(mContext).displaypic(imageView, addCustomerBean.getHeadimg(), R.mipmap.icon_default_head);
|
||||
this.addCustomerBean.setHeadimg(addCustomerBean.getHeadimg());
|
||||
String decoration = addCustomerBean.getDecoration();
|
||||
switch (decoration) {
|
||||
case "1":
|
||||
label = addData("1","0","0");
|
||||
break;
|
||||
case "2":
|
||||
label = addData("0","1","0");
|
||||
break;
|
||||
case "3":
|
||||
label = addData("0","0","1");
|
||||
break;
|
||||
}
|
||||
WidgetTools.setTextsix(textView12, "", addCustomerBean.getStyle_name());
|
||||
this.addCustomerBean.setStyle_id(addCustomerBean.getStyle_id());
|
||||
WidgetTools.setTextsix(textView14, "", addCustomerBean.getBudget());
|
||||
this.addCustomerBean.setBudget(addCustomerBean.getBudget());
|
||||
addCustomerBean addCustomerBean = addCustomerBeans.get(0);
|
||||
Log.e("数据的个数==", addCustomerBeans.size()+"");
|
||||
WidgetTools.setTextsix(textView0, "", addCustomerBean.getName());
|
||||
WidgetTools.setTextsix(textView4, "", addCustomerBean.getPhone());
|
||||
WidgetTools.setTextsix(textView6, "", addCustomerBean.getWechat());
|
||||
WidgetTools.setTextsix(textView8, "", addCustomerBean.getAddress());
|
||||
GlideTools.init(mContext).displaypic(imageView, addCustomerBean.getHeadimg(), R.mipmap.icon_default_head);
|
||||
this.addCustomerBean.setHeadimg(addCustomerBean.getHeadimg());
|
||||
String decoration = addCustomerBean.getDecoration();
|
||||
switch (decoration) {
|
||||
case "1":
|
||||
label = addData("1","0","0");
|
||||
break;
|
||||
case "2":
|
||||
label = addData("0","1","0");
|
||||
break;
|
||||
case "3":
|
||||
label = addData("0","0","1");
|
||||
break;
|
||||
}
|
||||
WidgetTools.setTextsix(textView12, "", addCustomerBean.getStyle_name());
|
||||
this.addCustomerBean.setStyle_id(addCustomerBean.getStyle_id());
|
||||
WidgetTools.setTextsix(textView14, "", addCustomerBean.getBudget());
|
||||
this.addCustomerBean.setBudget(addCustomerBean.getBudget());
|
||||
}
|
||||
}
|
||||
}else {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.fenghoo.seven.main.kehu.fragment;
|
||||
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.ViewParent;
|
||||
import android.widget.FrameLayout;
|
||||
|
||||
|
||||
@@ -2,23 +2,24 @@ package com.fenghoo.seven.main.my;
|
||||
|
||||
|
||||
import android.content.Intent;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.fenghoo.seven.R;
|
||||
import com.fenghoo.seven.base.BaseTreeFragment;
|
||||
import com.fenghoo.seven.dialog.BaseTipsDialog;
|
||||
import com.fenghoo.seven.main.find.ConversationActivity;
|
||||
import com.fenghoo.seven.main.my.activity.DemoActivity;
|
||||
import com.fenghoo.seven.main.my.fragment.mvp.contract.MyContract;
|
||||
import com.fenghoo.seven.main.my.fragment.mvp.presenter.MyPresenterImpl;
|
||||
import com.fenghoo.seven.dialog.HomeShopDialog;
|
||||
import com.fenghoo.seven.main.activity.LoginPasswordActivity;
|
||||
import com.fenghoo.seven.main.activity.Main2Activity;
|
||||
import com.fenghoo.seven.main.my.activity.PersonalProfileActivity;
|
||||
import com.fenghoo.seven.main.my.entity.loginInfoBean;
|
||||
import com.fenghoo.seven.main.my.fragment.mvp.contract.MyContract;
|
||||
import com.fenghoo.seven.main.my.fragment.mvp.presenter.MyPresenterImpl;
|
||||
import com.fenghoo.seven.utils.GlideTools;
|
||||
import com.fenghoo.seven.utils.JumpUtils;
|
||||
import com.fenghoo.seven.utils.ToastUtils;
|
||||
import com.fenghoo.seven.utils.ToolsUtils;
|
||||
import com.fenghoo.seven.utils.checkVersionsUtils.ProfileSpUtils;
|
||||
@@ -101,20 +102,38 @@ public class MyFragment
|
||||
view.findViewById(R.id.lay_out).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
JumpUtils.gotoActivity(getActivity(), DemoActivity.class, false, "", "");
|
||||
// new BaseTipsDialog().showDownloadDialog(getActivity(), "确认要退出登录吗?", "确定", new BaseTipsDialog.ClickListener() {
|
||||
// @Override
|
||||
// public void confirm() {
|
||||
// ProfileSpUtils.getInstance().saveLoginSatus(false);
|
||||
// Intent intent = new Intent(getActivity(), LoginPasswordActivity.class).setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
// startActivity(intent);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void cancle() {
|
||||
//
|
||||
// }
|
||||
// });
|
||||
// JumpUtils.gotoActivity(getActivity(), DemoActivity.class, false, "", "");
|
||||
new BaseTipsDialog().showDownloadDialog(getActivity(), "确认要退出登录吗?", "确定", new BaseTipsDialog.ClickListener() {
|
||||
@Override
|
||||
public void confirm() {
|
||||
ProfileSpUtils.getInstance().saveLoginSatus(false);
|
||||
Intent intent = new Intent(getActivity(), LoginPasswordActivity.class).setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancle() {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//1、初始化Dialog
|
||||
// HomeShopDialog dialog=new HomeShopDialog(getActivity(),R.style.DialogTheme,null);
|
||||
// //获取Dialogwindow对象
|
||||
// Window window=dialog.getWindow();
|
||||
// //设置弹出位置
|
||||
// window.setGravity(Gravity.BOTTOM);
|
||||
// //设置动画
|
||||
// window.setWindowAnimations(R.style.dialog_menu_animStyle);
|
||||
// //设置对话框大小
|
||||
// window.getDecorView().setPadding(0,0,0,0);
|
||||
// WindowManager.LayoutParams layoutParams=window.getAttributes();
|
||||
// //设置宽度和高度
|
||||
// layoutParams.width= WindowManager.LayoutParams.MATCH_PARENT;
|
||||
// layoutParams.height=WindowManager.LayoutParams.WRAP_CONTENT;
|
||||
// //显示Dialog
|
||||
// dialog.show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
18
app/src/main/res/anim/dialog_in_anim.xml
Normal file
18
app/src/main/res/anim/dialog_in_anim.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<set xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!--
|
||||
有四种动画:alpha (透明变化) translate(位置移动) scale(缩放) rotate(旋转),
|
||||
android:duration: 动画运行时间,定义在多次时间(ms)内完成动画
|
||||
android:startOffset: 延迟一定时间后运行动画
|
||||
fromXDelta: X轴方向开始位置,可以是%,也可以是具体的像素 具体见图
|
||||
toXDelta: X轴方向结束位置,可以是%,也可以是具体的像素
|
||||
fromYDelta: Y轴方向开始位置,可以是%,也可以是具体的像素
|
||||
toYDelta: Y轴方向结束位置,可以是%,也可以是具体的像素
|
||||
-->
|
||||
<translate
|
||||
android:duration="500"
|
||||
android:fromXDelta="0"
|
||||
android:fromYDelta="100%p"
|
||||
android:toXDelta="0"
|
||||
android:toYDelta="0%p" />
|
||||
</set>
|
||||
9
app/src/main/res/anim/dialog_out_anim.xml
Normal file
9
app/src/main/res/anim/dialog_out_anim.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<set xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<translate
|
||||
android:duration="500"
|
||||
android:fromXDelta="0"
|
||||
android:fromYDelta="0%p"
|
||||
android:toXDelta="0"
|
||||
android:toYDelta="100%p" />
|
||||
</set>
|
||||
165
app/src/main/res/layout/dialog_home_shop.xml
Normal file
165
app/src/main/res/layout/dialog_home_shop.xml
Normal file
@@ -0,0 +1,165 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:background="#ffffff"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
<!--名称+价格-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="15dp"
|
||||
android:orientation="horizontal">
|
||||
<TextView
|
||||
android:id="@+id/tv_home_shop_dishes_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/colorBlack"
|
||||
android:textSize="16sp"
|
||||
android:text="蛋卷"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"/>
|
||||
<TextView
|
||||
android:id="@+id/tv_home_shop_price"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="16sp"
|
||||
android:textColor="@color/colorOrange"
|
||||
android:text="5元/包"/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="15dp"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
android:textSize="16sp"
|
||||
android:textColor="@color/colorBlack"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="份量"/>
|
||||
<RadioGroup
|
||||
android:id="@+id/rg_register_sex"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_centerVertical="true">
|
||||
<RadioButton
|
||||
android:id="@+id/rb_home_shop_lt"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:padding="8dp"
|
||||
android:textSize="14sp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:button="@null"
|
||||
android:text="小份"/>
|
||||
<RadioButton
|
||||
android:id="@+id/rb_home_shop_eq"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:padding="8dp"
|
||||
android:textSize="14sp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:button="@null"
|
||||
android:text="中份"/>
|
||||
<RadioButton
|
||||
android:id="@+id/rb_home_shop_gt"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:padding="8dp"
|
||||
android:textSize="14sp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:button="@null"
|
||||
android:text="大份"/>
|
||||
</RadioGroup>
|
||||
</LinearLayout>
|
||||
<!--购买数量-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="15dp"
|
||||
android:orientation="horizontal">
|
||||
<TextView
|
||||
android:textColor="@color/colorBlack"
|
||||
android:textSize="16sp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:text="购买数量"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"/>
|
||||
<LinearLayout
|
||||
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
<TextView
|
||||
android:id="@+id/tv_shop_minus"
|
||||
android:textColor="@color/colorBlack"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="4dp"
|
||||
android:text=" - "/>
|
||||
<EditText
|
||||
android:id="@+id/et_shop_number"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:padding="4dp"
|
||||
android:text="1"/>
|
||||
<TextView
|
||||
android:id="@+id/tv_shop_plus"
|
||||
android:textColor="@color/colorBlack"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="4dp"
|
||||
android:text=" + "/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<!--加入购物车-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="10dp"
|
||||
android:orientation="horizontal">
|
||||
<TextView
|
||||
android:id="@+id/tv_home_shop_price_num"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="18sp"
|
||||
android:layout_weight="1"
|
||||
android:textColor="@color/colorOrange"
|
||||
android:text="¥ 5 "/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_shop"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="18sp"
|
||||
android:textColor="@color/colorWhite"
|
||||
android:padding="8dp"
|
||||
android:text="加入购物车"/>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -130,6 +130,31 @@
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
<!-- dialog的动画 -->
|
||||
<style name="DialogTheme" parent="@android:style/Theme.Dialog">
|
||||
<!-- 边框 -->
|
||||
<item name="android:windowFrame">@null</item>
|
||||
<!-- 是否浮现在activity之上 -->
|
||||
<item name="android:windowIsFloating">true</item>
|
||||
<!-- 半透明 -->
|
||||
<item name="android:windowIsTranslucent">true</item>
|
||||
<!-- 无标题 -->
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
<item name="android:background">@android:color/transparent</item>
|
||||
<!-- 背景透明 -->
|
||||
<item name="android:windowBackground">@android:color/transparent</item>
|
||||
<!-- 模糊 -->
|
||||
<item name="android:backgroundDimEnabled">true</item>
|
||||
<!-- 遮罩层 -->
|
||||
<item name="android:backgroundDimAmount">0.5</item>
|
||||
</style>
|
||||
<!-- dialog的动画 -->
|
||||
<style name="dialog_menu_animStyle">
|
||||
<item name="android:windowEnterAnimation">@anim/dialog_in_anim</item>
|
||||
<item name="android:windowExitAnimation">@anim/dialog_out_anim</item>
|
||||
</style>
|
||||
|
||||
<style name="dialogstyle">
|
||||
<!--设置dialog的背景-->
|
||||
<item name="android:windowBackground">@android:color/transparent</item>
|
||||
|
||||
Reference in New Issue
Block a user