Commit 9671595b authored by 姜敏's avatar 姜敏

添加颜色

parent 7123fa39
......@@ -50,6 +50,10 @@
android:name=".ui.payment.PaymentActivity"
android:configChanges="keyboard|orientation|screenSize|keyboardHidden"
android:windowSoftInputMode="adjustUnspecified|stateHidden" />
<activity
android:name=".ui.vip.VipActivity"
android:configChanges="keyboard|orientation|screenSize|keyboardHidden"
android:windowSoftInputMode="adjustUnspecified|stateHidden" />
</application>
</manifest>
\ No newline at end of file
package com.xingdata.zzdpos.ui.main.fragment;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.content.Intent;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.blankj.utilcode.util.ActivityUtils;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.xingdata.zzdpos.C;
import com.xingdata.zzdpos.R;
......@@ -17,6 +12,7 @@ import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentCasherBinding;
import com.xingdata.zzdpos.ui.main.MainPresenter;
import com.xingdata.zzdpos.ui.main.adapter.MenuRecyclerAdapter;
import com.xingdata.zzdpos.ui.vip.VipActivity;
import java.util.ArrayList;
import java.util.List;
......@@ -49,7 +45,7 @@ public class CasherFragment extends BaseFragment<MainPresenter,FragmentCasherBin
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
switch ((int)adapter.getData().get(position)) {
case C.MENU.MENU_VIP://会员
ActivityUtils.startActivity(new Intent(getActivity(),VipActivity.class));
break;
case C.MENU.MENU_RECHARGE://充值
......
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 {
}
}
// return deviceSN;
return "92209325";
return "92209320";
}
......
<?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
......@@ -76,6 +76,8 @@
<color name="blue2">#19346b</color>
<color name="blue3">#4faaff</color>
<color name="darkgray">#323232</color>
<color name="line1">#e6e6e6</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