Commit 3408bd6b by 罗翻

Merge branch 'dev' into test

parents e0fe69c0 6d085b6c
Showing with 420 additions and 103 deletions
......@@ -28,7 +28,7 @@ public interface MainContract {
void initNotification();
void startLocaitonService();
void startLocationService();
}
abstract class Presenter extends BasePresenter<View> {
......
......@@ -28,6 +28,7 @@ import com.dayu.bigfish.presenter.main.MainContract;
import com.dayu.bigfish.presenter.main.MainPresenter;
import com.dayu.bigfish.ui.fragment.HomeFirstTabFragment;
import com.dayu.bigfish.ui.service.LocationService;
import com.dayu.bigfish.utils.HxManager;
import com.dayu.common.Constants;
import com.dayu.event.DownloadBean;
import com.dayu.event.UserInfo;
......@@ -40,7 +41,6 @@ import com.dayu.provider.event.SwtichFragment;
import com.dayu.provider.router.RouterPath;
import com.dayu.usercenter.ui.fragment.HomePersonFragment;
import com.dayu.utils.UserManager;
import com.dayu.utils.badgeNumberManger.BadgeNumberManager;
import com.dayu.widgets.CustomDialog;
import com.dayu.widgets.listener.onDownloadListener;
import com.umeng.analytics.MobclickAgent;
......@@ -87,7 +87,7 @@ public class MainActivity extends BaseActivity<MainPresenter, ActivityMainBindin
addFragment();
initListener();
doAction(getIntent());
startLocaitonService();
startLocationService();
EventBus.getDefault().register(this);
}
......@@ -113,11 +113,15 @@ public class MainActivity extends BaseActivity<MainPresenter, ActivityMainBindin
mFragmentManger = getSupportFragmentManager();
FragmentTransaction transaction = mFragmentManger.beginTransaction()
.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
for (Fragment fragment : mFragments) {
for (int i = 0; i < mFragments.length; i++) {
Fragment fragment = mFragments[i];
transaction.add(R.id.fl_container, fragment);
transaction.hide(fragment);
if (i == mFirstPositon) {
transaction.show(fragment);
} else {
transaction.hide(fragment);
}
}
transaction.show(mFragments[mFirstPositon]);
transaction.commit();
resetSelected(mFirstPositon);
}
......@@ -131,8 +135,8 @@ public class MainActivity extends BaseActivity<MainPresenter, ActivityMainBindin
private void showHideFragment(int showPosition, int hidePosition) {
if (showPosition == hidePosition) return;
mFragmentManger.beginTransaction()
.show(mFragments[showPosition])
.hide(mFragments[hidePosition])
.show(mFragments[showPosition])
.commit();
resetSelected(showPosition);
mPosition = showPosition;
......@@ -234,7 +238,7 @@ public class MainActivity extends BaseActivity<MainPresenter, ActivityMainBindin
}
@Override
public void startLocaitonService() {
public void startLocationService() {
UserInfo userInfo = UserManager.getInstance().getUser();
Intent intent = new Intent(mActivity, LocationService.class);
intent.putExtra(Constants.ACCOUNT_ID, userInfo.getAccountId());
......@@ -291,6 +295,7 @@ public class MainActivity extends BaseActivity<MainPresenter, ActivityMainBindin
@Override
public void onResume() {
super.onResume();
// BadgeNumberManager.from(mActivity).setBadgeNumber(0);
MobclickAgent.onResume(this);
}
......@@ -298,7 +303,7 @@ public class MainActivity extends BaseActivity<MainPresenter, ActivityMainBindin
public void onPause() {
super.onPause();
MobclickAgent.onPause(this);
BadgeNumberManager.from(mActivity).setBadgeNumber(0);
HxManager.getInstance().onDestory();
}
@Override
......
......@@ -57,7 +57,6 @@ public class LocationService extends Service {
RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), jsonObject.toString());
ApiFactory.commiteLocation(requestBody).subscribe(aBoolean -> {
}, throwable -> {
});
}
}));
......@@ -71,7 +70,7 @@ public class LocationService extends Service {
sendMessage();
}
};
mTimer.schedule(mTask, 2000, 600000);
mTimer.schedule(mTask, 2000, 300000);
}
public void sendMessage() {
......
package com.dayu.bigfish.utils;
import android.annotation.SuppressLint;
import android.app.ActivityManager;
import android.app.Notification;
import android.app.NotificationManager;
......@@ -45,10 +46,12 @@ import static com.dayu.common.Constants.IS_DEBUG;
*/
public class HxManager {
@SuppressLint("StaticFieldLeak")
private static HxManager instance;
private boolean sdkInited = false;
private Context mContext;
private LicenceDialog mDialog;
private int mCount = 0;
private HxManager() {
}
......@@ -146,9 +149,10 @@ public class HxManager {
if (notificationManager != null) {
notificationManager.notify(0, builder.build());
}
mCount++;
// BadgeNumberManager.from(mContext).setBadgeNumber(mCount);
// BadgeNumberUtils.setBadgeNumberXiaoMi(notification, messages.size());
}
// BadgeNumberManager.from(mContext).setBadgeNumber(messages.size());
// BadgeNumberUtils.setBadgeNumberXiaoMi(notification,messages.size());
}
}
......@@ -255,4 +259,8 @@ public class HxManager {
// 没有匹配的项,返回为null
return null;
}
public void onDestory() {
mCount = 0;
}
}
......@@ -24,7 +24,6 @@ android {
minifyEnabled isDebugMinify
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
buildConfigField "String", "BASEURL", "\"${BASE_URL}\""
// resValue("string", "PORT_NUMBER", "8081")
}
}
......@@ -65,6 +64,9 @@ dependencies {
// compile 'com.contrarywind:Android-PickerView:3.2.7'
//jsbridge
compile 'com.github.lzyzsd:jsbridge:1.0.4'
//zxing
compile 'com.google.zxing:core:3.3.2'
compile 'com.journeyapps:zxing-android-embedded:3.5.0'
compile project(':locationComponent')
compile project(':pickerview')
......
package com.dayu.base.ui.adapter;
import android.animation.ObjectAnimator;
import android.content.Context;
import android.databinding.DataBindingUtil;
import android.support.annotation.LayoutRes;
......@@ -45,6 +46,7 @@ public class CoreAdapter<M, B> extends RecyclerView.Adapter<BaseViewHolder> {
private boolean isNeedFoot = false;
private View mFootView;
private int mFootViewType;
private int oldPosition = -1;
@Override
public BaseViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
......@@ -90,6 +92,7 @@ public class CoreAdapter<M, B> extends RecyclerView.Adapter<BaseViewHolder> {
this.viewType = type;
}
public void setTypeSelector(TypeSelector mTypeSelector) {
this.mTypeSelector = mTypeSelector;
this.viewType = Constants.FLAG_MULTI_VH;
......@@ -106,6 +109,7 @@ public class CoreAdapter<M, B> extends RecyclerView.Adapter<BaseViewHolder> {
/**
* 目前只支持添加一个脚布局.
*
* @param view
* @param type
*/
......@@ -232,6 +236,18 @@ public class CoreAdapter<M, B> extends RecyclerView.Adapter<BaseViewHolder> {
}
}
// @Override
// public void onViewAttachedToWindow(@NonNull BaseViewHolder holder) {
// if (holder.getLayoutPosition() > oldPosition) {
// addItemAnimation(holder.itemView);
// oldPosition = holder.getLayoutPosition();
// }
// }
private void addItemAnimation(View itemView) {
ObjectAnimator.ofFloat(itemView, "translationY", 500f, 0f).setDuration(500).start();
}
/**
* 继承coreadapter需要重写此方法.
*
......
package com.dayu.utils;
import android.app.Activity;
import android.os.Environment;
import com.luck.picture.lib.PictureSelectionModel;
import com.luck.picture.lib.PictureSelector;
import com.luck.picture.lib.config.PictureConfig;
import com.luck.picture.lib.config.PictureMimeType;
import java.io.File;
/**
* Created by luofan
* on 2018/8/7.
*/
public class SelectPicUtils {
public static void selectPic(Activity activity, int size) {
PictureSelectionModel selector = PictureSelector.create(activity)
.openGallery(PictureMimeType.ofImage())//全部.PictureMimeType.ofAll()、图片.ofImage()、视频.ofVideo()
.maxSelectNum(size)// 最大图片选择数量 int
.imageSpanCount(4)// 每行显示个数 int
.selectionMode(PictureConfig.MULTIPLE)// 多选 or 单选 PictureConfig.MULTIPLE or PictureConfig.SINGLE
.previewImage(true)// 是否可预览图片 true or false
.isCamera(true)// 是否显示拍照按钮 true or false
.isZoomAnim(true)// 图片列表点击 缩放效果 默认true
.sizeMultiplier(0.1f)// glide 加载图片大小 0~1之间 如设置 .glideOverride()无效
.setOutputCameraPath("/CustomPath")// 自定义拍、照保存路径,可不填
.compress(true)// 是否压缩 true or false
.glideOverride(300, 500)// int glide 加载宽高,越小图片列表越流畅,但会影响列表图片浏览的清晰度
.hideBottomControls(true)// 是否显示uCrop工具栏,默认不显示 true or false
.compressSavePath(getPath())//压缩图片保存地址
.previewEggs(true)// 预览图片时 是否增强左右滑动图片体验(图片滑动一半即可看到上一张是否选中) true or false
// .minimumCompressSize(100)// 小于100kb的图片不压缩
.synOrAsy(true);//同步true或异步false 压缩 默认同步、
// .enableCrop(true)//是否裁剪
// .freeStyleCropEnabled(true)
selector.forResult(PictureConfig.CHOOSE_REQUEST);
}
private static String getPath() {
String path = Environment.getExternalStorageDirectory() + "/dayu/image/";
File file = new File(path);
if (file.mkdirs()) {
return path;
}
return path;
}
}
......@@ -74,7 +74,7 @@ public class UIUtils {
* @param dp
* @return
*/
public int dp2px(int dp) {
public static int dp2px(int dp) {
// 获取手机屏幕的密度
float density = getResources().getDisplayMetrics().density;
return (int) (dp * density + 0.5f); // 加0.5是为了四舍五入
......
......@@ -85,7 +85,6 @@ public class LRecyclerView<M, B> extends FrameLayout {
public LRecyclerView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init(context, attrs);
}
private void init(Context context, AttributeSet attrs) {
......
......@@ -361,6 +361,8 @@
<string name="signature_name">请先签名!</string>
<string name="click_and_signature">点击此处让客户去签名</string>
<string name="download_gaode_notice">您还未安装高德地图~</string>
<string name="sop_title">标准操作规范SOP~</string>
<string name="process_notice">温馨提示:点击屏幕底部“提交验收”按钮,申请费用。</string>
<!--消息-->
<string name="message_system">系统通知</string>
......@@ -629,5 +631,7 @@ C) 在甲方使用大鱼平å°æœåŠ¡è¿‡ç¨‹ä¸­äº§ç”Ÿçš„业务数æ®ï¼Œå®¢æˆ·æ•°æ
<string name="input_new_pwd_again">再次输入新的密码</string>
<string name="sms_code">验证码:</string>
<string name="skip">跳过</string>
<string name="turn_on_flashlight">打开闪光灯</string>
<string name="turn_off_flashlight">关闭闪光灯</string>
</resources>
......@@ -2,11 +2,11 @@
buildscript {
ext.compile_sdk_version = 27
ext.build_tools_version = "27.0.2"
ext.build_tools_version = "27.0.3"
ext.min_sdk_version = 16
ext.target_sdk_version = 23
ext.version_code = 14
ext.verson_name = "1.9.1"
ext.version_code = 15
ext.verson_name = "1.9.2"
ext.gradle_version = '3.0.1'
ext.isReleaseMinify = true
ext.isDebugMinify = true
......
package com.dayu.location.base;
import android.annotation.SuppressLint;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
......@@ -20,12 +21,12 @@ import java.io.File;
*/
public class LocationUtils {
@SuppressLint("StaticFieldLeak")
private static AMapLocationClient mlocationClient;
private static AMapLocation sLocation = null;
private static boolean flag = true;
private static MyLocationListener mListener;
private static Handler mHandler;
private static OpenMarketListener marketListener;
/**
* @param context
......@@ -87,9 +88,11 @@ public class LocationUtils {
@Override
public void run() {
if (flag) {
mListener.result(sLocation);
flag = false;
mlocationClient.stopLocation();
if (mListener != null) {
mListener.result(sLocation);
flag = false;
mlocationClient.stopLocation();
}
}
}
}, 8000);
......@@ -98,7 +101,7 @@ public class LocationUtils {
@Override
public void onLocationChanged(AMapLocation location) {
if (location != null && location.getErrorCode() == 0 && flag) {
if (mListener != null && location != null && location.getErrorCode() == 0 && flag) {
flag = false;
mlocationClient.stopLocation();
sLocation = location;
......
......@@ -25,7 +25,7 @@ import okhttp3.RequestBody;
* on 2017/11/8.
*/
public class messagePresenter extends messageContract.Presenter {
public ObservableField data = new ObservableField<>();
public ObservableField<Object> data = new ObservableField<>();
private String mHxId;
private int mPage;
private int mCategory;
......
......@@ -85,7 +85,6 @@ public class MultipleProcessPresenter extends MultipleProcessContract.Presenter
} else {
commitePhoto();
}
}
}
......@@ -189,7 +188,9 @@ public class MultipleProcessPresenter extends MultipleProcessContract.Presenter
} else if (2 == (detail.getRepairType())) {
mRepairType = UIUtils.getString(R.string.payer_baowai);
}
mView.setRepairType();
if (mOrderType!=1){
mView.setRepairType();
}
mNeedEsignature = detail.getNeedEsignature();
if (mNeedEsignature != null && mNeedEsignature == 1) {
mView.showSignature();
......
......@@ -169,9 +169,9 @@ public class ProcessOrderPresenter extends ProcessOrderContract.Presenter {
params.put("servicePriceComment", "");
// params.put("categoryName")
params.put("brandName", brandName);
params.put("productModel", productModel);
params.put("sn", sn);
// params.put("brandName", brandName);
// params.put("productModel", productModel);
// params.put("sn", sn);
params.put("repairType", repairType);
//照片上传
if (imageUrl != null) {
......
......@@ -22,8 +22,8 @@ import java.util.List;
* on 2017/11/8.
*/
public class OrderRecordPresenter extends OrderRecordContract.Presenter {
public ObservableField datas = new ObservableField();
public ObservableField<String> serchStr = new ObservableField();
private ObservableField<Object> datas = new ObservableField<>();
public ObservableField<String> serchStr = new ObservableField<>();
private int mPage;
private int mUserId;
private int mSiteId;
......@@ -88,7 +88,7 @@ public class OrderRecordPresenter extends OrderRecordContract.Presenter {
MobclickAgent.onEvent(BaseApplication.getContext(), "check_order_detail");
}
public void doSearch(String str) {
private void doSearch(String str) {
if (mList == null || TextUtils.isEmpty(str)) {
return;
}
......
package com.dayu.order.ui.activity;
import android.app.Activity;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.widget.Button;
import com.dayu.order.R;
import com.journeyapps.barcodescanner.CaptureManager;
import com.journeyapps.barcodescanner.DecoratedBarcodeView;
/**
* Custom Scannner Activity extending from Activity to display a custom layout form scanner view.
*/
public class CustomScannerActivity extends Activity implements
DecoratedBarcodeView.TorchListener {
private CaptureManager capture;
private DecoratedBarcodeView barcodeScannerView;
private Button switchFlashlightButton;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_custom_scanner);
barcodeScannerView = (DecoratedBarcodeView) findViewById(R.id.zxing_barcode_scanner);
barcodeScannerView.setTorchListener(this);
switchFlashlightButton = (Button) findViewById(R.id.switch_flashlight);
// if the device does not have flashlight in its camera,
// then remove the switch flashlight button...
if (!hasFlash()) {
switchFlashlightButton.setVisibility(View.GONE);
}
capture = new CaptureManager(this, barcodeScannerView);
capture.initializeFromIntent(getIntent(), savedInstanceState);
capture.decode();
}
@Override
protected void onResume() {
super.onResume();
capture.onResume();
}
@Override
protected void onPause() {
super.onPause();
capture.onPause();
}
@Override
protected void onDestroy() {
super.onDestroy();
capture.onDestroy();
}
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
capture.onSaveInstanceState(outState);
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
return barcodeScannerView.onKeyDown(keyCode, event) || super.onKeyDown(keyCode, event);
}
/**
* Check if the device's camera has a Flashlight.
*
* @return true if there is Flashlight, otherwise false.
*/
private boolean hasFlash() {
return getApplicationContext().getPackageManager()
.hasSystemFeature(PackageManager.FEATURE_CAMERA_FLASH);
}
public void switchFlashlight(View view) {
if (getString(R.string.turn_on_flashlight).equals(switchFlashlightButton.getText())) {
barcodeScannerView.setTorchOn();
} else {
barcodeScannerView.setTorchOff();
}
}
@Override
public void onTorchOn() {
switchFlashlightButton.setText(getString(R.string.turn_off_flashlight));
}
@Override
public void onTorchOff() {
switchFlashlightButton.setText(getString(R.string.turn_on_flashlight));
}
}
......@@ -17,6 +17,8 @@ import com.dayu.order.presenter.multiprocessorder.MultiProcessOrderContract;
import com.dayu.order.presenter.multiprocessorder.MultiProcessOrderPresenter;
import com.dayu.utils.GlideImageLoader;
import com.dayu.utils.UtilsScreen;
import com.google.zxing.integration.android.IntentIntegrator;
import com.google.zxing.integration.android.IntentResult;
import com.luck.picture.lib.PictureSelectionModel;
import com.luck.picture.lib.PictureSelector;
import com.luck.picture.lib.config.PictureConfig;
......@@ -69,6 +71,8 @@ public class MultiProcessOrderActivity extends BaseActivity<MultiProcessOrderPre
mBind.ivDelete.setVisibility(View.GONE);
mSnImages.clear();
});
mBind.scan.setOnClickListener(v ->
new IntentIntegrator(this).setOrientationLocked(false).setCaptureActivity(CustomScannerActivity.class).initiateScan());
}
@Override
......@@ -176,6 +180,15 @@ public class MultiProcessOrderActivity extends BaseActivity<MultiProcessOrderPre
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
IntentResult result = IntentIntegrator.parseActivityResult(requestCode, resultCode, data);
if (result != null && requestCode == IntentIntegrator.REQUEST_CODE) {
if (result.getContents() == null) {
// toast = "Cancelled from fragment";
} else {
mBind.etSerialNum.setText(result.getContents());
}
return;
}
if (resultCode == RESULT_OK) {
switch (requestCode) {
case PictureConfig.CHOOSE_REQUEST:
......
......@@ -76,4 +76,5 @@ public class OrderRecordActivity extends BaseActivity<OrderRecordPresenter, Acti
public OrderAdapter getAdapter() {
return mAdapter;
}
}
......@@ -115,7 +115,10 @@ public class ProcessOrderActivity extends BaseActivity<ProcessOrderPresenter, Ac
}
public String getSum() {
return new DecimalFormat("0.00").format(parseDb(mBind.etDoorPrice.getText().toString()) + parseDb(mBind.etServePrice.getText().toString()) + parseDb(mBind.etMaterialsPrice.getText().toString()) + parseDb(mBind.etOtherPrice.getText().toString()));
return new DecimalFormat("0.00").format(parseDb(mBind.etDoorPrice.getText().toString())
+ parseDb(mBind.etServePrice.getText().toString())
+ parseDb(mBind.etMaterialsPrice.getText().toString())
+ parseDb(mBind.etOtherPrice.getText().toString()));
}
public Double parseDb(String str) {
......@@ -250,10 +253,8 @@ public class ProcessOrderActivity extends BaseActivity<ProcessOrderPresenter, Ac
info.setProductModel(mBind.etVersion.getText().toString());
info.setSn(mBind.etSerialNum.getText().toString());
mPresenter.mOrderField.set(info);
}
private void dumpPic(ArrayList<String> list) {
Intent intent = new Intent(this, PreviewActivty.class);
intent.putStringArrayListExtra(Constants.BUNDLE_KEY_ID, list);
......
......@@ -2,6 +2,9 @@ package com.dayu.order.ui.activity;
import android.content.Intent;
import android.os.Bundle;
import android.text.SpannableString;
import android.text.Spanned;
import android.text.style.ForegroundColorSpan;
import com.dayu.base.ui.activity.BaseActivity;
import com.dayu.common.Constants;
......@@ -35,6 +38,9 @@ public class ServerInfoActivity extends BaseActivity<ServerInfoPresenter, Activi
@Override
public void initView() {
mBind.tvTitle.setText(getString(R.string.task_list));
SpannableString spannableString = new SpannableString(getString(R.string.process_notice));
spannableString.setSpan(new ForegroundColorSpan(getResources().getColor(R.color.bg_button)), 0, 5, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
mBind.notice.setText(spannableString);
ServerInfoAdapter adapter = new ServerInfoAdapter(false);
mBind.recyclerView.setAdapter(adapter);
mBind.tvProcess.setOnClickListener(v -> {
......
......@@ -2,6 +2,9 @@ package com.dayu.order.ui.activity;
import android.content.Intent;
import android.os.Bundle;
import android.text.SpannableString;
import android.text.Spanned;
import android.text.style.ForegroundColorSpan;
import com.dayu.base.ui.activity.BaseActivity;
import com.dayu.common.Constants;
......@@ -36,8 +39,9 @@ public class ServerListActivity extends BaseActivity<ServerListPresenter, Activi
@Override
public void initView() {
mBind.tvTitle.setText(getString(R.string.task_list));
mBind.tvProcess.setOnClickListener(o -> {
});
SpannableString spannableString = new SpannableString(getString(R.string.process_notice));
spannableString.setSpan(new ForegroundColorSpan(getResources().getColor(R.color.bg_button)), 0, 5, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
mBind.notice.setText(spannableString);
mBind.recyclerView.setOnItemClickListener(new OnItemClickListener<Spu, ActivityServerListBinding>() {
@Override
public void OnItemClick(Spu item, ActivityServerListBinding bind) {
......
......@@ -21,11 +21,15 @@ import com.dayu.order.api.protocol.Spu;
import com.dayu.order.common.OrderConstant;
import com.dayu.provider.event.OrderState;
import com.dayu.utils.ProgressUtil;
import com.dayu.utils.SelectPicUtils;
import com.dayu.utils.ToastUtils;
import com.dayu.utils.UserManager;
import com.github.lzyzsd.jsbridge.BridgeHandler;
import com.github.lzyzsd.jsbridge.BridgeWebView;
import com.github.lzyzsd.jsbridge.CallBackFunction;
import com.luck.picture.lib.PictureSelector;
import com.luck.picture.lib.config.PictureConfig;
import com.luck.picture.lib.entity.LocalMedia;
import org.greenrobot.eventbus.EventBus;
import org.json.JSONException;
......@@ -33,6 +37,7 @@ import org.json.JSONObject;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import static com.dayu.order.common.OrderConstant.ORDER_SOP_FINISH;
......@@ -77,7 +82,7 @@ public class SopWebViewActivity extends DataBindingActivity<ActivityWebviewBindi
mWebView.setLayoutParams(new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT));
mBind.llWeb.addView(mWebView);
mBind.tvTitle.setText("SOP");
mBind.tvTitle.setText(getString(R.string.sop_title));
initWebView();
}
......@@ -128,12 +133,14 @@ public class SopWebViewActivity extends DataBindingActivity<ActivityWebviewBindi
}
public void openFileChooser(ValueCallback<Uri> uploadMsg) {
openFileChooserImpl(uploadMsg);
mUploadMessage = uploadMsg;
SelectPicUtils.selectPic(mActivity, 1);
}
@Override
public boolean onShowFileChooser(WebView webView, ValueCallback<Uri[]> uploadMsg, FileChooserParams fileChooserParams) {
openFileChooserImplForAndroid5(uploadMsg);
uploadMessageAboveL = uploadMsg;
SelectPicUtils.selectPic(mActivity, 1);
return true;
}
......@@ -153,12 +160,10 @@ public class SopWebViewActivity extends DataBindingActivity<ActivityWebviewBindi
} else {
mWebView.loadUrl(Constants.WEB_SOP_DETAIL);
}
} else {
mWebView.loadUrl(Constants.WEB_SOP);
}
JSONObject jsonObject = new JSONObject();
try {
jsonObject.put("id", mOrderId);
......@@ -236,20 +241,48 @@ public class SopWebViewActivity extends DataBindingActivity<ActivityWebviewBindi
}
/**
* 取消mFilePathCallback回调
*/
private void cancelFilePathCallback() {
if (uploadMessageAboveL != null) {
uploadMessageAboveL.onReceiveValue(null);
uploadMessageAboveL = null;
} else if (mUploadMessage != null) {
mUploadMessage.onReceiveValue(null);
mUploadMessage = null;
}
}
/**
* 上传文件回调
*/
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
if (requestCode == RESULT_CODE) {
onActivityResultBelowL(intent, resultCode);
} else if (requestCode == RESULT_CODE_FOR_Lollipop) {
onActivityResultAboveL(intent, resultCode);
// if (requestCode == RESULT_CODE) {
// onActivityResultBelowL(intent, resultCode);
// } else if (requestCode == RESULT_CODE_FOR_Lollipop) {
// onActivityResultAboveL(intent, resultCode);
// }
if (resultCode == RESULT_OK && requestCode == PictureConfig.CHOOSE_REQUEST) {
List<LocalMedia> list = PictureSelector.obtainMultipleResult(intent);
Uri uri = null;
if (list != null) {
uri = Uri.fromFile(new File(list.get(0).getCompressPath()));
}
if (uploadMessageAboveL != null) {
uploadMessageAboveL.onReceiveValue(new Uri[]{uri});
} else if (mUploadMessage != null) {
mUploadMessage.onReceiveValue(uri);
}
} else {
cancelFilePathCallback();
}
}
/**
* 5.0 L 以下 上传图片成功后的回调
*/
public void onActivityResultBelowL(Intent intent, int resultCode) {
if (null == mUploadMessage)
return;
......
......@@ -90,6 +90,13 @@ public class MultiOrderDetailFragment extends DataBindingFragment<FragmentMultiD
}
}
});
mBind.orderRemark.post(() -> {
if (UIUtils.isOverFlowed(mBind.orderRemark)) {
mBind.tvLookMore.setVisibility(View.VISIBLE);
} else {
mBind.tvLookMore.setVisibility(View.GONE);
}
});
mBind.tvOrderState.setText(getStaus(detail.getStatus()));
mBind.tvLookMore.setOnClickListener(o -> lookMore());
......
......@@ -77,5 +77,8 @@
<activity
android:name=".ui.activity.OrderLivenessActivity"
android:screenOrientation="portrait" />
<activity
android:name=".ui.activity.CustomScannerActivity"
android:screenOrientation="portrait" />
</application>
</manifest>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.journeyapps.barcodescanner.DecoratedBarcodeView
android:id="@+id/zxing_barcode_scanner"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:zxing_scanner_layout="@layout/custom_barcode_scanner">
</com.journeyapps.barcodescanner.DecoratedBarcodeView>
<Button
android:id="@+id/switch_flashlight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/turn_on_flashlight"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:onClick="switchFlashlight"/>
</RelativeLayout>
\ No newline at end of file
......@@ -5,7 +5,8 @@
<import type="android.view.View" />
<import type="android.text.TextUtils"/>
<import type="android.text.TextUtils" />
<variable
name="presenter"
......@@ -144,8 +145,8 @@
android:layout_marginLeft="90dp"
android:layout_toRightOf="@id/text_two_text"
android:background="@null"
android:maxLength="50"
android:hint="@string/order_brand_name"
android:maxEms="50"
android:text="@={presenter.mBrandName}"
android:textColor="@color/default_text_color"
android:textSize="@dimen/sp_15" />
......@@ -191,18 +192,19 @@
style="@style/line"
android:layout_below="@id/rl_verion" />
<RelativeLayout
<LinearLayout
android:id="@+id/rl_serial_num"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_54"
android:layout_below="@id/line_version"
android:background="@color/cl_white">
android:background="@color/cl_white"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_serial_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/dp_13"
android:text="@string/order_serail"
android:textColor="@color/cl_home_title_text_color"
......@@ -211,8 +213,6 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="@id/tv_serial_num"
android:text="*"
android:textColor="#F74848"
android:textSize="@dimen/sp_15"
......@@ -220,18 +220,24 @@
<EditText
android:id="@+id/et_serial_num"
android:layout_width="match_parent"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="75dp"
android:layout_toRightOf="@id/tv_serial_num"
android:layout_marginLeft="76dp"
android:layout_weight="1"
android:background="@null"
android:maxLength="50"
android:hint="@string/order_serail_hint"
android:maxEms="50"
android:text="@={presenter.mSn}"
android:textColor="@color/default_text_color"
android:textSize="@dimen/sp_15" />
</RelativeLayout>
<ImageView
android:id="@+id/scan"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="15dp"
android:src="@drawable/icon_scan" />
</LinearLayout>
<ImageView
android:id="@+id/line_serial"
......@@ -306,9 +312,9 @@
android:background="@drawable/subscribe_time_shape"
android:gravity="top"
android:hint="@string/order_hint"
android:maxEms="200"
android:paddingLeft="@dimen/dp_13"
android:paddingTop="@dimen/dp_11"
android:maxLength="200"
android:text="@={presenter.mInfo}"
android:textColor="@color/cl_home_title_text_color"
android:textColorHint="@color/cl_selector_hui"
......@@ -371,8 +377,8 @@
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="10dp"
android:layout_marginTop="350dp"
android:background="@drawable/tab_blue_react"
android:gravity="center"
android:onClick="@{()->presenter.dumpToServerInstruction()}"
......
......@@ -43,12 +43,24 @@
style="@style/card_line"
android:layout_below="@+id/title_back" />
<TextView
android:id="@+id/notice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/line"
android:layout_marginBottom="13dp"
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginTop="13dp"
android:textColor="@color/default_text_color"
android:textSize="12sp"
android:visibility="@{presenter.mCanProcess==2?View.VISIBLE:View.GONE}" />
<com.dayu.widgets.LRecyclerView
android:id="@+id/recyclerView"
setPresenter="@{presenter}"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/line"
android:layout_below="@+id/notice"
android:layout_marginBottom="@dimen/dp_50"
app:headType="@layout/recycler_server_info_header"
app:itemType="@layout/item_server_info" />
......
......@@ -39,21 +39,32 @@
android:onClick="@{()->presenter.callPhone()}"
android:text="@string/company_mobile"
android:textColor="#3faafc"
android:visibility="@{presenter.mIsShowPhone?View.VISIBLE:View.GONE}"
android:textSize="@dimen/dp_13.3" />
android:textSize="@dimen/dp_13.3"
android:visibility="@{presenter.mIsShowPhone?View.VISIBLE:View.GONE}" />
</RelativeLayout>
<ImageView style="@style/card_line" />
<TextView
android:id="@+id/notice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="13dp"
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginTop="13dp"
android:textColor="@color/default_text_color"
android:textSize="12sp"
android:visibility='@{(presenter.mCanProcess &amp;&amp; presenter.mIsShowProcess)?View.VISIBLE:View.GONE}' />
<com.dayu.widgets.LRecyclerView
android:id="@+id/recyclerView"
setPresenter="@{presenter}"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="50dp"
android:background="#f5f5f5"
app:itemType="@layout/activity_server_list"
app:needCoreAdapter="true"
android:layout_marginBottom="50dp"
app:needFoot="false" />
</LinearLayout>
......@@ -64,8 +75,8 @@
android:layout_alignParentBottom="true"
android:background='@{presenter.mCanProcess?@color/bg_button:@color/cl_selector_hui}'
android:clickable='@{presenter.mCanProcess?true:false}'
android:onClick="@{()->presenter.dumpToProcess()}"
android:gravity="center"
android:onClick="@{()->presenter.dumpToProcess()}"
android:text="@string/submit_order"
android:textColor="@color/white"
android:visibility="@{presenter.mIsShowProcess?View.VISIBLE:View.GONE}" />
......
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto">
<com.journeyapps.barcodescanner.BarcodeView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/zxing_barcode_surface"
app:zxing_framing_rect_width="250dp"
app:zxing_framing_rect_height="150dp"/>
<com.journeyapps.barcodescanner.ViewfinderView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/zxing_viewfinder_view"
app:zxing_possible_result_points="@color/zxing_custom_possible_result_points"
app:zxing_result_view="@color/zxing_custom_result_view"
app:zxing_viewfinder_laser="@color/zxing_custom_viewfinder_laser"
app:zxing_viewfinder_mask="@color/zxing_custom_viewfinder_mask"/>
<TextView
android:id="@+id/zxing_status_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|center_horizontal"
android:background="@color/zxing_transparent"
android:text="@string/zxing_msg_default_status"
android:textColor="@color/zxing_status_text"/>
</merge>
......@@ -179,7 +179,7 @@
android:id="@+id/tv_fujian"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_remark"
android:layout_below="@+id/rl_info_detail"
android:layout_marginBottom="10dp"
android:layout_marginTop="15dp"
android:text="@string/order_attachment"
......@@ -190,7 +190,7 @@
android:id="@+id/ll_fujian"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_remark"
android:layout_below="@+id/rl_info_detail"
android:layout_marginBottom="10dp"
android:layout_marginLeft="19dp"
android:layout_marginTop="@dimen/dp_15"
......@@ -411,7 +411,7 @@
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginTop="@dimen/dp_15"
android:text="@{item.repairType == 1?@string/honai:@string/warranty}"
android:text="@{item.repairType == 1?@string/payer_baonei:@string/payer_baowai}"
android:textColor="@color/cl_home_title_text_color"
android:textSize="14sp" />
</LinearLayout>
......
......@@ -493,36 +493,13 @@
android:textColor="@color/cl_home_title_text_color"
android:textSize="@dimen/sp_13.3" />
<TextView
android:id="@+id/three_four_four"
android:id="@+id/tv_sn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/three_two_two"
android:layout_marginLeft="@dimen/dp_13"
android:layout_marginTop="@dimen/dp_13"
android:text="@string/quality_assurance_info"
android:textColor="@color/cl_order_text_one"
android:textSize="@dimen/sp_13.3" />
<TextView
android:id="@+id/tv_warranty_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/tv_model"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginTop="@dimen/dp_13"
android:layout_toRightOf="@id/three_four_four"
android:text="@{item.repairType == 1?@string/honai:@string/warranty}"
android:textColor="@color/cl_home_title_text_color"
android:textSize="@dimen/sp_13.3" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/three_four_four"
android:layout_marginLeft="@dimen/dp_13"
android:layout_marginTop="@dimen/dp_13"
android:text="@string/sn_num"
android:textColor="@color/cl_order_text_one"
android:textSize="@dimen/sp_13.3" />
......@@ -531,10 +508,10 @@
android:id="@+id/tv_sn_code"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/three_four_four"
android:layout_below="@id/three_two_two"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginTop="@dimen/dp_13"
android:layout_toRightOf="@id/three_four_four"
android:layout_toRightOf="@id/tv_sn"
android:text='@{!TextUtils.isEmpty(item.sn)?item.sn:@string/no_data}'
android:textColor="@color/cl_home_title_text_color"
android:textSize="@dimen/sp_13.3" />
......
......@@ -40,7 +40,7 @@
android:layout_gravity="center"
android:layout_marginTop="@dimen/dp_15"
android:text="@string/scan_code_for_appointment"
android:textSize="14sp" />
android:textSize="15sp" />
<TextView
android:id="@+id/notice"
......@@ -49,7 +49,7 @@
android:layout_gravity="center"
android:layout_marginTop="@dimen/dp_15"
android:text="@string/scan_code_for_appointment_two"
android:textSize="14sp" />
android:textSize="15sp" />
</LinearLayout>
</LinearLayout>
......
......@@ -26,15 +26,14 @@ import com.hyphenate.chat.EMClient;
* on 2017/11/8.
*/
public class PwLoginPresenter extends PwLoginContract.Presenter {
private String mPhone;
public ObservableField<String> phoneNume = new ObservableField<>();
public ObservableField<String> code = new ObservableField<>();
@Override
public void onAttached() {
Bundle bundle = mView.getBundle();
mPhone = bundle.getString(UserConstant.PHONE);
phoneNume.set(mPhone);
String phone = bundle.getString(UserConstant.PHONE);
phoneNume.set(phone);
}
@Override
......@@ -49,8 +48,8 @@ public class PwLoginPresenter extends PwLoginContract.Presenter {
loginHx(userInfo.getHxAccount(), userInfo.getHxPwd());
dumpAndSave(userInfo);
} else if (userInfo.getDetectStatus() == 2 || userInfo.getDetectStatus() == 3) {
showLoginDialog(userInfo);
UserManager.getInstance().saveUser(userInfo);
showLoginDialog(userInfo);
} else {
ToastUtils.showShortToast(UIUtils.getString(R.string.login_faile));
}
......
......@@ -59,8 +59,8 @@ public class SmsLoginPresenter extends SmsLoginContract.Presenter {
loginHx(userInfo.getHxAccount(), userInfo.getHxPwd());
dumpAndSave(userInfo);
} else if (userInfo.getDetectStatus() == 2 || userInfo.getDetectStatus() == 3) {
showLoginDialog(userInfo);
UserManager.getInstance().saveUser(userInfo);
showLoginDialog(userInfo);
} else {
ToastUtils.showShortToast(UIUtils.getString(R.string.login_faile));
}
......
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 sign in to comment