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

修改bug

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