com.google.zxing.client.result.ISBNParsedResult#com.google.zxing.client.android.history.HistoryManager源码实例Demo

下面列出了com.google.zxing.client.result.ISBNParsedResult#com.google.zxing.client.android.history.HistoryManager 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

@Override
protected final void onPostExecute(Object arg) {
  TextView textView = textViewRef.get();
  if (textView != null) {
    for (CharSequence content : newContents) {
      textView.append(content);
    }
    textView.setMovementMethod(LinkMovementMethod.getInstance());
  }
  HistoryManager historyManager = historyManagerRef.get();
  if (historyManager != null) {
    for (String[] text : newHistories) {
      historyManager.addHistoryItemDetails(text[0], text[1]);
    }
  }
}
 
@Override
protected final void onPostExecute(Object arg) {
  TextView textView = textViewRef.get();
  if (textView != null) {
    for (CharSequence content : newContents) {
      textView.append(content);
    }
    textView.setMovementMethod(LinkMovementMethod.getInstance());
  }
  HistoryManager historyManager = historyManagerRef.get();
  if (historyManager != null) {
    for (String[] text : newHistories) {
      historyManager.addHistoryItemDetails(text[0], text[1]);
    }
  }
}
 
源代码3 项目: weex   文件: SupplementalInfoRetriever.java
@Override
protected final void onPostExecute(Object arg) {
  TextView textView = textViewRef.get();
  if (textView != null) {
    for (CharSequence content : newContents) {
      textView.append(content);
    }
    textView.setMovementMethod(LinkMovementMethod.getInstance());
  }
  HistoryManager historyManager = historyManagerRef.get();
  if (historyManager != null) {
    for (String[] text : newHistories) {
      historyManager.addHistoryItemDetails(text[0], text[1]);
    }
  }
}
 
@Override
protected final void onPostExecute(Object arg) {
  TextView textView = textViewRef.get();
  if (textView != null) {
    for (CharSequence content : newContents) {
      textView.append(content);
    }
    textView.setMovementMethod(LinkMovementMethod.getInstance());
  }
  HistoryManager historyManager = historyManagerRef.get();
  if (historyManager != null) {
    for (String[] text : newHistories) {
      historyManager.addHistoryItemDetails(text[0], text[1]);
    }
  }
}
 
@Override
protected final void onPostExecute(Object arg) {
  TextView textView = textViewRef.get();
  if (textView != null) {
    for (CharSequence content : newContents) {
      textView.append(content);
    }
    textView.setMovementMethod(LinkMovementMethod.getInstance());
  }
  HistoryManager historyManager = historyManagerRef.get();
  if (historyManager != null) {
    for (String[] text : newHistories) {
      historyManager.addHistoryItemDetails(text[0], text[1]);
    }
  }
}
 
源代码6 项目: reacteu-app   文件: CaptureActivity.java
@Override
 public void onCreate(Bundle icicle) {
   super.onCreate(icicle);

fakeR = new FakeR(this);

   Window window = getWindow();
   window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
   setContentView(fakeR.getId("layout", "capture"));

   hasSurface = false;
   historyManager = new HistoryManager(this);
   historyManager.trimHistory();
   inactivityTimer = new InactivityTimer(this);
   beepManager = new BeepManager(this);

   PreferenceManager.setDefaultValues(this, fakeR.getId("xml", "preferences"), false);

   //showHelpOnFirstLaunch();
 }
 
源代码7 项目: reacteu-app   文件: SupplementalInfoRetriever.java
public static void maybeInvokeRetrieval(TextView textView,
                                        ParsedResult result,
                                        HistoryManager historyManager,
                                        Context context) {
  AsyncTaskExecInterface taskExec = new AsyncTaskExecManager().build();
  if (result instanceof URIParsedResult) {
    taskExec.execute(new URIResultInfoRetriever(textView, (URIParsedResult) result, historyManager, context));
    taskExec.execute(new TitleRetriever(textView, (URIParsedResult) result, historyManager));
  } else if (result instanceof ProductParsedResult) {
    String productID = ((ProductParsedResult) result).getProductID();
    taskExec.execute(new ProductResultInfoRetriever(textView, productID, historyManager, context));
  } else if (result instanceof ISBNParsedResult) {
    String isbn = ((ISBNParsedResult) result).getISBN();
    taskExec.execute(new ProductResultInfoRetriever(textView, isbn, historyManager, context));
    taskExec.execute(new BookResultInfoRetriever(textView, isbn, historyManager, context));
  }
}
 
源代码8 项目: reacteu-app   文件: SupplementalInfoRetriever.java
@Override
protected void onPostExecute(Object arg) {
  TextView textView = textViewRef.get();
  if (textView != null) {
    for (Spannable content : newContents) {
      textView.append(content);
    }
    textView.setMovementMethod(LinkMovementMethod.getInstance());
  }
  HistoryManager historyManager = historyManagerRef.get();
  if (historyManager != null) {
    for (String[] text : newHistories) {
      historyManager.addHistoryItemDetails(text[0], text[1]);
    }
  }
}
 
源代码9 项目: android-apps   文件: CaptureActivity.java
@Override
public void onCreate(Bundle icicle) {
  super.onCreate(icicle);

  Window window = getWindow();
  window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
  setContentView(R.layout.capture);

  hasSurface = false;
  historyManager = new HistoryManager(this);
  historyManager.trimHistory();
  inactivityTimer = new InactivityTimer(this);
  beepManager = new BeepManager(this);

  PreferenceManager.setDefaultValues(this, R.xml.preferences, false);

  //showHelpOnFirstLaunch();
}
 
源代码10 项目: android-apps   文件: SupplementalInfoRetriever.java
public static void maybeInvokeRetrieval(TextView textView,
                                        ParsedResult result,
                                        Handler handler,
                                        HistoryManager historyManager,
                                        Context context) {

  Collection<SupplementalInfoRetriever> retrievers = new ArrayList<SupplementalInfoRetriever>(1);

  if (result instanceof URIParsedResult) {
    retrievers.add(new URIResultInfoRetriever(textView, (URIParsedResult) result, handler, historyManager, context));
  } else if (result instanceof ProductParsedResult) {
    String productID = ((ProductParsedResult) result).getProductID();
    retrievers.add(new ProductResultInfoRetriever(textView, productID, handler, historyManager, context));
  } else if (result instanceof ISBNParsedResult) {
    String isbn = ((ISBNParsedResult) result).getISBN();
    retrievers.add(new ProductResultInfoRetriever(textView, isbn, handler, historyManager, context));
    retrievers.add(new BookResultInfoRetriever(textView, isbn, handler, historyManager, context));
  }

  for (SupplementalInfoRetriever retriever : retrievers) {
    ExecutorService executor = getExecutorService();
    Future<?> future = executor.submit(retriever);
    // Make sure it's interrupted after a short time though
    executor.submit(new KillerCallable(future, 10, TimeUnit.SECONDS));
  }
}
 
@Override
protected final void onPostExecute(Object arg) {
  TextView textView = textViewRef.get();
  if (textView != null) {
    for (CharSequence content : newContents) {
      textView.append(content);
    }
    textView.setMovementMethod(LinkMovementMethod.getInstance());
  }
  HistoryManager historyManager = historyManagerRef.get();
  if (historyManager != null) {
    for (String[] text : newHistories) {
      historyManager.addHistoryItemDetails(text[0], text[1]);
    }
  }
}
 
public static void maybeInvokeRetrieval(TextView textView,
                                        ParsedResult result,
                                        HistoryManager historyManager,
                                        Context context) {
  try {
    if (result instanceof URIParsedResult) {
      SupplementalInfoRetriever uriRetriever =
          new URIResultInfoRetriever(textView, (URIParsedResult) result, historyManager, context);
      uriRetriever.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
      SupplementalInfoRetriever titleRetriever =
          new TitleRetriever(textView, (URIParsedResult) result, historyManager);
      titleRetriever.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
    } else if (result instanceof ProductParsedResult) {
      ProductParsedResult productParsedResult = (ProductParsedResult) result;
      String productID = productParsedResult.getProductID();
      SupplementalInfoRetriever productRetriever =
          new ProductResultInfoRetriever(textView, productID, historyManager, context);
      productRetriever.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
    } else if (result instanceof ISBNParsedResult) {
      String isbn = ((ISBNParsedResult) result).getISBN();
      SupplementalInfoRetriever productInfoRetriever =
          new ProductResultInfoRetriever(textView, isbn, historyManager, context);
      productInfoRetriever.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
      SupplementalInfoRetriever bookInfoRetriever =
          new BookResultInfoRetriever(textView, isbn, historyManager, context);
      bookInfoRetriever.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
    }
  } catch (RejectedExecutionException ree) {
    // do nothing
  }
}
 
public static void maybeInvokeRetrieval(TextView textView,
                                        ParsedResult result,
                                        HistoryManager historyManager,
                                        Context context) {
  try {
    if (result instanceof URIParsedResult) {
      SupplementalInfoRetriever uriRetriever =
          new URIResultInfoRetriever(textView, (URIParsedResult) result, historyManager, context);
      uriRetriever.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
      SupplementalInfoRetriever titleRetriever =
          new TitleRetriever(textView, (URIParsedResult) result, historyManager);
      titleRetriever.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
    } else if (result instanceof ProductParsedResult) {
      ProductParsedResult productParsedResult = (ProductParsedResult) result;
      String productID = productParsedResult.getProductID();
      SupplementalInfoRetriever productRetriever =
          new ProductResultInfoRetriever(textView, productID, historyManager, context);
      productRetriever.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
    } else if (result instanceof ISBNParsedResult) {
      String isbn = ((ISBNParsedResult) result).getISBN();
      SupplementalInfoRetriever productInfoRetriever =
          new ProductResultInfoRetriever(textView, isbn, historyManager, context);
      productInfoRetriever.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
      SupplementalInfoRetriever bookInfoRetriever =
          new BookResultInfoRetriever(textView, isbn, historyManager, context);
      bookInfoRetriever.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
    }
  } catch (RejectedExecutionException ree) {
    // do nothing
  }
}
 
源代码14 项目: weex   文件: SupplementalInfoRetriever.java
public static void maybeInvokeRetrieval(TextView textView,
                                        ParsedResult result,
                                        HistoryManager historyManager,
                                        Context context) {
  try {
    if (result instanceof URIParsedResult) {
      SupplementalInfoRetriever uriRetriever =
          new URIResultInfoRetriever(textView, (URIParsedResult) result, historyManager, context);
      uriRetriever.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
      SupplementalInfoRetriever titleRetriever =
          new TitleRetriever(textView, (URIParsedResult) result, historyManager);
      titleRetriever.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
    } else if (result instanceof ProductParsedResult) {
      ProductParsedResult productParsedResult = (ProductParsedResult) result;
      String productID = productParsedResult.getProductID();
      SupplementalInfoRetriever productRetriever =
          new ProductResultInfoRetriever(textView, productID, historyManager, context);
      productRetriever.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
    } else if (result instanceof ISBNParsedResult) {
      String isbn = ((ISBNParsedResult) result).getISBN();
      SupplementalInfoRetriever productInfoRetriever =
          new ProductResultInfoRetriever(textView, isbn, historyManager, context);
      productInfoRetriever.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
      SupplementalInfoRetriever bookInfoRetriever =
          new BookResultInfoRetriever(textView, isbn, historyManager, context);
      bookInfoRetriever.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
    }
  } catch (RejectedExecutionException ree) {
    // do nothing
  }
}
 
public static void maybeInvokeRetrieval(TextView textView,
                                        ParsedResult result,
                                        HistoryManager historyManager,
                                        Context context) {
  try {
    if (result instanceof URIParsedResult) {
      SupplementalInfoRetriever uriRetriever =
          new URIResultInfoRetriever(textView, (URIParsedResult) result, historyManager, context);
      uriRetriever.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
      SupplementalInfoRetriever titleRetriever =
          new TitleRetriever(textView, (URIParsedResult) result, historyManager);
      titleRetriever.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
    } else if (result instanceof ProductParsedResult) {
      ProductParsedResult productParsedResult = (ProductParsedResult) result;
      String productID = productParsedResult.getProductID();
      SupplementalInfoRetriever productRetriever =
          new ProductResultInfoRetriever(textView, productID, historyManager, context);
      productRetriever.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
    } else if (result instanceof ISBNParsedResult) {
      String isbn = ((ISBNParsedResult) result).getISBN();
      SupplementalInfoRetriever productInfoRetriever =
          new ProductResultInfoRetriever(textView, isbn, historyManager, context);
      productInfoRetriever.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
      SupplementalInfoRetriever bookInfoRetriever =
          new BookResultInfoRetriever(textView, isbn, historyManager, context);
      bookInfoRetriever.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
    }
  } catch (RejectedExecutionException ree) {
    // do nothing
  }
}
 
public static void maybeInvokeRetrieval(TextView textView,
                                        ParsedResult result,
                                        HistoryManager historyManager,
                                        Context context) {
  try {
    if (result instanceof URIParsedResult) {
      SupplementalInfoRetriever uriRetriever =
          new URIResultInfoRetriever(textView, (URIParsedResult) result, historyManager, context);
      uriRetriever.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
      SupplementalInfoRetriever titleRetriever =
          new TitleRetriever(textView, (URIParsedResult) result, historyManager);
      titleRetriever.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
    } else if (result instanceof ProductParsedResult) {
      ProductParsedResult productParsedResult = (ProductParsedResult) result;
      String productID = productParsedResult.getProductID();
      SupplementalInfoRetriever productRetriever =
          new ProductResultInfoRetriever(textView, productID, historyManager, context);
      productRetriever.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
    } else if (result instanceof ISBNParsedResult) {
      String isbn = ((ISBNParsedResult) result).getISBN();
      SupplementalInfoRetriever productInfoRetriever =
          new ProductResultInfoRetriever(textView, isbn, historyManager, context);
      productInfoRetriever.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
      SupplementalInfoRetriever bookInfoRetriever =
          new BookResultInfoRetriever(textView, isbn, historyManager, context);
      bookInfoRetriever.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
    }
  } catch (RejectedExecutionException ree) {
    // do nothing
  }
}
 
源代码17 项目: android-apps   文件: ProductResultInfoRetriever.java
ProductResultInfoRetriever(TextView textView,
                           String productID,
                           Handler handler,
                           HistoryManager historyManager,
                           Context context) {
  super(textView, handler, historyManager);
  this.productID = productID;
  this.source = context.getString(R.string.msg_google_product);
  this.context = context;
}
 
源代码18 项目: android-apps   文件: BookResultInfoRetriever.java
BookResultInfoRetriever(TextView textView,
                        String isbn,
                        Handler handler,
                        HistoryManager historyManager,
                        Context context) {
  super(textView, handler, historyManager);
  this.isbn = isbn;
  this.source = context.getString(R.string.msg_google_books);
  this.context = context;
}
 
源代码19 项目: android-apps   文件: URIResultInfoRetriever.java
URIResultInfoRetriever(TextView textView,
                       URIParsedResult result,
                       Handler handler,
                       HistoryManager historyManager,
                       Context context) {
  super(textView, handler, historyManager);
  redirectString = context.getString(R.string.msg_redirect);
  this.result = result;
}
 
public static void maybeInvokeRetrieval(TextView textView,
                                        ParsedResult result,
                                        HistoryManager historyManager,
                                        Context context) {
  if (result instanceof URIParsedResult) {
    SupplementalInfoRetriever uriRetriever = 
        new URIResultInfoRetriever(textView, (URIParsedResult) result, historyManager, context);
    uriRetriever.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
    SupplementalInfoRetriever titleRetriever = 
        new TitleRetriever(textView, (URIParsedResult) result, historyManager);
    titleRetriever.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
  } else if (result instanceof ProductParsedResult) {
    ProductParsedResult productParsedResult = (ProductParsedResult) result;
    String productID = productParsedResult.getProductID();
    SupplementalInfoRetriever productRetriever =
        new ProductResultInfoRetriever(textView, productID, historyManager, context);
    productRetriever.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
  } else if (result instanceof ISBNParsedResult) {
    String isbn = ((ISBNParsedResult) result).getISBN();
    SupplementalInfoRetriever productInfoRetriever = 
        new ProductResultInfoRetriever(textView, isbn, historyManager, context);
    productInfoRetriever.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
    SupplementalInfoRetriever bookInfoRetriever = 
        new BookResultInfoRetriever(textView, isbn, historyManager, context);
    bookInfoRetriever.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
  }
}
 
源代码21 项目: ZXing-Standalone-library   文件: TitleRetriever.java
TitleRetriever(TextView textView, URIParsedResult result, HistoryManager historyManager) {
  super(textView, historyManager);
  this.httpUrl = result.getURI();
}
 
SupplementalInfoRetriever(TextView textView, HistoryManager historyManager) {
  textViewRef = new WeakReference<>(textView);
  historyManagerRef = new WeakReference<>(historyManager);
  newContents = new ArrayList<>();
  newHistories = new ArrayList<>();
}
 
ProductResultInfoRetriever(TextView textView, String productID, HistoryManager historyManager, Context context) {
  super(textView, historyManager);
  this.productID = productID;
  this.source = context.getString(R.string.msg_google_product);
  this.context = context;
}
 
BookResultInfoRetriever(TextView textView, String isbn, HistoryManager historyManager, Context context) {
  super(textView, historyManager);
  this.isbn = isbn;
  this.source = context.getString(R.string.msg_google_books);
  this.context = context;
}
 
URIResultInfoRetriever(TextView textView, URIParsedResult result, HistoryManager historyManager, Context context) {
  super(textView, historyManager);
  redirectString = context.getString(R.string.msg_redirect);
  this.result = result;
}
 
TitleRetriever(TextView textView, URIParsedResult result, HistoryManager historyManager) {
  super(textView, historyManager);
  this.httpUrl = result.getURI();
}
 
SupplementalInfoRetriever(TextView textView, HistoryManager historyManager) {
  textViewRef = new WeakReference<>(textView);
  historyManagerRef = new WeakReference<>(historyManager);
  newContents = new ArrayList<>();
  newHistories = new ArrayList<>();
}
 
ProductResultInfoRetriever(TextView textView, String productID, HistoryManager historyManager, Context context) {
  super(textView, historyManager);
  this.productID = productID;
  this.source = context.getString(R.string.msg_google_product);
  this.context = context;
}
 
BookResultInfoRetriever(TextView textView, String isbn, HistoryManager historyManager, Context context) {
  super(textView, historyManager);
  this.isbn = isbn;
  this.source = context.getString(R.string.msg_google_books);
  this.context = context;
}
 
URIResultInfoRetriever(TextView textView, URIParsedResult result, HistoryManager historyManager, Context context) {
  super(textView, historyManager);
  redirectString = context.getString(R.string.msg_redirect);
  this.result = result;
}