|
|
@@ -5,6 +5,8 @@ import android.content.BroadcastReceiver;
|
|
|
import android.content.Context;
|
|
|
import android.content.Intent;
|
|
|
import android.content.IntentFilter;
|
|
|
+import android.graphics.Bitmap;
|
|
|
+import android.graphics.drawable.BitmapDrawable;
|
|
|
import android.os.Bundle;
|
|
|
import android.os.Handler;
|
|
|
import android.os.Message;
|
|
|
@@ -21,10 +23,11 @@ import android.widget.TextView;
|
|
|
import com.afollestad.materialdialogs.GravityEnum;
|
|
|
import com.afollestad.materialdialogs.MaterialDialog;
|
|
|
import com.lidroid.xutils.view.annotation.ViewInject;
|
|
|
-//import com.tencent.bugly.crashreport.CrashReport;
|
|
|
import com.uuzuche.lib_zxing.activity.CaptureActivity;
|
|
|
+import com.uuzuche.lib_zxing.activity.CodeUtils;
|
|
|
import com.xzjmyk.pm.activity.AppConstant;
|
|
|
import com.xzjmyk.pm.activity.CaptureResultActivity;
|
|
|
+import com.xzjmyk.pm.activity.CommonWebviewActivity;
|
|
|
import com.xzjmyk.pm.activity.MyApplication;
|
|
|
import com.xzjmyk.pm.activity.R;
|
|
|
import com.xzjmyk.pm.activity.broadcast.MsgBroadcast;
|
|
|
@@ -48,6 +51,8 @@ import java.util.LinkedHashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
+//import com.tencent.bugly.crashreport.CrashReport;
|
|
|
+
|
|
|
public class MeFragment extends EasyFragment implements View.OnClickListener {
|
|
|
|
|
|
private static final int REQUEST_CODE = 11;
|
|
|
@@ -318,10 +323,32 @@ public class MeFragment extends EasyFragment implements View.OnClickListener {
|
|
|
ImageView imageView = new ImageView(getActivity());
|
|
|
imageView.setImageResource(R.drawable.ic_uu_scan_code);
|
|
|
MaterialDialog materialDialog = new MaterialDialog.Builder(getActivity())
|
|
|
- .title("UU互联最新版二维码")
|
|
|
+ .title("UU互联最新版二维码\n长按可识别")
|
|
|
.customView(imageView, false)
|
|
|
.titleGravity(GravityEnum.CENTER)
|
|
|
.show();
|
|
|
+ final Bitmap bitmap = ((BitmapDrawable)imageView.getDrawable()).getBitmap();
|
|
|
+ imageView.setOnLongClickListener(new View.OnLongClickListener() {
|
|
|
+ @Override
|
|
|
+ public boolean onLongClick(View v) {
|
|
|
+ CodeUtils.analyzeBitmap(bitmap, new CodeUtils.AnalyzeCallback() {
|
|
|
+ @Override
|
|
|
+ public void onAnalyzeSuccess(Bitmap mBitmap, String result) {
|
|
|
+ Intent intent = new Intent();
|
|
|
+ intent.setClass(getActivity(), CommonWebviewActivity.class);
|
|
|
+ intent.putExtra("scan_url", result);
|
|
|
+ Log.d("image_url",result);
|
|
|
+ startActivity(intent);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onAnalyzeFailed() {
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
|