com.google.zxing.client.result.ParsedResultType Java Examples

The following examples show how to use com.google.zxing.client.result.ParsedResultType. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: WalletCodeDialog.java    From PocketEOS-Android with GNU Lesser General Public License v3.0 6 votes vote down vote up
public WalletCodeDialog setContent(String walletcode) {
    //生成的账号二维码包含的信息
    Resources res = context.getResources();
    Bitmap bmp = BitmapFactory.decodeResource(res, R.mipmap.ic_launcher_round);
    Bitmap bitmap = new QREncode.Builder(context)
            .setColor(context.getResources().getColor(R.color.title_color))//二维码颜色
            .setParsedResultType(ParsedResultType.TEXT)//默认是TEXT类型
            .setContents(walletcode)//二维码内容
            .setLogoBitmap(bmp)
            .setMargin(1)
            .setSize(1000)
            .build().encodeAsBitmap();
    if (bitmap != null) {
        walletCode.setImageBitmap(bitmap);
    }
    return this;
}
 
Example #2
Source File: MakeCollectionsDialog.java    From PocketEOS-Android with GNU Lesser General Public License v3.0 6 votes vote down vote up
public MakeCollectionsDialog setContent(String content, String icon_number, String icon_type) {
    iconType.setText("/ " + icon_type);
    iconNUmber.setText(icon_number);
    Resources res = context.getResources();
    Bitmap bmp = BitmapFactory.decodeResource(res, R.mipmap.ic_launcher_round);
    //生成的账号二维码包含的信息
    Bitmap bitmap = new QREncode.Builder(context)
            .setColor(context.getResources().getColor(R.color.title_color))//二维码颜色
            .setParsedResultType(ParsedResultType.TEXT)//默认是TEXT类型
            .setContents(content)//二维码内容
            .setLogoBitmap(bmp)
            .setSize(1000)
            .build().encodeAsBitmap();
    if (bitmap != null) {
        mImageView.setImageBitmap(bitmap);
    }
    return this;
}
 
Example #3
Source File: WSActivity.java    From AndroidWebServ with Apache License 2.0 6 votes vote down vote up
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (requestCode == REQ_CAPTURE) {
        if (resultCode == RESULT_OK) {
            String result = data.getStringExtra(Intents.Scan.RESULT);
            ParsedResultType type = ParsedResultType.values()[data.getIntExtra(
                    Intents.Scan.RESULT_TYPE, ParsedResultType.TEXT.ordinal())];
            boolean isShow = false;
            try {
                if (type == ParsedResultType.URI) {
                    toBrowserActivity(result);
                } else {
                    isShow = true;
                }
            } catch (ActivityNotFoundException e) {
                isShow = true;
            } finally {
                lastResult = result;
                if (isShow)
                    showDialog(DLG_SCAN_RESULT);
            }
        }
    } else {
        super.onActivityResult(requestCode, resultCode, data);
    }
}
 
Example #4
Source File: ResultHandlerFactory.java    From letv with Apache License 2.0 5 votes vote down vote up
public static ResultHandler makeResultHandler(SweepActivity activity, Result rawResult) {
    ParsedResult result = parseResult(rawResult);
    if (result.getType() == ParsedResultType.URI) {
        return new URIResultHandler(activity, result);
    }
    return new TextResultHandler(activity, result, rawResult);
}
 
Example #5
Source File: AccountDetailsActivity.java    From PocketEOS-Android with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
protected void initViews(Bundle savedInstanceState) {
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE);//当前页面防截屏录屏
    mIvSlideEnd = getId(R.id.iv_slide_end);
    mSlideToUnlock = getId(R.id.slide_to_unlock);


    mAccountInfoBean = getIntent().getParcelableExtra("bean");
    setCenterTitle(mAccountInfoBean.getAccount_name());

    mImgRight.setImageDrawable(getResources().getDrawable(R.mipmap.makecollectionshare));
    if (mAccountInfoBean.getIs_main_account().equals("1")) {
        mSwitchView.setClickable(false);
        mSwitchView.setChecked(true);
    } else {
        mSwitchView.setClickable(true);
        mSwitchView.setChecked(false);
    }
    QrCodeAccountBean qrCodeAccountBean = new QrCodeAccountBean();
    qrCodeAccountBean.setAccount_name(mAccountInfoBean.getAccount_name());
    qrCodeAccountBean.setAccount_img(mAccountInfoBean.getAccount_img());
    qrCodeAccountBean.setType("account_QRCode");
    //生成的账号二维码包含的信息
    Resources res = AccountDetailsActivity.this.getResources();
    Bitmap bmp = BitmapFactory.decodeResource(res, R.mipmap.ic_launcher_round);
    Bitmap bitmap = new QREncode.Builder(this)
            .setColor(AccountDetailsActivity.this.getResources().getColor(R.color.title_color))//二维码颜色
            .setParsedResultType(ParsedResultType.TEXT)//默认是TEXT类型
            .setContents(new Gson().toJson(qrCodeAccountBean))//二维码内容
            .setLogoBitmap(bmp)
            .setSize(1000)
            .build().encodeAsBitmap();
    if (bitmap != null) {
        mImgNumberCode.setImageBitmap(bitmap);
    }

    if (Utils.getSpUtils().getString("loginmode").equals("blackbox")) {
        mRell.setVisibility(View.GONE);
        setRightImg(false);
    } else {
        mRell.setVisibility(View.VISIBLE);
        setRightImg(true);
    }
}
 
Example #6
Source File: ResultHandler.java    From appinventor-extensions with Apache License 2.0 2 votes vote down vote up
/**
 * A convenience method to get the parsed type. Should not be overridden.
 *
 * @return The parsed type, e.g. URI or ISBN
 */
public final ParsedResultType getType() {
  return result.getType();
}
 
Example #7
Source File: ResultHandler.java    From ZXing-Standalone-library with Apache License 2.0 2 votes vote down vote up
/**
 * A convenience method to get the parsed type. Should not be overridden.
 *
 * @return The parsed type, e.g. URI or ISBN
 */
public final ParsedResultType getType() {
  return result.getType();
}
 
Example #8
Source File: ResultHandler.java    From analyzer-of-android-for-Apache-Weex with Apache License 2.0 2 votes vote down vote up
/**
 * A convenience method to get the parsed type. Should not be overridden.
 *
 * @return The parsed type, e.g. URI or ISBN
 */
public final ParsedResultType getType() {
  return result.getType();
}
 
Example #9
Source File: ResultHandler.java    From weex with Apache License 2.0 2 votes vote down vote up
/**
 * A convenience method to get the parsed type. Should not be overridden.
 *
 * @return The parsed type, e.g. URI or ISBN
 */
public final ParsedResultType getType() {
  return result.getType();
}
 
Example #10
Source File: ResultHandler.java    From Study_Android_Demo with Apache License 2.0 2 votes vote down vote up
/**
 * A convenience method to get the parsed type. Should not be overridden.
 *
 * @return The parsed type, e.g. URI or ISBN
 */
public final ParsedResultType getType() {
  return result.getType();
}
 
Example #11
Source File: ResultHandler.java    From barcodescanner-lib-aar with MIT License 2 votes vote down vote up
/**
 * A convenience method to get the parsed type. Should not be overridden.
 *
 * @return The parsed type, e.g. URI or ISBN
 */
public final ParsedResultType getType() {
  return result.getType();
}
 
Example #12
Source File: ResultHandler.java    From reacteu-app with MIT License 2 votes vote down vote up
/**
 * A convenience method to get the parsed type. Should not be overridden.
 *
 * @return The parsed type, e.g. URI or ISBN
 */
public final ParsedResultType getType() {
  return result.getType();
}
 
Example #13
Source File: ResultHandler.java    From android-apps with MIT License 2 votes vote down vote up
/**
 * A convenience method to get the parsed type. Should not be overridden.
 *
 * @return The parsed type, e.g. URI or ISBN
 */
public final ParsedResultType getType() {
  return result.getType();
}
 
Example #14
Source File: ResultHandler.java    From barterli_android with Apache License 2.0 2 votes vote down vote up
/**
 * A convenience method to get the parsed type. Should not be overridden.
 * 
 * @return The parsed type, e.g. URI or ISBN
 */
public final ParsedResultType getType() {
    return result.getType();
}
 
Example #15
Source File: ResultHandler.java    From android-quick-response-code with Apache License 2.0 2 votes vote down vote up
/**
 * A convenience method to get the parsed type. Should not be overridden.
 * 
 * @return The parsed type, e.g. URI or ISBN
 */
public final ParsedResultType getType() {
    return result.getType();
}
 
Example #16
Source File: ResultHandler.java    From zxingfragmentlib with Apache License 2.0 2 votes vote down vote up
/**
 * A convenience method to get the parsed type. Should not be overridden.
 *
 * @return The parsed type, e.g. URI or ISBN
 */
public final ParsedResultType getType() {
  return result.getType();
}