Commit 308ff0ca authored by 王海's avatar 王海

修改bug

parent 6e3b0cea
...@@ -176,6 +176,7 @@ public class BaleEditFragment extends BaseFragment<BalePresenter, FragmentBaleEd ...@@ -176,6 +176,7 @@ public class BaleEditFragment extends BaseFragment<BalePresenter, FragmentBaleEd
break; break;
case R.id.btn_scan: { case R.id.btn_scan: {
ScanFragment mScanFragment = new ScanFragment(); ScanFragment mScanFragment = new ScanFragment();
mScanFragment.setTitle("添加商品组合");
mScanFragment.setOnScanCompletedListener(new ScanFragment mScanFragment.setOnScanCompletedListener(new ScanFragment
.OnScanCompletedListener() { .OnScanCompletedListener() {
@Override @Override
......
...@@ -79,6 +79,7 @@ public class BaleIndexFragment extends BaseFragment<BalePresenter, FragmentBaleI ...@@ -79,6 +79,7 @@ public class BaleIndexFragment extends BaseFragment<BalePresenter, FragmentBaleI
case R.id.btn_scan: { case R.id.btn_scan: {
ScanFragment mScanFragment = new ScanFragment mScanFragment = new
ScanFragment(); ScanFragment();
mScanFragment.setTitle("商品组合");
mScanFragment.setOnScanCompletedListener mScanFragment.setOnScanCompletedListener
(new ScanFragment (new ScanFragment
.OnScanCompletedListener() { .OnScanCompletedListener() {
...@@ -94,9 +95,11 @@ public class BaleIndexFragment extends BaseFragment<BalePresenter, FragmentBaleI ...@@ -94,9 +95,11 @@ public class BaleIndexFragment extends BaseFragment<BalePresenter, FragmentBaleI
loadingDialog); loadingDialog);
} }
}); });
if (!mScanFragment.isAdded()) { if (!mScanFragment.isAdded()) {
start(mScanFragment); start(mScanFragment);
} }
} }
break; break;
default: { default: {
...@@ -117,6 +120,11 @@ public class BaleIndexFragment extends BaseFragment<BalePresenter, FragmentBaleI ...@@ -117,6 +120,11 @@ public class BaleIndexFragment extends BaseFragment<BalePresenter, FragmentBaleI
LoadingDialog LoadingDialog
loadingDialog) { loadingDialog) {
mViewBinding.tvKeyword.setText(wd); mViewBinding.tvKeyword.setText(wd);
if (usskuPager.getTotalRow() <= 0) {
mViewBinding.btnGroup.setVisibility(View.GONE);
} else {
mViewBinding.btnGroup.setVisibility(View.VISIBLE);
}
mViewBinding.btnGroup.setText(Html.fromHtml(getResources().getString(R.string mViewBinding.btnGroup.setText(Html.fromHtml(getResources().getString(R.string
.tv_bale_count, "<font color='#1f7bdb'><big> " + usskuPager.getTotalRow() + .tv_bale_count, "<font color='#1f7bdb'><big> " + usskuPager.getTotalRow() +
"</big></font>"))); "</big></font>")));
......
...@@ -2,6 +2,9 @@ package com.xingdata.zzdpos.ui.scan; ...@@ -2,6 +2,9 @@ package com.xingdata.zzdpos.ui.scan;
import android.content.Context; import android.content.Context;
import android.os.Handler; import android.os.Handler;
import android.view.View;
import android.view.ViewStub;
import android.widget.TextView;
import com.xingdata.zzdpos.R; import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment; import com.xingdata.zzdpos.base.BaseFragment;
...@@ -12,10 +15,14 @@ import me.dm7.barcodescanner.core.IViewFinder; ...@@ -12,10 +15,14 @@ import me.dm7.barcodescanner.core.IViewFinder;
import me.dm7.barcodescanner.core.ViewFinderView; import me.dm7.barcodescanner.core.ViewFinderView;
import me.dm7.barcodescanner.zxing.ZXingScannerView; import me.dm7.barcodescanner.zxing.ZXingScannerView;
public class ScanFragment<P extends BasePresenter> extends BaseFragment<P, FragmentStoreScanBinding> { public class ScanFragment<P extends BasePresenter> extends BaseFragment<P,
FragmentStoreScanBinding> {
private ZXingScannerView mScannerView; private ZXingScannerView mScannerView;
private ZXingScannerView.ResultHandler mResultHandler; private ZXingScannerView.ResultHandler mResultHandler;
private String titleStr = "";
private ViewStub viewStub;
private View inflated;
@Override @Override
public int getLayoutId() { public int getLayoutId() {
...@@ -51,6 +58,21 @@ public class ScanFragment<P extends BasePresenter> extends BaseFragment<P, Fragm ...@@ -51,6 +58,21 @@ public class ScanFragment<P extends BasePresenter> extends BaseFragment<P, Fragm
@Override @Override
public void initView() { public void initView() {
if (!titleStr.equals("")) {
mViewBinding.vsTitle.getViewStub().setVisibility(View.VISIBLE);
viewStub = mViewBinding.vsTitle.getViewStub();
if (viewStub.getParent() != null) {
inflated = viewStub.inflate();
}
inflated.findViewById(R.id.iv_back).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
pop();
}
});
((TextView) (inflated.findViewById(R.id.tv_title))).setText(titleStr);
}
mScannerView = new ZXingScannerView(mContext) { mScannerView = new ZXingScannerView(mContext) {
@Override @Override
protected IViewFinder createViewFinderView(Context context) { protected IViewFinder createViewFinderView(Context context) {
...@@ -99,7 +121,8 @@ public class ScanFragment<P extends BasePresenter> extends BaseFragment<P, Fragm ...@@ -99,7 +121,8 @@ public class ScanFragment<P extends BasePresenter> extends BaseFragment<P, Fragm
int themeColor = getResources().getColor(R.color.blue_mawu); int themeColor = getResources().getColor(R.color.blue_mawu);
this.setBorderColor(themeColor); this.setBorderColor(themeColor);
this.setBorderStrokeWidth(getResources().getDimensionPixelOffset(R.dimen.all_shape_radius)); this.setBorderStrokeWidth(getResources().getDimensionPixelOffset(R.dimen
.all_shape_radius));
this.setLaserColor(themeColor); this.setLaserColor(themeColor);
this.setLaserEnabled(true); this.setLaserEnabled(true);
...@@ -107,4 +130,8 @@ public class ScanFragment<P extends BasePresenter> extends BaseFragment<P, Fragm ...@@ -107,4 +130,8 @@ public class ScanFragment<P extends BasePresenter> extends BaseFragment<P, Fragm
} }
public void setTitle(String titleStr) {
this.titleStr = titleStr;
}
} }
\ No newline at end of file
...@@ -2,16 +2,16 @@ ...@@ -2,16 +2,16 @@
<layout xmlns:tools="http://schemas.android.com/tools"> <layout xmlns:tools="http://schemas.android.com/tools">
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/gray_zhouyu" android:background="@color/gray_zhouyu"
> >
<include <include
android:id="@+id/ic_title" android:id="@+id/ic_title"
layout="@layout/title" layout="@layout/title"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent"/>
<FrameLayout <FrameLayout
...@@ -26,25 +26,25 @@ ...@@ -26,25 +26,25 @@
android:id="@+id/view_order_detail" android:id="@+id/view_order_detail"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout="@layout/view_order_detail" /> android:layout="@layout/view_order_detail"/>
<ViewStub <ViewStub
android:id="@+id/view_vip_recharge" android:id="@+id/view_vip_recharge"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout="@layout/view_vip_recharge" /> android:layout="@layout/view_vip_recharge"/>
<ViewStub <ViewStub
android:id="@+id/view_ticket" android:id="@+id/view_ticket"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout="@layout/view_ticket" /> android:layout="@layout/view_ticket"/>
<ViewStub <ViewStub
android:id="@+id/view_cs" android:id="@+id/view_cs"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout="@layout/view_inventory_detail" /> android:layout="@layout/view_inventory_detail"/>
</FrameLayout> </FrameLayout>
<android.support.constraint.ConstraintLayout <android.support.constraint.ConstraintLayout
...@@ -71,13 +71,13 @@ ...@@ -71,13 +71,13 @@
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/btn_return" app:layout_constraintRight_toLeftOf="@id/btn_return"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
tools:targetApi="lollipop" /> tools:targetApi="lollipop"/>
<Button <Button
android:id="@+id/btn_return" android:id="@+id/btn_return"
style="@style/button_positive" style="@style/button_positive"
android:layout_width="@dimen/button1_width" android:layout_width="@dimen/button1_width"
android:layout_height="37dp" android:layout_height="@dimen/button1_height"
android:gravity="center" android:gravity="center"
android:stateListAnimator="@null" android:stateListAnimator="@null"
android:text="@string/pay_return" android:text="@string/pay_return"
...@@ -87,13 +87,13 @@ ...@@ -87,13 +87,13 @@
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:layout_goneMarginStart="@dimen/all_margin_big_big" app:layout_goneMarginStart="@dimen/all_margin_big_big"
tools:targetApi="lollipop" /> tools:targetApi="lollipop"/>
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/view_line_L050" android:layout_height="@dimen/view_line_L050"
android:background="@color/gray_huanggai" android:background="@color/gray_huanggai"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent"/>
</android.support.constraint.ConstraintLayout> </android.support.constraint.ConstraintLayout>
</android.support.constraint.ConstraintLayout> </android.support.constraint.ConstraintLayout>
</layout> </layout>
\ No newline at end of file
...@@ -111,7 +111,7 @@ ...@@ -111,7 +111,7 @@
style="@style/button_positive" style="@style/button_positive"
android:layout_width="@dimen/all_button_radius_width" android:layout_width="@dimen/all_button_radius_width"
android:layout_height="@dimen/all_button_radius_height" android:layout_height="@dimen/all_button_radius_height"
android:layout_marginLeft="@dimen/all_margin_big" android:layout_marginLeft="@dimen/all_margin_big_big"
android:onClick="@{OnClickListener}" android:onClick="@{OnClickListener}"
android:stateListAnimator="@null" android:stateListAnimator="@null"
android:text="组 合" android:text="组 合"
......
...@@ -274,6 +274,7 @@ ...@@ -274,6 +274,7 @@
android:layout_weight="3" android:layout_weight="3"
android:gravity="center|left" android:gravity="center|left"
android:text="白金会员" android:text="白金会员"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/et_textsize"/> android:textSize="@dimen/et_textsize"/>
<Button <Button
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android" <layout xmlns:android="http://schemas.android.com/apk/res/android">
xmlns:app="http://schemas.android.com/apk/res-auto">
<android.support.constraint.ConstraintLayout <data>
<variable
name="onClickListener"
type="com.xingdata.zzdpos.util.OnClickListener"></variable>
</data>
<LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
android:orientation="vertical">
<ViewStub
android:id="@+id/vs_title"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:inflatedId="@+id/iv_VsContent"
android:layout="@layout/title"
android:onClick="@{onClickListener}"
android:visibility="gone"/>
<FrameLayout <FrameLayout
android:id="@+id/content_frame" android:id="@+id/content_frame"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" /> android:layout_height="match_parent"/>
</android.support.constraint.ConstraintLayout> </LinearLayout>
</layout> </layout>
\ No newline at end of file
...@@ -63,7 +63,10 @@ ...@@ -63,7 +63,10 @@
android:layout_marginRight="@dimen/all_bounced_padding" android:layout_marginRight="@dimen/all_bounced_padding"
android:background="@drawable/frame_frame_zhouyu_bg" android:background="@drawable/frame_frame_zhouyu_bg"
android:padding="@dimen/dp_4" android:padding="@dimen/dp_4"
android:maxLines="1"
android:lines="1"
android:text="规格" android:text="规格"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size_small" android:textSize="@dimen/all_text_size_small"
app:layout_constraintBottom_toBottomOf="@id/tv_no" app:layout_constraintBottom_toBottomOf="@id/tv_no"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
......
...@@ -74,15 +74,15 @@ ...@@ -74,15 +74,15 @@
<TextView <TextView
android:id="@+id/tv_No" android:id="@+id/tv_No"
style="@style/other_select_smallstyle" style="@style/other_select_smallstyle"
android:layout_width="150dp" android:layout_width="140dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="8531651233213"/> android:text="8531651233213"/>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="right"
android:layout_marginRight="@dimen/all_bounced_padding" android:layout_marginRight="@dimen/all_bounced_padding"
android:gravity="right"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
...@@ -90,8 +90,11 @@ ...@@ -90,8 +90,11 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/frame_frame_zhouyu_bg" android:background="@drawable/frame_frame_zhouyu_bg"
android:lines="1"
android:maxLines="1"
android:padding="@dimen/dp_4" android:padding="@dimen/dp_4"
android:text="规格" android:text="规格"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size_small" android:textSize="@dimen/all_text_size_small"
/> />
</LinearLayout> </LinearLayout>
......
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