-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Offsetting and styling ViewFinderView #16
Comments
@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:
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? |
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! |
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? |
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. |
Is there a way to offset ViewFinderView? It would also be nice to be able to set my own styles/colors for the laser, border etc.
Note: I mean when using as a library as opposed to importing and altering/forking the source myself.
The text was updated successfully, but these errors were encountered: