Commit c0fd2146 authored by 陈前's avatar 陈前

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	app/src/main/AndroidManifest.xml
#	app/src/main/java/com/xingdata/zzdpos/ui/login/LoginActivity.java
parents e7875d70 14e44b61
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
android:configChanges="keyboard|orientation|screenSize|keyboardHidden" android:configChanges="keyboard|orientation|screenSize|keyboardHidden"
android:label="@string/main_title" android:label="@string/main_title"
android:launchMode="singleTask" android:launchMode="singleTask"
android:windowSoftInputMode="adjustUnspecified|stateHidden" /> android:windowSoftInputMode="adjustUnspecified|stateHidden"/>
<activity <activity
android:name=".ui.splash.SplashActivity" android:name=".ui.splash.SplashActivity"
android:configChanges="keyboard|orientation|screenSize|keyboardHidden" android:configChanges="keyboard|orientation|screenSize|keyboardHidden"
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
<category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter> </intent-filter>
</activity> </activity>
<activity <activity
android:name=".ui.login.LoginActivity" android:name=".ui.login.LoginActivity"
android:configChanges="keyboard|orientation|screenSize|keyboardHidden" android:configChanges="keyboard|orientation|screenSize|keyboardHidden"
...@@ -69,6 +70,10 @@ ...@@ -69,6 +70,10 @@
<activity android:name=".ui.help.HelpActivity" /> <activity android:name=".ui.help.HelpActivity" />
<activity android:name=".ui.feedback.FeedBackActivity" /> <activity android:name=".ui.feedback.FeedBackActivity" />
<activity android:name=".ui.statistics.StatisticsActivity"></activity> <activity android:name=".ui.statistics.StatisticsActivity"></activity>
<activity
android:name=".ui.vip.VipActivity"
android:configChanges="keyboard|orientation|screenSize|keyboardHidden"
android:windowSoftInputMode="adjustUnspecified|stateHidden" />
</application> </application>
</manifest> </manifest>
\ No newline at end of file
...@@ -3,6 +3,7 @@ package com.xingdata.zzdpos.model; ...@@ -3,6 +3,7 @@ package com.xingdata.zzdpos.model;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
import com.bigkoo.pickerview.model.IPickerViewData; import com.bigkoo.pickerview.model.IPickerViewData;
import com.xingdata.zzdpos.base.BaseBean; import com.xingdata.zzdpos.base.BaseBean;
import com.xingdata.zzdpos.ui.marketing.integral.fragment.IntegralGetFragment;
/** /**
* Created by Administrator on 2017/11/27. * Created by Administrator on 2017/11/27.
...@@ -132,15 +133,15 @@ public class Category implements BaseBean, IPickerViewData { ...@@ -132,15 +133,15 @@ public class Category implements BaseBean, IPickerViewData {
@Override @Override
public String getPickerViewText() { public String getPickerViewText() {
switch (nowCategory) { switch (nowCategory) {
// case IntegralGetDialog.ONE_CATEGORY: { case IntegralGetFragment.ONE_CATEGORY: {
// return getSpuClaName() + ""; return getSpuClaName() + "";
// } }
// case IntegralGetDialog.TWO_CATEGORY: { case IntegralGetFragment.TWO_CATEGORY: {
// return getSpuGrpName() + ""; return getSpuGrpName() + "";
// } }
// case IntegralGetDialog.THREE_CATEGORY: { case IntegralGetFragment.THREE_CATEGORY: {
// return getSpuCateName() + ""; return getSpuCateName() + "";
// } }
} }
return ""; return "";
......
package com.xingdata.zzdpos.ui.main.fragment; package com.xingdata.zzdpos.ui.main.fragment;
import android.content.Intent;
import android.support.v7.widget.GridLayoutManager; import android.support.v7.widget.GridLayoutManager;
import android.view.View; import android.view.View;
import com.blankj.utilcode.util.ActivityUtils;
import com.blankj.utilcode.util.ActivityUtils; import com.blankj.utilcode.util.ActivityUtils;
import com.chad.library.adapter.base.BaseQuickAdapter; import com.chad.library.adapter.base.BaseQuickAdapter;
...@@ -14,6 +16,7 @@ import com.xingdata.zzdpos.base.BaseFragment; ...@@ -14,6 +16,7 @@ import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentCasherBinding; import com.xingdata.zzdpos.databinding.FragmentCasherBinding;
import com.xingdata.zzdpos.ui.main.MainPresenter; import com.xingdata.zzdpos.ui.main.MainPresenter;
import com.xingdata.zzdpos.ui.main.adapter.MenuRecyclerAdapter; import com.xingdata.zzdpos.ui.main.adapter.MenuRecyclerAdapter;
import com.xingdata.zzdpos.ui.vip.VipActivity;
import com.xingdata.zzdpos.ui.payment.PaymentActivity; import com.xingdata.zzdpos.ui.payment.PaymentActivity;
import com.xingdata.zzdpos.ui.splash.SplashActivity; import com.xingdata.zzdpos.ui.splash.SplashActivity;
import com.xingdata.zzdpos.ui.statistics.StatisticsActivity; import com.xingdata.zzdpos.ui.statistics.StatisticsActivity;
...@@ -52,7 +55,7 @@ public class CasherFragment extends BaseFragment<MainPresenter, FragmentCasherBi ...@@ -52,7 +55,7 @@ public class CasherFragment extends BaseFragment<MainPresenter, FragmentCasherBi
public void onItemClick(BaseQuickAdapter adapter, View view, int position) { public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
switch ((int) adapter.getData().get(position)) { switch ((int) adapter.getData().get(position)) {
case C.MENU.MENU_VIP://会员 case C.MENU.MENU_VIP://会员
ActivityUtils.startActivity(new Intent(getActivity(),VipActivity.class));
break; break;
case C.MENU.MENU_RECHARGE://充值 case C.MENU.MENU_RECHARGE://充值
......
...@@ -66,6 +66,7 @@ public class IntegralActivity extends BaseActivity<IntegralPresenter, ActivityIn ...@@ -66,6 +66,7 @@ public class IntegralActivity extends BaseActivity<IntegralPresenter, ActivityIn
@Override @Override
public void addSucc(LoadingDialog loadingDialog) { public void addSucc(LoadingDialog loadingDialog) {
pop();
mPresenter.query(1, mPresenter.integralIndexFragment.NORMAL_TYPE, loadingDialog); mPresenter.query(1, mPresenter.integralIndexFragment.NORMAL_TYPE, loadingDialog);
} }
...@@ -82,6 +83,7 @@ public class IntegralActivity extends BaseActivity<IntegralPresenter, ActivityIn ...@@ -82,6 +83,7 @@ public class IntegralActivity extends BaseActivity<IntegralPresenter, ActivityIn
@Override @Override
public void exchangeUpdateSucc(Ubound ubound, LoadingDialog loadingDialog) { public void exchangeUpdateSucc(Ubound ubound, LoadingDialog loadingDialog) {
pop();
mPresenter.exchangeQuery(loadingDialog); mPresenter.exchangeQuery(loadingDialog);
} }
......
...@@ -8,6 +8,7 @@ import com.xingdata.zzdpos.model.Category; ...@@ -8,6 +8,7 @@ import com.xingdata.zzdpos.model.Category;
import com.xingdata.zzdpos.model.Gbound; import com.xingdata.zzdpos.model.Gbound;
import com.xingdata.zzdpos.model.Ubound; import com.xingdata.zzdpos.model.Ubound;
import com.xingdata.zzdpos.ui.dialog.LoadingDialog; import com.xingdata.zzdpos.ui.dialog.LoadingDialog;
import com.xingdata.zzdpos.ui.marketing.integral.fragment.IntegralExchangeFragment;
import com.xingdata.zzdpos.ui.marketing.integral.fragment.IntegralGetFragment; import com.xingdata.zzdpos.ui.marketing.integral.fragment.IntegralGetFragment;
import com.xingdata.zzdpos.ui.marketing.integral.fragment.IntegralIndexFragment; import com.xingdata.zzdpos.ui.marketing.integral.fragment.IntegralIndexFragment;
...@@ -23,6 +24,7 @@ public class IntegralPresenter extends IntegralContract.Presenter { ...@@ -23,6 +24,7 @@ public class IntegralPresenter extends IntegralContract.Presenter {
private int number = 1; private int number = 1;
public IntegralIndexFragment integralIndexFragment = new IntegralIndexFragment(); public IntegralIndexFragment integralIndexFragment = new IntegralIndexFragment();
public IntegralGetFragment integralGetFragment = new IntegralGetFragment(); public IntegralGetFragment integralGetFragment = new IntegralGetFragment();
public IntegralExchangeFragment integralExchangeFragment = new IntegralExchangeFragment();
@Override @Override
public void onAttached() { public void onAttached() {
......
package com.xingdata.zzdpos.ui.marketing.integral.fragment;
import android.text.TextUtils;
import android.view.View;
import com.blankj.utilcode.util.ToastUtils;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseActivity;
import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.DialogIntegralExchangeSettingBinding;
import com.xingdata.zzdpos.model.Ubound;
import com.xingdata.zzdpos.ui.dialog.LoadingDialog;
import com.xingdata.zzdpos.ui.marketing.integral.IntegralPresenter;
import com.xingdata.zzdpos.util.ConvertUtil;
import com.xingdata.zzdpos.util.OnClickListener;
/**
* 绑定款台界面
* <p>
* 设备没有绑定款台的进行绑定操作
*/
public class IntegralExchangeFragment extends BaseFragment<IntegralPresenter,
DialogIntegralExchangeSettingBinding> {
Ubound ubound;
@Override
public int getLayoutId() {
return R.layout.dialog_integral_exchange_setting;
}
@Override
public void initView() {
mViewBinding.icTitle.tvTitle.setText("积分规则");
mViewBinding.icTitle.setOnClickListener(new OnClickListener() {
@Override
protected void myOnClickListener(View v) {
pop();
}
});
mViewBinding.setOnClickListener(view -> {
// hintKbTwo();
switch (view.getId()) {
case R.id.rd_suspendeds: {
//暂停
ubound.setBoundUseStatus((byte) 1);
}
break;
case R.id.rd_starts: {
//启用
ubound.setBoundUseStatus((byte) 0);
}
break;
case R.id.btn_ok: {
if (isNullAndSet()) {
LoadingDialog loadingDialog = new LoadingDialog();
loadingDialog.show((BaseActivity) getActivity());
ubound.setUpdateTime(null);
ubound.setCreateTime(null);
mPresenter.exchangeUpdate(ubound, loadingDialog);
} else {
ToastUtils.showLong("输入数据不能null");
}
}
break;
}
});
initUiData();
}
private void initUiData() {
if (ubound != null) {
if (ubound.getBoundUseStatus() != null && ubound.getBoundUseStatus() == 0) {
mViewBinding.rdStarts.setChecked(true);
} else if (ubound.getBoundUseStatus() != null && ubound.getBoundUseStatus() == 1) {
mViewBinding.rdSuspendeds.setChecked(true);
}
if (ubound.getBoundValAmt() != null) {
mViewBinding.etIntegralExchangeRuleCountMoney.setText(ubound.getBoundValAmt() + "");
}
if (ubound.getBoundOrderAmt() != null) {
mViewBinding.etIntegralExchangeMoney.setText(ConvertUtil.fenToYuanNoPoint(ubound
.getBoundOrderAmt()));
}
if (ubound.getBoundUseNum() != null) {
mViewBinding.etIntegralExchangeCount.setText(ubound.getBoundUseNum() + "");
}
}
}
public void setData(Ubound ubound) {
this.ubound = ubound;
}
/**
* 判断用户输入数据是否为null
*
* @return 输入为null返回false 反之返回true
*/
private boolean isNullAndSet() {
if (ubound == null || ubound.getBoundUseStatus() == null) {
return false;
}
if (TextUtils.isEmpty(mViewBinding.etIntegralExchangeRuleCountMoney.getText().toString())
|| TextUtils.isEmpty(mViewBinding.etIntegralExchangeMoney.getText().toString())
|| TextUtils.isEmpty(mViewBinding.etIntegralExchangeCount.getText().toString
())) {
return false;
}
ubound.setBoundValAmt(Long.parseLong(mViewBinding.etIntegralExchangeRuleCountMoney
.getText().toString()));
ubound.setBoundOrderAmt(ConvertUtil.yuanToFen(mViewBinding.etIntegralExchangeMoney
.getText().toString()));
ubound.setBoundUseNum(Long.parseLong(mViewBinding.etIntegralExchangeCount.getText()
.toString()));
return true;
}
// /**
// * 显示软键盘,Dialog使用
// */
// public void hintKbTwo() {
// View view = getDialog().getCurrentFocus();
// if (view == null) {
// return;
// }
// if (view instanceof TextView) {
// InputMethodManager mInputMethodManager = (InputMethodManager) getContext()
// .getSystemService(Context.INPUT_METHOD_SERVICE);
// mInputMethodManager.hideSoftInputFromWindow(view.getWindowToken(), InputMethodManager
// .RESULT_UNCHANGED_SHOWN);
// }
// }
// @Override
// public void dismiss() {
// hintKbTwo();
// super.dismiss();
// }
}
...@@ -55,7 +55,7 @@ public class IntegralGetFragment extends BaseFragment<IntegralPresenter, ...@@ -55,7 +55,7 @@ public class IntegralGetFragment extends BaseFragment<IntegralPresenter,
//进度对话框 //进度对话框
LoadingDialog loadingDialog; LoadingDialog loadingDialog;
//当前点击商品类型空间id,防止直接点击商品第二三种类型 //当前点击商品类型空间id,防止直接点击商品第二三种类型
private int nowShopTypeId = 1; private int nowShopTypeId = 0;
@Override @Override
public int getLayoutId() { public int getLayoutId() {
...@@ -64,6 +64,13 @@ public class IntegralGetFragment extends BaseFragment<IntegralPresenter, ...@@ -64,6 +64,13 @@ public class IntegralGetFragment extends BaseFragment<IntegralPresenter,
@Override @Override
public void initView() { public void initView() {
mViewBinding.icTitle.tvTitle.setText("积分规则");
mViewBinding.icTitle.setOnClickListener(new OnClickListener() {
@Override
protected void myOnClickListener(View v) {
pop();
}
});
mViewBinding.setOnClickListener( mViewBinding.setOnClickListener(
new OnClickListener() { new OnClickListener() {
@Override @Override
...@@ -118,7 +125,6 @@ public class IntegralGetFragment extends BaseFragment<IntegralPresenter, ...@@ -118,7 +125,6 @@ public class IntegralGetFragment extends BaseFragment<IntegralPresenter,
if (nowShopTypeId >= 1) { if (nowShopTypeId >= 1) {
mPresenter.initData(getCategory(v.getId()), TWO_CATEGORY); mPresenter.initData(getCategory(v.getId()), TWO_CATEGORY);
mViewBinding.tvCategorySelectThree.setText(""); mViewBinding.tvCategorySelectThree.setText("");
nowShopTypeId = 2;
} else { } else {
ToastUtils.showLong("请先选择第一类品类"); ToastUtils.showLong("请先选择第一类品类");
} }
...@@ -127,7 +133,6 @@ public class IntegralGetFragment extends BaseFragment<IntegralPresenter, ...@@ -127,7 +133,6 @@ public class IntegralGetFragment extends BaseFragment<IntegralPresenter,
case R.id.tv_category_select_three: { case R.id.tv_category_select_three: {
if (nowShopTypeId >= 2) { if (nowShopTypeId >= 2) {
mPresenter.initData(getCategory(v.getId()), THREE_CATEGORY); mPresenter.initData(getCategory(v.getId()), THREE_CATEGORY);
nowShopTypeId = 3;
} else { } else {
ToastUtils.showLong("请先选择第一二类品类"); ToastUtils.showLong("请先选择第一二类品类");
} }
...@@ -349,18 +354,21 @@ public class IntegralGetFragment extends BaseFragment<IntegralPresenter, ...@@ -349,18 +354,21 @@ public class IntegralGetFragment extends BaseFragment<IntegralPresenter,
//返回的分别是三个级别的选中位置 //返回的分别是三个级别的选中位置
switch (nowList) { switch (nowList) {
case ONE_CATEGORY: { case ONE_CATEGORY: {
nowShopTypeId=1;
mViewBinding.tvCategorySelectOne.setText(listCategory.get(options1) mViewBinding.tvCategorySelectOne.setText(listCategory.get(options1)
.getSpuClaName()); .getSpuClaName());
spuCateIdTwo = listCategory.get(options1).getSpuCateId(); spuCateIdTwo = listCategory.get(options1).getSpuCateId();
} }
break; break;
case TWO_CATEGORY: { case TWO_CATEGORY: {
nowShopTypeId=2;
mViewBinding.tvCategorySelectTwo.setText(listCategory.get(options1) mViewBinding.tvCategorySelectTwo.setText(listCategory.get(options1)
.getSpuGrpName()); .getSpuGrpName());
spuCateIdThree = listCategory.get(options1).getSpuCateId(); spuCateIdThree = listCategory.get(options1).getSpuCateId();
} }
break; break;
case THREE_CATEGORY: { case THREE_CATEGORY: {
nowShopTypeId=3;
mViewBinding.tvCategorySelectThree.setText(listCategory.get(options1) mViewBinding.tvCategorySelectThree.setText(listCategory.get(options1)
.getSpuCateName()); .getSpuCateName());
......
...@@ -20,7 +20,6 @@ import com.xingdata.zzdpos.ui.marketing.integral.IntegralActivity; ...@@ -20,7 +20,6 @@ import com.xingdata.zzdpos.ui.marketing.integral.IntegralActivity;
import com.xingdata.zzdpos.ui.marketing.integral.IntegralPresenter; import com.xingdata.zzdpos.ui.marketing.integral.IntegralPresenter;
import com.xingdata.zzdpos.ui.marketing.integral.adapter.IntegralAdapter; import com.xingdata.zzdpos.ui.marketing.integral.adapter.IntegralAdapter;
import com.xingdata.zzdpos.ui.marketing.integral.adapter.IntegralExchangeAdapter; import com.xingdata.zzdpos.ui.marketing.integral.adapter.IntegralExchangeAdapter;
import com.xingdata.zzdpos.ui.marketing.integral.dialog.IntegralExchangeDialog;
import com.xingdata.zzdpos.util.OnClickListener; import com.xingdata.zzdpos.util.OnClickListener;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -80,6 +79,7 @@ public class IntegralIndexFragment extends BaseFragment<IntegralPresenter, ...@@ -80,6 +79,7 @@ public class IntegralIndexFragment extends BaseFragment<IntegralPresenter,
mViewBinding.setOnClickListener(v -> { mViewBinding.setOnClickListener(v -> {
switch (v.getId()) { switch (v.getId()) {
case R.id.btn_add: { case R.id.btn_add: {
mPresenter.integralGetFragment = new IntegralGetFragment();
mPresenter.integralGetFragment.setNowType(1); mPresenter.integralGetFragment.setNowType(1);
start(mPresenter.integralGetFragment); start(mPresenter.integralGetFragment);
// integralGetDialog = new IntegralGetDialog(); // integralGetDialog = new IntegralGetDialog();
...@@ -197,6 +197,7 @@ public class IntegralIndexFragment extends BaseFragment<IntegralPresenter, ...@@ -197,6 +197,7 @@ public class IntegralIndexFragment extends BaseFragment<IntegralPresenter,
if ((System.currentTimeMillis() - mExitTime) > 1000) { if ((System.currentTimeMillis() - mExitTime) > 1000) {
// integralGetDialog = new IntegralGetDialog(); // integralGetDialog = new IntegralGetDialog();
loadingDialog.show((BaseActivity) getActivity()); loadingDialog.show((BaseActivity) getActivity());
mPresenter.integralGetFragment = new IntegralGetFragment();
mPresenter.integralGetFragment.setData(gbound, loadingDialog); mPresenter.integralGetFragment.setData(gbound, loadingDialog);
start(mPresenter.integralGetFragment); start(mPresenter.integralGetFragment);
// integralGetDialog.show((BaseActivity) getActivity()); // integralGetDialog.show((BaseActivity) getActivity());
...@@ -213,9 +214,12 @@ public class IntegralIndexFragment extends BaseFragment<IntegralPresenter, ...@@ -213,9 +214,12 @@ public class IntegralIndexFragment extends BaseFragment<IntegralPresenter,
*/ */
private void exchangeClickProduct(Ubound gbound) { private void exchangeClickProduct(Ubound gbound) {
if ((System.currentTimeMillis() - mExitTime) > 1000) { if ((System.currentTimeMillis() - mExitTime) > 1000) {
IntegralExchangeDialog integralExchangeDialog = new IntegralExchangeDialog(); mPresenter.integralExchangeFragment = new IntegralExchangeFragment();
integralExchangeDialog.setData(gbound); mPresenter.integralExchangeFragment.setData(gbound);
integralExchangeDialog.show((BaseActivity) getActivity()); start(mPresenter.integralExchangeFragment);
// IntegralExchangeDialog integralExchangeDialog = new IntegralExchangeDialog();
// integralExchangeDialog.setData(gbound);
// integralExchangeDialog.show((BaseActivity) getActivity());
mExitTime = System.currentTimeMillis(); mExitTime = System.currentTimeMillis();
} else { } else {
ToastUtils.showLong("您操作太快了"); ToastUtils.showLong("您操作太快了");
......
package com.xingdata.zzdpos.ui.vip;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseActivity;
import com.xingdata.zzdpos.databinding.ActivityVipBinding;
import com.xingdata.zzdpos.model.Level;
import com.xingdata.zzdpos.model.Pager;
import com.xingdata.zzdpos.model.Vip;
import com.xingdata.zzdpos.ui.vip.fragment.VipInfoFragment;
import com.xingdata.zzdpos.ui.vip.fragment.VipLevleFragment;
public class VipActivity extends BaseActivity<VipPresenter, ActivityVipBinding> implements VipContract.View {
private VipInfoFragment vipInfoFragment = new VipInfoFragment();
private VipLevleFragment vipLevleFragment = new VipLevleFragment();
@Override
public int getLayoutId() {
return R.layout.activity_vip;
}
@Override
public void initView() {
loadRootFragment(R.id.vip_level_frame, vipLevleFragment, false, false);
}
@Override
public Pager<Vip> getVipLevelSus() {
return null;
}
@Override
public Pager<Level> getVipListSus() {
return null;
}
@Override
public String getVipNumberSus() {
return null;
}
}
package com.xingdata.zzdpos.ui.vip;
import com.xingdata.zzdpos.base.BasePresenter;
import com.xingdata.zzdpos.base.BaseView;
import com.xingdata.zzdpos.model.Level;
import com.xingdata.zzdpos.model.Pager;
import com.xingdata.zzdpos.model.Vip;
interface VipContract {
interface View extends BaseView {
Pager<Vip> getVipLevelSus();
Pager<Level> getVipListSus();
String getVipNumberSus();
}
abstract class Presenter extends BasePresenter<VipContract.View> {
public abstract void getVipList(int levelId, int pageNumber);
public abstract void getVipLevel();
public abstract void getVipNumber();
}
}
\ No newline at end of file
package com.xingdata.zzdpos.ui.vip;
public class VipPresenter extends VipContract.Presenter {
@Override
public void onAttached() {
}
@Override
public void getVipList(int levelId, int pageNumber) {
}
@Override
public void getVipLevel() {
}
@Override
public void getVipNumber() {
}
}
package com.xingdata.zzdpos.ui.vip.fragment;
/**
* Created by JM_DEV on 2017/12/21.
*/
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentViplevelTitleBinding;
import com.xingdata.zzdpos.ui.vip.VipPresenter;
/**
* 会员信息界面
*/
public class VipInfoFragment extends BaseFragment<VipPresenter, FragmentViplevelTitleBinding> {
@Override
public int getLayoutId() {
return R.layout.fragment_viplevel_title;
}
@Override
public void initView() {
// RadioButton radioButton = new RadioButton(getActivity());
// radioButton.setText("AAAAAAAAAAAAAAA");
// mViewBinding.vipLevelRadioGroup.addView(radioButton);
}
}
package com.xingdata.zzdpos.ui.vip.fragment;
/**
* Created by JM_DEV on 2017/12/21.
*/
import android.annotation.SuppressLint;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.view.Gravity;
import android.widget.GridView;
import android.widget.LinearLayout;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentViplevelTitleBinding;
import com.xingdata.zzdpos.ui.vip.VipActivity;
import com.xingdata.zzdpos.ui.vip.VipPresenter;
/**
* 会员等级列表
*/
public class VipLevleFragment extends BaseFragment<VipPresenter, FragmentViplevelTitleBinding> {
@Override
public int getLayoutId() {
return R.layout.fragment_viplevel_title;
}
@Override
public void initView() {
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT);
layoutParams.height = 120;
layoutParams.width = LinearLayout.LayoutParams.MATCH_PARENT;
for (int i = 0; i < 5; i++) {
mViewBinding.vipLevelRadioGroup.addView(addRadioButton(layoutParams));
}
setRadioButtonChecked(true, ((RadioButton) mViewBinding.vipLevelRadioGroup.getChildAt(0)));
mViewBinding.vipLevelRadioGroup.setOnCheckedChangeListener((radioGroup, n) -> {
for (int i = 0; i < mViewBinding.vipLevelRadioGroup.getChildCount(); i++) {
//动态设置按钮颜色
setRadioButtonChecked(i == n - 1, ((RadioButton) radioGroup.getChildAt(i)));
}
});
}
/**
* 设置按钮选中
*
* @param b
* @param button
*/
private void setRadioButtonChecked(boolean b, RadioButton button) {
button.getPaint().setFakeBoldText(b);//字体加粗
if (b) {
button.setTextSize(17);
} else {
button.setTextSize(15);
}
}
@SuppressLint("ResourceAsColor")
private RadioButton addRadioButton(LinearLayout.LayoutParams layoutParams) {
RadioButton radioButton = new RadioButton(getActivity());
radioButton.setTextSize(15);
radioButton.setText("金牌会员");
setRadioButtonChecked(false, radioButton);
radioButton.setGravity(Gravity.CENTER);
radioButton.setButtonDrawable(null);
radioButton.getPaint().setFakeBoldText(true);
radioButton.setBackgroundResource(R.drawable.checkbox_viplevel_bg);
radioButton.setTextColor(R.color.black_baozheng);
radioButton.setLayoutParams(layoutParams);
return radioButton;
}
}
package com.xingdata.zzdpos.ui.vip.fragment;
/**
* Created by JM_DEV on 2017/12/21.
*/
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentViplevelTitleBinding;
import com.xingdata.zzdpos.ui.vip.VipPresenter;
/**
* 会员列表
*/
public class VipListFragment extends BaseFragment<VipPresenter, FragmentViplevelTitleBinding> {
@Override
public int getLayoutId() {
return R.layout.fragment_viplevel_title;
}
@Override
public void initView() {
// RadioButton radioButton = new RadioButton(getActivity());
// radioButton.setText("AAAAAAAAAAAAAAA");
// mViewBinding.vipLevelRadioGroup.addView(radioButton);
}
}
package com.xingdata.zzdpos.ui.vip.fragment;
/**
* Created by JM_DEV on 2017/12/21.
*/
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentViplevelTitleBinding;
import com.xingdata.zzdpos.ui.vip.VipPresenter;
/**
* 会员消费充值记录
*/
public class VipRecordFragment extends BaseFragment<VipPresenter, FragmentViplevelTitleBinding> {
@Override
public int getLayoutId() {
return R.layout.fragment_viplevel_title;
}
@Override
public void initView() {
// RadioButton radioButton = new RadioButton(getActivity());
// radioButton.setText("AAAAAAAAAAAAAAA");
// mViewBinding.vipLevelRadioGroup.addView(radioButton);
}
}
...@@ -55,7 +55,7 @@ public final class SystemUtil { ...@@ -55,7 +55,7 @@ public final class SystemUtil {
} }
} }
// return deviceSN; // return deviceSN;
return "548496"; return "92209325";
} }
......
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@mipmap/vip_level_check_bg" android:state_checked="true" />
<item android:drawable="@mipmap/vip_level_bg" android:state_checked="false" />
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/bg"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<include
layout="@layout/title_search"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1" />
<ImageView
android:layout_width="50dp"
android:layout_height="match_parent"
android:background="@mipmap/swipe_card_bg" />
<ImageView
android:layout_width="50dp"
android:layout_height="match_parent"
android:background="@mipmap/scan_bg" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/line1" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_margin="@dimen/view_line_L5"
android:background="@color/line1" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
style="@style/default_blacktext_smallstyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="本店会员" />
<TextView
style="@style/default_blacktext_smallstyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="今日新增" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
style="@style/default_blacktext_bigstyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="150"
android:textSize="22sp"
android:textStyle="bold" />
<TextView
style="@style/default_blacktext_bigstyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="10"
android:textSize="22sp"
android:textStyle="bold" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_margin="@dimen/view_line_L5"
android:background="@color/line1" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/all_margin_left"
android:orientation="horizontal">
<FrameLayout
android:id="@+id/vip_level_frame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="3"></FrameLayout>
<FrameLayout
android:id="@+id/vip_frame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"></FrameLayout>
</LinearLayout>
</LinearLayout>
</layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical">
<RadioGroup
android:gravity="center"
android:id="@+id/vip_level_RadioGroup"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
</RadioGroup>
</LinearLayout>
</layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/bg"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="50dp"
android:layout_height="match_parent"
android:background="@mipmap/go_back" />
<EditText
style="@style/editText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="0dp"
android:layout_weight="1"
android:background="@color/listview_bg"
android:hint="请输入手机号或会员姓名" />
</LinearLayout>
</LinearLayout>
</layout>
\ No newline at end of file
...@@ -77,6 +77,8 @@ ...@@ -77,6 +77,8 @@
<color name="blue2">#19346b</color> <color name="blue2">#19346b</color>
<color name="blue3">#4faaff</color> <color name="blue3">#4faaff</color>
<color name="darkgray">#323232</color> <color name="darkgray">#323232</color>
<color name="line1">#e6e6e6</color>
<color name="grey1">#E2E2E2</color> <color name="grey1">#E2E2E2</color>
......
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