Commit cc58ab5e authored by 陈前's avatar 陈前

Merge remote-tracking branch 'origin/master'

parents f4473c31 b3ca6979
...@@ -66,11 +66,10 @@ dependencies { ...@@ -66,11 +66,10 @@ dependencies {
compile 'com.squareup.okhttp3:logging-interceptor:3.9.0' compile 'com.squareup.okhttp3:logging-interceptor:3.9.0'
compile 'io.reactivex.rxjava2:rxjava:2.1.5' compile 'io.reactivex.rxjava2:rxjava:2.1.5'
compile 'io.reactivex.rxjava2:rxandroid:2.0.1' compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
compile 'com.alibaba:fastjson:1.1.67.android' compile 'com.alibaba:fastjson:1.2.39'
compile 'com.blankj:utilcode:1.9.3' compile 'com.blankj:utilcode:1.11.1'
compile 'com.facebook.fresco:fresco:1.5.0' compile 'com.facebook.fresco:fresco:1.5.0'
compile 'com.squareup.picasso:picasso:2.5.2' compile 'com.facebook.fresco:animated-gif:1.5.0'
compile group: 'com.facebook.fresco', name: 'animated-gif', version: '1.5.0'
compile 'com.hwangjr.rxbus:rxbus:2.0.0' compile 'com.hwangjr.rxbus:rxbus:2.0.0'
compile 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.30' compile 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.30'
compile 'com.yanzhenjie:permission:1.1.2' compile 'com.yanzhenjie:permission:1.1.2'
...@@ -80,7 +79,6 @@ dependencies { ...@@ -80,7 +79,6 @@ dependencies {
compile 'com.contrarywind:Android-PickerView:3.2.5' compile 'com.contrarywind:Android-PickerView:3.2.5'
compile 'com.github.ybq:Android-SpinKit:1.1.0' compile 'com.github.ybq:Android-SpinKit:1.1.0'
compile 'com.youth.banner:banner:1.4.10' compile 'com.youth.banner:banner:1.4.10'
compile 'cn.jzvd:jiaozivideoplayer:6.0.0'
compile 'me.dm7.barcodescanner:zxing:1.9.8' compile 'me.dm7.barcodescanner:zxing:1.9.8'
compile 'com.google.zxing:core:3.3.1' compile 'com.google.zxing:core:3.3.1'
compile(name: 'zx_print_library-debug', ext: 'aar') compile(name: 'zx_print_library-debug', ext: 'aar')
......
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.SEND_SMS" /> <uses-permission android:name="android.permission.SEND_SMS" />
<uses-permission android:name="android.permission.CAMERA" />
<application <application
android:name=".App" android:name=".App"
android:allowBackup="true" android:allowBackup="true"
......
...@@ -76,10 +76,10 @@ public class EditorFragment extends BaseFragment<SsskuPresenter, FragmentSsskuEd ...@@ -76,10 +76,10 @@ public class EditorFragment extends BaseFragment<SsskuPresenter, FragmentSsskuEd
mOnFocusChangeListener = (view, b) -> { mOnFocusChangeListener = (view, b) -> {
if (view instanceof EditText) { if (view instanceof EditText) {
EditText editText = (EditText) view; EditText editText = (EditText) view;
if (b && editText.getText().toString().equals("0.0")) { if (b && editText.getText().toString().equals("0.00")) {
editText.setText(""); editText.setText("");
} else if (!b && editText.getText().length() == 0) { } else if (!b && editText.getText().length() == 0) {
editText.setText("0.0"); editText.setText("0.00");
} }
} }
}; };
......
...@@ -52,10 +52,10 @@ public class PriceFragment extends BaseFragment<SsskuPresenter, FragmentSsskuPri ...@@ -52,10 +52,10 @@ public class PriceFragment extends BaseFragment<SsskuPresenter, FragmentSsskuPri
View.OnFocusChangeListener mOnFocusChangeListener = (view, b) -> { View.OnFocusChangeListener mOnFocusChangeListener = (view, b) -> {
if (view instanceof EditText) { if (view instanceof EditText) {
EditText editText = (EditText) view; EditText editText = (EditText) view;
if (b && editText.getText().toString().equals("0.0")) { if (b && editText.getText().toString().equals("0.00")) {
editText.setText(""); editText.setText("");
} else if (!b && editText.getText().length() == 0) { } else if (!b && editText.getText().length() == 0) {
editText.setText("0.0"); editText.setText("0.00");
} }
} }
}; };
......
...@@ -52,10 +52,10 @@ public class VipFragment extends BaseFragment<SsskuPresenter, FragmentSsskuVipBi ...@@ -52,10 +52,10 @@ public class VipFragment extends BaseFragment<SsskuPresenter, FragmentSsskuVipBi
View.OnFocusChangeListener mOnFocusChangeListener = (view, b) -> { View.OnFocusChangeListener mOnFocusChangeListener = (view, b) -> {
if (view instanceof EditText) { if (view instanceof EditText) {
EditText editText = (EditText) view; EditText editText = (EditText) view;
if (b && editText.getText().toString().equals("0.0")) { if (b && editText.getText().toString().equals("0.00")) {
editText.setText(""); editText.setText("");
} else if (!b && editText.getText().length() == 0) { } else if (!b && editText.getText().length() == 0) {
editText.setText("0.0"); editText.setText("0.00");
} }
} }
}; };
......
...@@ -61,6 +61,7 @@ public class UserActivity extends BaseActivity<UserPresenter, ActivityUserBindin ...@@ -61,6 +61,7 @@ public class UserActivity extends BaseActivity<UserPresenter, ActivityUserBindin
@Override @Override
public void delUserSus() { public void delUserSus() {
mPresenter.userInfoFragment.pop();
mPresenter.userListFragment.delUserSus(); mPresenter.userListFragment.delUserSus();
} }
} }
...@@ -25,7 +25,6 @@ public interface UserContract { ...@@ -25,7 +25,6 @@ public interface UserContract {
void addSusSus(Oper oper); void addSusSus(Oper oper);
void updateUserSus(Oper oper); void updateUserSus(Oper oper);
void delUserSus(); void delUserSus();
} }
abstract class Presenter extends BasePresenter<View> { abstract class Presenter extends BasePresenter<View> {
...@@ -34,5 +33,6 @@ public interface UserContract { ...@@ -34,5 +33,6 @@ public interface UserContract {
public abstract void querySta(); public abstract void querySta();
public abstract void updateUser(Oper oper); public abstract void updateUser(Oper oper);
public abstract void delUser(Oper oper); public abstract void delUser(Oper oper);
public abstract void queryUser(String wd);
} }
} }
\ No newline at end of file
...@@ -92,6 +92,15 @@ public class UserPresenter extends UserContract.Presenter { ...@@ -92,6 +92,15 @@ public class UserPresenter extends UserContract.Presenter {
}); });
} }
@Override
public void queryUser(String wd) {
ApiFactory.Oper.queryOper(wd).subscribe(operPager -> {
mView.queryOperSus(operPager);
}, throwable -> {
ToastUtils.showShort(throwable.getMessage());
});
}
public List<String> getOperLevelList() { public List<String> getOperLevelList() {
ArrayList<String> operLevelList = new ArrayList<>(); ArrayList<String> operLevelList = new ArrayList<>();
...@@ -99,6 +108,6 @@ public class UserPresenter extends UserContract.Presenter { ...@@ -99,6 +108,6 @@ public class UserPresenter extends UserContract.Presenter {
while (iterator.hasNext()) { while (iterator.hasNext()) {
operLevelList.add(iterator.next().getKey()); operLevelList.add(iterator.next().getKey());
} }
return operLevelList.subList(0,operLevelList.size()-1); return operLevelList.subList(0, operLevelList.size() - 1);
} }
} }
...@@ -11,6 +11,7 @@ import android.view.View; ...@@ -11,6 +11,7 @@ import android.view.View;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.RadioButton; import android.widget.RadioButton;
import com.blankj.utilcode.util.ToastUtils;
import com.xingdata.zzdpos.R; import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseActivity; import com.xingdata.zzdpos.base.BaseActivity;
import com.xingdata.zzdpos.base.BaseFragment; import com.xingdata.zzdpos.base.BaseFragment;
...@@ -64,6 +65,13 @@ public class UserListFragment extends BaseFragment<UserPresenter, FragmentUserLi ...@@ -64,6 +65,13 @@ public class UserListFragment extends BaseFragment<UserPresenter, FragmentUserLi
mPresenter.userInfoEditFragment.setOper(null); mPresenter.userInfoEditFragment.setOper(null);
start(mPresenter.userInfoEditFragment); start(mPresenter.userInfoEditFragment);
break; break;
case R.id.userSearch:
if(mViewBinding.userSearch.getText().toString().length()==0){
ToastUtils.showShort("搜索条件不能为空");
return;
}
mPresenter.queryUser(mViewBinding.userSearch.getText().toString());
break;
} }
}); });
onRefresh(); onRefresh();
...@@ -102,4 +110,5 @@ public class UserListFragment extends BaseFragment<UserPresenter, FragmentUserLi ...@@ -102,4 +110,5 @@ public class UserListFragment extends BaseFragment<UserPresenter, FragmentUserLi
public void delUserSus() { public void delUserSus() {
onRefresh(); onRefresh();
} }
} }
package com.xingdata.zzdpos.ui.store; package com.xingdata.zzdpos.ui.store;
import android.animation.Keyframe;
import android.animation.ObjectAnimator;
import android.animation.PropertyValuesHolder;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.view.View;
import android.view.inputmethod.EditorInfo; import android.view.inputmethod.EditorInfo;
import com.blankj.utilcode.constant.PermissionConstants;
import com.blankj.utilcode.util.ActivityUtils; import com.blankj.utilcode.util.ActivityUtils;
import com.blankj.utilcode.util.KeyboardUtils; import com.blankj.utilcode.util.KeyboardUtils;
import com.blankj.utilcode.util.PermissionUtils;
import com.blankj.utilcode.util.StringUtils; import com.blankj.utilcode.util.StringUtils;
import com.xingdata.zzdpos.C; import com.xingdata.zzdpos.C;
import com.xingdata.zzdpos.R; import com.xingdata.zzdpos.R;
...@@ -64,6 +70,25 @@ public class StoreActivity extends BaseActivity<StorePresenter, ActivityStoreBin ...@@ -64,6 +70,25 @@ public class StoreActivity extends BaseActivity<StorePresenter, ActivityStoreBin
mViewBinding.etSearch.setOnFocusChangeListener((view, b) -> { mViewBinding.etSearch.setOnFocusChangeListener((view, b) -> {
mPresenter.searchBarFocusChanged(b); mPresenter.searchBarFocusChanged(b);
}); });
mViewBinding.btnScan.setOnClickListener(view -> {
PermissionUtils.permission(PermissionConstants.CAMERA)
.rationale(new PermissionUtils.OnRationaleListener() {
@Override
public void rationale(final ShouldRequest shouldRequest) {
}
})
.callback(new PermissionUtils.FullCallback() {
@Override
public void onGranted(List<String> permissionsGranted) {
showScanFragment();
}
@Override
public void onDenied(List<String> permissionsDeniedForever, List<String> permissionsDenied) {
}
})
.request();
});
} }
@Override @Override
...@@ -97,8 +122,49 @@ public class StoreActivity extends BaseActivity<StorePresenter, ActivityStoreBin ...@@ -97,8 +122,49 @@ public class StoreActivity extends BaseActivity<StorePresenter, ActivityStoreBin
mViewBinding.setCartCount(saleorder.getOrderCnt()); mViewBinding.setCartCount(saleorder.getOrderCnt());
mViewBinding.setOrderPayAmt(saleorder.getOrderPayAmt()); mViewBinding.setOrderPayAmt(saleorder.getOrderPayAmt());
mViewBinding.setMsDisAmt(saleorder.getMsDisAmt()); mViewBinding.setMsDisAmt(saleorder.getMsDisAmt());
if (mCartDialog.isShowing) mCartDialog.loadSaleorder(saleorder); if (mCartDialog.isShowing) mCartDialog.loadSaleorder(saleorder);
this.startShakeByPropertyAnim(mViewBinding.ivCart, 0.75f, 1f, 0.30f, 500L);
}
private void startShakeByPropertyAnim(View view, float scaleSmall, float scaleLarge, float shakeDegrees, long duration) {
if (view == null) {
return;
}
//先变小后变大
PropertyValuesHolder scaleXValuesHolder = PropertyValuesHolder.ofKeyframe(View.SCALE_X,
Keyframe.ofFloat(0f, 1.0f),
Keyframe.ofFloat(0.25f, scaleSmall),
Keyframe.ofFloat(0.5f, scaleLarge),
Keyframe.ofFloat(0.75f, scaleLarge),
Keyframe.ofFloat(1.0f, 1.0f)
);
PropertyValuesHolder scaleYValuesHolder = PropertyValuesHolder.ofKeyframe(View.SCALE_Y,
Keyframe.ofFloat(0f, 1.0f),
Keyframe.ofFloat(0.25f, scaleSmall),
Keyframe.ofFloat(0.5f, scaleLarge),
Keyframe.ofFloat(0.75f, scaleLarge),
Keyframe.ofFloat(1.0f, 1.0f)
);
//先往左再往右
PropertyValuesHolder rotateValuesHolder = PropertyValuesHolder.ofKeyframe(View.ROTATION,
Keyframe.ofFloat(0f, 0f),
Keyframe.ofFloat(0.1f, -shakeDegrees),
Keyframe.ofFloat(0.2f, shakeDegrees),
Keyframe.ofFloat(0.3f, -shakeDegrees),
Keyframe.ofFloat(0.4f, shakeDegrees),
Keyframe.ofFloat(0.5f, -shakeDegrees),
Keyframe.ofFloat(0.6f, shakeDegrees),
Keyframe.ofFloat(0.7f, -shakeDegrees),
Keyframe.ofFloat(0.8f, shakeDegrees),
Keyframe.ofFloat(0.9f, -shakeDegrees),
Keyframe.ofFloat(1.0f, 0f)
);
ObjectAnimator objectAnimator = ObjectAnimator.ofPropertyValuesHolder(view, scaleXValuesHolder, scaleYValuesHolder, rotateValuesHolder);
objectAnimator.setDuration(duration);
objectAnimator.start();
} }
@Override @Override
...@@ -121,7 +187,7 @@ public class StoreActivity extends BaseActivity<StorePresenter, ActivityStoreBin ...@@ -121,7 +187,7 @@ public class StoreActivity extends BaseActivity<StorePresenter, ActivityStoreBin
@Override @Override
public void showCartDialog(Saleorder saleorder, List<Saledetail> saledetails) { public void showCartDialog(Saleorder saleorder, List<Saledetail> saledetails) {
mCartDialog.setSaleorder(saleorder).setSaledetails(saledetails).show(this); mCartDialog.setSaleorder(saleorder).setSaledetails(saledetails).show(this);
} }
@Override @Override
public void showMsDialog(List<Ms> mss) { public void showMsDialog(List<Ms> mss) {
...@@ -143,11 +209,20 @@ public class StoreActivity extends BaseActivity<StorePresenter, ActivityStoreBin ...@@ -143,11 +209,20 @@ public class StoreActivity extends BaseActivity<StorePresenter, ActivityStoreBin
if (!mSearchFragment.isAdded()) this.start(mSearchFragment); if (!mSearchFragment.isAdded()) this.start(mSearchFragment);
} }
@Override
public void showScanFragment() {
this.start(mScanFragment);
}
@Override @Override
public void resetSearchBar() { public void resetSearchBar() {
mViewBinding.etSearch.setText(""); mViewBinding.etSearch.setText("");
mViewBinding.clTitle.requestFocus(); mViewBinding.clTitle.requestFocus();
mViewBinding.clTitle.requestFocusFromTouch(); }
@Override
public void resetScanner() {
mScanFragment.resetScanner();
} }
} }
...@@ -102,10 +102,20 @@ interface StoreContract { ...@@ -102,10 +102,20 @@ interface StoreContract {
*/ */
void showSearchFragment(); void showSearchFragment();
/**
* 显示扫码页面
*/
void showScanFragment();
/** /**
* 重置搜索栏 * 重置搜索栏
*/ */
void resetSearchBar(); void resetSearchBar();
/**
* 重置扫描器
*/
void resetScanner();
} }
abstract class Presenter extends BasePresenter<View> { abstract class Presenter extends BasePresenter<View> {
...@@ -137,9 +147,18 @@ interface StoreContract { ...@@ -137,9 +147,18 @@ interface StoreContract {
/** /**
* 商店页面 - 点击搜索 * 商店页面 - 点击搜索
*
* @param keyword 关键字
*/ */
public abstract void searchSku(String keyword); public abstract void searchSku(String keyword);
/**
* 扫描页面 - 扫描完成
*
* @param keyword 关键字
*/
public abstract void scanComplete(String keyword);
/** /**
* 搜索页面 - 加载更多搜索结果 * 搜索页面 - 加载更多搜索结果
*/ */
......
package com.xingdata.zzdpos.ui.store; package com.xingdata.zzdpos.ui.store;
import com.xingdata.zzdpos.base.BaseSku; import com.xingdata.zzdpos.base.BaseSku;
import com.xingdata.zzdpos.db.DB;
import com.xingdata.zzdpos.db.DBFactory; import com.xingdata.zzdpos.db.DBFactory;
import com.xingdata.zzdpos.model.Ms; import com.xingdata.zzdpos.model.Ms;
import com.xingdata.zzdpos.model.Saledetail; import com.xingdata.zzdpos.model.Saledetail;
import com.xingdata.zzdpos.model.Saleorder; import com.xingdata.zzdpos.model.Saleorder;
import com.xingdata.zzdpos.model.Sskugrp; import com.xingdata.zzdpos.model.Sskugrp;
import com.xingdata.zzdpos.model.Sssku;
import com.xingdata.zzdpos.model.Ussku;
import com.xingdata.zzdpos.model.Vip; import com.xingdata.zzdpos.model.Vip;
import com.xingdata.zzdpos.ui.main.MainPresenter;
import com.xingdata.zzdpos.util.StringUtil;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -105,6 +110,11 @@ public class StorePresenter extends StoreContract.Presenter { ...@@ -105,6 +110,11 @@ public class StorePresenter extends StoreContract.Presenter {
this.getSearchSku(); this.getSearchSku();
} }
@Override
public void scanComplete(String keyword) {
this.getProductByBarcode(keyword);
}
@Override @Override
public void loadMoreSearchResult() { public void loadMoreSearchResult() {
this.mSearchPageNum++; this.mSearchPageNum++;
...@@ -321,4 +331,34 @@ public class StorePresenter extends StoreContract.Presenter { ...@@ -321,4 +331,34 @@ public class StorePresenter extends StoreContract.Presenter {
} }
/**
* 根据条形码获取商品
*
* @param barcode 条形码
*/
private void getProductByBarcode(String barcode) {
mView.showLoadingDialog();
List<Sssku> ssskus = DBFactory.getList(DB.getInstance().get(MainPresenter.class).where
(Sssku.class)
.equalTo("spuBarcode", StringUtil.strToLong(barcode))
.equalTo("skuStatus", 0)
.findAll());
List<Ussku> usskus = DBFactory.getList(DB.getInstance().get(MainPresenter.class).where
(Ussku.class)
.equalTo("spuBarcode", StringUtil.strToLong(barcode))
.equalTo("skuStatus", 0)
.findAll());
if (ssskus.size() + usskus.size() > 1) {
mView.showSearchFragment();
this.searchSku(barcode);
} else if (ssskus.size() == 1 && usskus.size() == 0) {
this.clickAddSku(ssskus.get(0), 1);
} else if (ssskus.size() == 0 && usskus.size() == 1) {
this.clickAddSku(usskus.get(0), 1);
} else {
mView.resetScanner();
}
mView.dismissLoadingDialog();
}
} }
package com.xingdata.zzdpos.ui.store.fragment; package com.xingdata.zzdpos.ui.store.fragment;
import android.content.Context;
import android.os.Handler;
import com.xingdata.zzdpos.R; import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment; import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentStoreScanBinding; import com.xingdata.zzdpos.databinding.FragmentStoreScanBinding;
import com.xingdata.zzdpos.ui.store.StorePresenter; import com.xingdata.zzdpos.ui.store.StorePresenter;
import me.dm7.barcodescanner.core.IViewFinder;
import me.dm7.barcodescanner.core.ViewFinderView;
import me.dm7.barcodescanner.zxing.ZXingScannerView;
public class ScanFragment extends BaseFragment<StorePresenter, FragmentStoreScanBinding> { public class ScanFragment extends BaseFragment<StorePresenter, FragmentStoreScanBinding> {
private ZXingScannerView mScannerView;
private ZXingScannerView.ResultHandler mResultHandler;
@Override @Override
public int getLayoutId() { public int getLayoutId() {
return R.layout.fragment_store_scan; return R.layout.fragment_store_scan;
...@@ -14,6 +25,54 @@ public class ScanFragment extends BaseFragment<StorePresenter, FragmentStoreScan ...@@ -14,6 +25,54 @@ public class ScanFragment extends BaseFragment<StorePresenter, FragmentStoreScan
@Override @Override
public void initView() { public void initView() {
mScannerView = new ZXingScannerView(mContext) {
@Override
protected IViewFinder createViewFinderView(Context context) {
return new CustomViewFinderView(context);
}
};
mResultHandler = result -> {
mPresenter.scanComplete(result.getText());
resetScanner();
};
mScannerView.setResultHandler(mResultHandler);
mViewBinding.contentFrame.addView(mScannerView);
}
@Override
public void onResume() {
super.onResume();
mScannerView.startCamera();
}
@Override
public void onPause() {
super.onPause();
mScannerView.stopCamera();
}
/**
* 重置扫描器
*/
public void resetScanner() {
new Handler().postDelayed(() -> mScannerView.resumeCameraPreview(mResultHandler), 500);
}
private static class CustomViewFinderView extends ViewFinderView {
public CustomViewFinderView(Context context) {
super(context);
int themeColor = getResources().getColor(R.color.blue_mawu);
this.setBorderColor(themeColor);
this.setBorderStrokeWidth(getResources().getDimensionPixelOffset(R.dimen.all_spacing));
this.setLaserColor(themeColor);
this.setLaserEnabled(true);
}
} }
} }
\ No newline at end of file
package com.xingdata.zzdpos.util;
import android.graphics.Bitmap;
import android.graphics.BitmapShader;
import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.RectF;
import android.graphics.Shader;
import com.squareup.picasso.Transformation;
/**
* Created by loften on 2017/7/26.
*/
public class CircleImageTransformation implements Transformation {
/**
* A unique key for the transformation, used for caching purposes.
*/
private static final String KEY = "circleImageTransformation";
@Override
public Bitmap transform(Bitmap source) {
int minEdge = Math.min(source.getWidth(), source.getHeight());
int dx = (source.getWidth() - minEdge) / 2;
int dy = (source.getHeight() - minEdge) / 2;
// Init shader
Shader shader = new BitmapShader(source, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP);
Matrix matrix = new Matrix();
matrix.setTranslate(-dx, -dy); // Move the target area to center of the source bitmap
shader.setLocalMatrix(matrix);
// Init paint
Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
paint.setShader(shader);
// Create and draw circle bitmap
Bitmap output = Bitmap.createBitmap(minEdge, minEdge, source.getConfig());
Canvas canvas = new Canvas(output);
canvas.drawOval(new RectF(0, 0, minEdge, minEdge), paint);
// Recycle the source bitmap, because we already generate a new one
source.recycle();
return output;
}
@Override
public String key() {
return KEY;
}
}
\ No newline at end of file
package com.xingdata.zzdpos.view;
import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.ProgressBar;
/**
* Created by Administrator on 2017/12/6.
*/
public class MyVideoView extends cn.jzvd.JZVideoPlayerStandard {
private ProgressBar progressBar;
private ImageView btnStart;
private ViewGroup bottomContainer;
public MyVideoView(Context context) {
super(context);
progressBar = super.bottomProgressBar;
btnStart = super.startButton;
bottomContainer = super.bottomContainer;
}
public MyVideoView(Context context, AttributeSet attrs) {
super(context, attrs);
progressBar = super.bottomProgressBar;
btnStart = super.startButton;
bottomContainer = super.bottomContainer;
}
@Override
public void onStatePlaying() {
super.onStatePlaying();
btnStart.setVisibility(GONE);
bottomContainer.setVisibility(GONE);
progressBar.setVisibility(VISIBLE);
}
@Override
public void onStateAutoComplete() {
progressBar.setProgress(0);
btnStart.setVisibility(GONE);
btnStart.performClick();
btnStart.performClick();
}
@Override
public boolean onTouch(View v, MotionEvent event) {
return false;
}
}
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"> <shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="10000dp" /> <corners android:radius="@dimen/all_shape_radius" />
<solid android:color="@color/gray_kongming" /> <solid android:color="@color/gray_kongming" />
</shape> </shape>
\ No newline at end of file
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"> <shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="@dimen/settle_btn_radius" /> <corners android:radius="@dimen/settle_btn_radius" />
<solid android:color="@color/gray_huanggai" /> <solid android:color="@color/gray_kongming" />
</shape> </shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
</android.support.constraint.ConstraintLayout>
</layout>
\ No newline at end of file
...@@ -58,9 +58,9 @@ ...@@ -58,9 +58,9 @@
android:orientation="horizontal"> android:orientation="horizontal">
<View <View
android:layout_width="@dimen/all_line_width" android:layout_width="1dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/blue"></View> android:background="@mipmap/line"></View>
<TextView <TextView
android:id="@+id/tv_getsms" android:id="@+id/tv_getsms"
......
...@@ -2,12 +2,14 @@ ...@@ -2,12 +2,14 @@
<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"> xmlns:app="http://schemas.android.com/apk/res-auto">
<android.support.constraint.ConstraintLayout
<android.support.design.widget.CoordinatorLayout
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:orientation="vertical"> <FrameLayout
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</android.support.constraint.ConstraintLayout>
</android.support.design.widget.CoordinatorLayout>
</layout> </layout>
\ No newline at end of file
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
android:id="@+id/userSearch" android:id="@+id/userSearch"
android:gravity="center" android:gravity="center"
android:text="搜索" android:text="搜索"
android:onClick="@{onClickListener}"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" /> android:layout_height="wrap_content" />
......
...@@ -5,44 +5,45 @@ ...@@ -5,44 +5,45 @@
<variable <variable
name="onClickListener" name="onClickListener"
type="android.view.View.OnClickListener" /> type="android.view.View.OnClickListener"/>
</data> </data>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize" android:layout_height="?attr/actionBarSize"
android:background="@color/white"
android:orientation="horizontal"> android:orientation="horizontal">
<include <include
android:id="@+id/title_search" android:id="@+id/title_search"
layout="@layout/title_search" layout="@layout/title_search"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:layout_weight="1" /> android:layout_weight="1"/>
<ImageView <ImageView
android:layout_width="50dp" android:layout_width="50dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@mipmap/swipe_card_bg" /> android:background="@mipmap/swipe_card_bg"/>
<ImageView <ImageView
android:id="@+id/onScan" android:id="@+id/onScan"
android:layout_width="50dp" android:layout_width="50dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@mipmap/scan_bg" android:background="@mipmap/scan_bg"
android:onClick="@{onClickListener}" /> android:onClick="@{onClickListener}"/>
</LinearLayout> </LinearLayout>
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="1dp" android:layout_height="1dp"
android:layout_margin="@dimen/view_line_L5" android:layout_margin="@dimen/view_line_L5"
android:background="@color/line1" /> android:background="@color/line1"/>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -58,7 +59,7 @@ ...@@ -58,7 +59,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:gravity="center" android:gravity="center"
android:text="本店会员" /> android:text="本店会员"/>
<TextView <TextView
android:id="@+id/vip_count_add_today_title" android:id="@+id/vip_count_add_today_title"
...@@ -67,7 +68,7 @@ ...@@ -67,7 +68,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:gravity="center" android:gravity="center"
android:text="今日新增" /> android:text="今日新增"/>
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
...@@ -84,7 +85,7 @@ ...@@ -84,7 +85,7 @@
android:layout_weight="1" android:layout_weight="1"
android:gravity="center" android:gravity="center"
android:textSize="22sp" android:textSize="22sp"
android:textStyle="bold" /> android:textStyle="bold"/>
<TextView <TextView
android:id="@+id/vip_count_add_today" android:id="@+id/vip_count_add_today"
...@@ -94,7 +95,7 @@ ...@@ -94,7 +95,7 @@
android:layout_weight="1" android:layout_weight="1"
android:gravity="center" android:gravity="center"
android:textSize="22sp" android:textSize="22sp"
android:textStyle="bold" /> android:textStyle="bold"/>
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
...@@ -118,7 +119,7 @@ ...@@ -118,7 +119,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_margin="5dp" android:layout_margin="5dp"
android:background="@mipmap/add_bg" /> android:background="@mipmap/add_bg"/>
<TextView <TextView
style="@style/default_blacktext_bigstyle" style="@style/default_blacktext_bigstyle"
...@@ -126,7 +127,7 @@ ...@@ -126,7 +127,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="添加会员" android:text="添加会员"
android:textColor="@color/deep_red" android:textColor="@color/deep_red"
android:textSize="22sp" /> android:textSize="22sp"/>
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
...@@ -134,7 +135,7 @@ ...@@ -134,7 +135,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="1dp" android:layout_height="1dp"
android:layout_margin="@dimen/view_line_L5" android:layout_margin="@dimen/view_line_L5"
android:background="@color/line1" /> android:background="@color/line1"/>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -169,7 +170,7 @@ ...@@ -169,7 +170,7 @@
<android.support.v7.widget.RecyclerView <android.support.v7.widget.RecyclerView
android:id="@+id/vipRecyclerView" android:id="@+id/vipRecyclerView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" /> android:layout_height="match_parent"/>
</android.support.v4.widget.SwipeRefreshLayout> </android.support.v4.widget.SwipeRefreshLayout>
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:gravity="center" android:gravity="center"
android:textColor="@color/black_baozheng" android:textColor="@color/black_baozheng"
android:textSize="@{selected?@dimen/all_sub_title_size:@dimen/all_text_size}" /> android:textSize="@dimen/all_text_size" />
</FrameLayout> </FrameLayout>
......
...@@ -109,7 +109,7 @@ ...@@ -109,7 +109,7 @@
<dimen name="et_width">270dp</dimen> <dimen name="et_width">270dp</dimen>
<dimen name="et_height">44dp</dimen> <dimen name="et_height">44dp</dimen>
<dimen name="et_textsize">16sp</dimen> <dimen name="et_textsize">16sp</dimen>
<dimen name="et_padding">12dp</dimen> <dimen name="et_padding">10dp</dimen>
<dimen name="et_margin_logo">44dp</dimen> <dimen name="et_margin_logo">44dp</dimen>
<dimen name="et_margin_edittext">20dp</dimen> <dimen name="et_margin_edittext">20dp</dimen>
<dimen name="drop_down_margin_right_et">20dp</dimen> <dimen name="drop_down_margin_right_et">20dp</dimen>
......
...@@ -413,8 +413,9 @@ ...@@ -413,8 +413,9 @@
<item name="android:drawablePadding">@dimen/all_spacing</item> <item name="android:drawablePadding">@dimen/all_spacing</item>
<item name="android:paddingStart">@dimen/all_padding</item> <item name="android:paddingStart">@dimen/all_padding</item>
<item name="android:maxLines">1</item> <item name="android:maxLines">1</item>
<item name="android:layout_height">30dp</item>
<item name="android:maxLength">20</item> <item name="android:maxLength">20</item>
<item name="android:background">@drawable/shape_gray_r1</item> <item name="android:background">@drawable/shape_gray_r2</item>
<item name="android:imeOptions">actionSearch</item> <item name="android:imeOptions">actionSearch</item>
</style> </style>
...@@ -422,7 +423,7 @@ ...@@ -422,7 +423,7 @@
<item name="android:drawablePadding">@dimen/all_spacing</item> <item name="android:drawablePadding">@dimen/all_spacing</item>
<item name="android:maxLines">1</item> <item name="android:maxLines">1</item>
<item name="android:maxLength">20</item> <item name="android:maxLength">20</item>
<item name="android:background">@drawable/shape_gray_r1</item> <item name="android:background">@drawable/shape_gray_r2</item>
<item name="android:padding">@dimen/all_spacing</item> <item name="android:padding">@dimen/all_spacing</item>
<item name="android:imeOptions">actionSearch</item> <item name="android:imeOptions">actionSearch</item>
</style> </style>
......
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript { buildscript {
repositories { repositories {
jcenter() jcenter()
mavenCentral() mavenCentral()
...@@ -10,10 +7,6 @@ buildscript { ...@@ -10,10 +7,6 @@ buildscript {
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:3.0.1' classpath 'com.android.tools.build:gradle:3.0.1'
classpath "io.realm:realm-gradle-plugin:4.0.0" classpath "io.realm:realm-gradle-plugin:4.0.0"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
} }
} }
......
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