Java Code Examples for com.google.zxing.client.result.URIParsedResult#getURI()

The following examples show how to use com.google.zxing.client.result.URIParsedResult#getURI() . 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: URIResultHandler.java    From ZXing-Standalone-library with Apache License 2.0 6 votes vote down vote up
@Override
public void handleButtonPress(int index) {
  URIParsedResult uriResult = (URIParsedResult) getResult();
  String uri = uriResult.getURI();
  switch (index) {
    case 0:
      openURL(uri);
      break;
    case 1:
      shareByEmail(uri);
      break;
    case 2:
      shareBySMS(uri);
      break;
    case 3:
      searchBookContents(uri);
      break;
  }
}
 
Example 2
Source File: URIResultHandler.java    From analyzer-of-android-for-Apache-Weex with Apache License 2.0 6 votes vote down vote up
@Override
public void handleButtonPress(int index) {
  URIParsedResult uriResult = (URIParsedResult) getResult();
  String uri = uriResult.getURI();
  switch (index) {
    case 0:
      openURL(uri);
      break;
    case 1:
      shareByEmail(uri);
      break;
    case 2:
      shareBySMS(uri);
      break;
    case 3:
      searchBookContents(uri);
      break;
  }
}
 
Example 3
Source File: URIResultHandler.java    From weex with Apache License 2.0 6 votes vote down vote up
@Override
public void handleButtonPress(int index) {
  URIParsedResult uriResult = (URIParsedResult) getResult();
  String uri = uriResult.getURI();
  switch (index) {
    case 0:
      openURL(uri);
      break;
    case 1:
      shareByEmail(uri);
      break;
    case 2:
      shareBySMS(uri);
      break;
    case 3:
      searchBookContents(uri);
      break;
  }
}
 
Example 4
Source File: URIResultHandler.java    From Study_Android_Demo with Apache License 2.0 6 votes vote down vote up
@Override
public void handleButtonPress(int index) {
  URIParsedResult uriResult = (URIParsedResult) getResult();
  String uri = uriResult.getURI();
  switch (index) {
    case 0:
      openURL(uri);
      break;
    case 1:
      shareByEmail(uri);
      break;
    case 2:
      shareBySMS(uri);
      break;
    case 3:
      searchBookContents(uri);
      break;
  }
}
 
Example 5
Source File: URIResultHandler.java    From zxingfragmentlib with Apache License 2.0 6 votes vote down vote up
@Override
public void handleButtonPress(int index) {
  URIParsedResult uriResult = (URIParsedResult) getResult();
  String uri = uriResult.getURI();
  switch (index) {
    case 0:
      openURL(uri);
      break;
    case 1:
      shareByEmail(uri);
      break;
    case 2:
      shareBySMS(uri);
      break;
    case 3:
      searchBookContents(uri);
      break;
  }
}
 
Example 6
Source File: URIResultHandler.java    From android-apps with MIT License 6 votes vote down vote up
@Override
public void handleButtonPress(int index) {
  URIParsedResult uriResult = (URIParsedResult) getResult();
  String uri = uriResult.getURI();
  switch (index) {
    case 0:
      openURL(uri);
      break;
    case 1:
      shareByEmail(uri);
      break;
    case 2:
      shareBySMS(uri);
      break;
    case 3:
      searchBookContents(uri);
      break;
  }
}
 
Example 7
Source File: URIResultHandler.java    From barcodescanner-lib-aar with MIT License 6 votes vote down vote up
@Override
public void handleButtonPress(int index) {
  URIParsedResult uriResult = (URIParsedResult) getResult();
  String uri = uriResult.getURI();
  switch (index) {
    case 0:
      openURL(uri);
      break;
    case 1:
      shareByEmail(uri);
      break;
    case 2:
      shareBySMS(uri);
      break;
    case 3:
      searchBookContents(uri);
      break;
  }
}
 
Example 8
Source File: URIResultHandler.java    From reacteu-app with MIT License 6 votes vote down vote up
@Override
public void handleButtonPress(int index) {
  URIParsedResult uriResult = (URIParsedResult) getResult();
  String uri = uriResult.getURI();
  switch (index) {
    case 0:
      openURL(uri);
      break;
    case 1:
      shareByEmail(uri);
      break;
    case 2:
      shareBySMS(uri);
      break;
    case 3:
      searchBookContents(uri);
      break;
  }
}
 
Example 9
Source File: TitleRetriever.java    From ZXing-Standalone-library with Apache License 2.0 4 votes vote down vote up
TitleRetriever(TextView textView, URIParsedResult result, HistoryManager historyManager) {
  super(textView, historyManager);
  this.httpUrl = result.getURI();
}
 
Example 10
Source File: TitleRetriever.java    From BarcodeEye with Apache License 2.0 4 votes vote down vote up
TitleRetriever(TextView textView, URIParsedResult result) {
  super(textView);
  this.httpUrl = result.getURI();
}
 
Example 11
Source File: TitleRetriever.java    From zxingfragmentlib with Apache License 2.0 4 votes vote down vote up
TitleRetriever(TextView textView, URIParsedResult result, HistoryManager historyManager) {
  super(textView, historyManager);
  this.httpUrl = result.getURI();
}
 
Example 12
Source File: TitleRetriever.java    From reacteu-app with MIT License 4 votes vote down vote up
TitleRetriever(TextView textView, URIParsedResult result, HistoryManager historyManager) {
  super(textView, historyManager);
  this.httpUrl = result.getURI();
}
 
Example 13
Source File: TitleRetriever.java    From barcodescanner-lib-aar with MIT License 4 votes vote down vote up
TitleRetriever(TextView textView, URIParsedResult result, HistoryManager historyManager) {
  super(textView, historyManager);
  this.httpUrl = result.getURI();
}
 
Example 14
Source File: TitleRetriever.java    From Study_Android_Demo with Apache License 2.0 4 votes vote down vote up
TitleRetriever(TextView textView, URIParsedResult result, HistoryManager historyManager) {
  super(textView, historyManager);
  this.httpUrl = result.getURI();
}
 
Example 15
Source File: TitleRetriever.java    From weex with Apache License 2.0 4 votes vote down vote up
TitleRetriever(TextView textView, URIParsedResult result, HistoryManager historyManager) {
  super(textView, historyManager);
  this.httpUrl = result.getURI();
}
 
Example 16
Source File: TitleRetriever.java    From analyzer-of-android-for-Apache-Weex with Apache License 2.0 4 votes vote down vote up
TitleRetriever(TextView textView, URIParsedResult result, HistoryManager historyManager) {
  super(textView, historyManager);
  this.httpUrl = result.getURI();
}
 
Example 17
Source File: URLResultFragment.java    From privacy-friendly-qr-scanner with GNU General Public License v3.0 2 votes vote down vote up
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    super.onCreateView(inflater, container, savedInstanceState);

    View v = inflater.inflate(R.layout.fragment_result_url, container, false);

    result = (URIParsedResult) parsedResult;

    qrurl = result.getURI();
    final String qrurl2;

    TextView resultText = (TextView) v.findViewById(R.id.textDomain);
    TextView furtherInfo = (TextView) v.findViewById(R.id.textLink);
    furtherInfo.setMovementMethod(LinkMovementMethod.getInstance());

    qrurl2 = qrurl.replaceAll("\n", "");
    String domain = qrurl2;

    domain = domain.split("\n")[0];
    if(!domain.endsWith("/")) domain = domain + '/';

    Pattern pattern = Pattern.compile("([0-9a-zA-ZäöüÄÖÜß-]*.(co.uk|com.de|de.com|co.at|[a-z]{2,})/)");

    Matcher m = pattern.matcher(domain);
    if(m.find()) domain = m.group(1);

    if(domain.endsWith("/")) domain = domain.substring(0, domain.length()-1);

    int start = qrurl.indexOf(domain);
    int end = start + domain.length();

    Spannable WordtoSpan = new SpannableString(qrurl);
    WordtoSpan.setSpan(new ForegroundColorSpan(Color.BLACK), start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
    WordtoSpan.setSpan(new StyleSpan(android.graphics.Typeface.BOLD), start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);

    resultText.setText(WordtoSpan);

    // checked = trust = getBoolean("trust", false);

    final CheckBox knowDomain = (CheckBox) v.findViewById(R.id.checkBoxKnowRisks);

    // wenn bereits vertraut wurde, checkbox setzen
    if(trust)
        knowDomain.setChecked(true);

    knowDomain.setOnClickListener(v1 -> checked = knowDomain.isChecked());

    return v;
}