Exemple #1
0
  /*
   * Create scrolling card deck with two cards
   */
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getWindow().requestFeature(WindowUtils.FEATURE_VOICE_COMMANDS);
    getActionBar().hide();

    PACKAGE_NAME = getPackageName();
    rootView = getWindow().getDecorView().getRootView();
    isCasting = false;

    mCards = new ArrayList<CardBuilder>();
    mCards.add(
        new CardBuilder(this, CardBuilder.Layout.TEXT).setText("Quotes from Friedrich Nietzsche"));
    mCards.add(new CardBuilder(this, CardBuilder.Layout.TEXT).setText("Quotes from Lao Zi"));

    mCardScrollAdapter = new CustomCardScrollAdapter(mCards);

    mCardScrollView = new CardScrollView(this);
    mCardScrollView.setAdapter(mCardScrollAdapter);
    mCardScrollView.activate();
    mCardScrollView.setOnItemClickListener(
        new AdapterView.OnItemClickListener() {
          @Override
          public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            openOptionsMenu();
          }
        });
    setContentView(mCardScrollView);
  }
Exemple #2
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    createCards();

    pCardScrollView = new CardScrollView(this);
    PropertyCardScrollAdapter adapter = new PropertyCardScrollAdapter();
    pCardScrollView.setAdapter(adapter);
    pCardScrollView.activate();
    setContentView(pCardScrollView);
  }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    android.os.Debug.waitForDebugger();
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

    // Cards start
    cardManager = new CardManager(this, mCards);
    mCardScrollView = new CardScrollView(this);
    adapter = new ExampleCardScrollAdapter();
    mCardScrollView.setAdapter(adapter);
    mCardScrollView.setOnItemClickListener(adapter);
    mCardScrollView.activate();
    setContentView(mCardScrollView);

    _cameraPreview = new CameraPreview(this);
    setContentView(_cameraPreview);
  }
  private void takePicture(
      String id, String title, String bid, String bin, String location, String condition) {
    // This is due saving picture that user can approve photo only after 2-3
    // seconds, otherwise scanning would fail
    // Toast.makeText(getApplicationContext(), "Wait...",
    // Toast.LENGTH_LONG).show();
    // Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
    // startActivityForResult(intent, TAKE_PICTURE_REQUEST);

    // Cards start
    cardManager = new CardManager(this, mCards);
    cardManager.createTitleCard(title, bid, bin, id);
    cardManager.createContentCard(id, location, condition);
    cardManager.createSaveCard(id);
    cardManager.createScanCard();
    mCardScrollView = new CardScrollView(this);
    adapter = new ExampleCardScrollAdapter();
    mCardScrollView.setAdapter(adapter);
    mCardScrollView.setOnItemClickListener(adapter);
    mCardScrollView.activate();
    setContentView(mCardScrollView);

    adapter.notifyDataSetChanged();
  }
 @Override
 protected void onResume() {
   super.onResume();
   WintLess2.activate();
 } // onResume
 @Override
 protected void onResume() {
   super.onResume();
   mCardScroller.activate();
 }
 @Override
 protected void onResume() {
   super.onResume();
   Log.d(TAG, "resume");
   mCardScroller.activate();
 }