Coder Social home page Coder Social logo

Comments (4)

dm77 avatar dm77 commented on August 15, 2024 1

@xolan thanks for request.

For changing colors, in your project's colors.xml you can put the following xml and change the hex colors to whatever you need:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="viewfinder_mask">#60000000</color>
    <color name="viewfinder_laser">#ffcc0000</color>
    <color name="viewfinder_border">#ffafed44</color>
</resources>

As for offsetting the ViewFinderView, right now it is setup exactly in the center of the surfaceview. Can you help me understand how changing the offset is helpful, like what are you trying to accomplish?

from barcodescanner.

xolan avatar xolan commented on August 15, 2024

The changing of colors makes sense now that you mention it.

Essentially I have an Activity with a Fragment containing a TabHost with 3+ tabs. Within one of these tabs I'm using ZBarScannerView with which I'm scanning QR codes. It seems the top most fragment, which has an ActionBar, is pushing the scanner down, and I'd like to re-adjust it so that the "view finder" remains center in terms of mobile display, not center in terms of it's parent view.

I guess I could go over my layout hierarchy to see if I can accomplish the desired look that way.

Thanks for the quick reply though!

from barcodescanner.

xolan avatar xolan commented on August 15, 2024

Here's the issue I'm having. http://imgur.com/5q02oUy

The ViewFinder seems to be centered in relation to the device screen size (but pushed down by the actionbar/tabs) instead of the layout I've added the view to.

Do you have any ideas on how I can fix this?

from barcodescanner.

dm77 avatar dm77 commented on August 15, 2024

One way to make the action bar to not push down the camera preview is by overlaying it (http://developer.android.com/training/basics/actionbar/overlaying.html)

The sample app (https://github.com/dm77/barcodescanner/blob/master/zxing/sample/src/main/res/values/styles.xml) uses the overlay actionbar to achieve this.

I will try to change this in a future release so that people are not forced to use the overlay action bar.

from barcodescanner.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.