Android WheelView is all black? - android

So I found this really nice WheelView here that has been mentioned here before. I tried using it but I hit a few problems, and don't know what am I doing wrong. So what I did is link the src folder like it has been done in WheelView-demo app. It didn't work then, but to make it work I had to link a gen folder also and copy layout_bg.xml over to my res->layout folder from the demo app.
After that I created my two arrays of data that will be shown (text) and when I run it I get this.
image
For background of both wheels it uses my icon.png files, and I just want it to be white as it is in the original app. Also the selection bar is not transparent so I can not see the selection.
Any ideas what to do? Thanks for the help.

Ok, I fixed it, but I think it might not be the right solution :)
So there is a file called layout_bg.xml whre the bar with the selected value is defined, colours wise. These are the contents:
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:startColor="#FF000000"
android:centerColor="#FF000000"
android:endColor="#FF777777"
android:angle="90" />
</shape>
So to fix it I replaced centerColor="#FF000000" with centerColor="#00FFFFFF". You could write all zeros, but this way it looks nicer. Anyway what is still puzzling me is that in the android reference, it says that first two digits represent Alpha channel, FF being opaque and 00 being transparent, but I am not sure that this kind of mistake would be in this code that I downloaded?

Related

AndroidStudio Adding an image to draw with srcCompat

I am trying to do a drawer activity with Android Studio and I'm wanting to personalize the icons used. I've downloaded the icons I want to use and for the most part, it's okay.
In fact, I can modify all the android:icon icons but I have no idea how to modify the app:srcCompat icons. I don't know how to detect the image I want to use in this case...
Do you know how I can do it? Could you explain this to me?
Thanks a lot!
Edit: The file I'm working on as a base is the generated project with Drawer activity as the main activity. For example, if I wanted to modify the icon in the nav_header_main.xml file, how could I do to have my image (.png) transformed in a way detected by Android Studio as compatible with srcCompat
Ensure your image file is in res/drawable folder(or drawable-xhdpi/xxhdpi, determined by your design)
Refer it by app:srcCompact="#drawable/$IMAGE_FILE_NAME" in your xml.
Then you should see what you want.
Please check the doc to further understand the official usage.
Well... I was blind! I was wondering how I could add my icons but they were, I was just mistaking on the address... #android:drawable/... is obviously not #drawable/... but I didn't notice. So be aware that there is a difference and it'll be okay I think!

How can I track down the cause of Android "found an invalid color" error

During build of my android application I am getting the following error:
:app:mergeDev_testingDebugResources
error: found an invalid color.
I don't get any line of code or even which file it is having a problem with. I have a large number of outstanding changes (stupid me) which I don't want to roll back - but I'm totally stumped as to how to work out what is wrong.
For future reference - this error is what you get if you have added an image as a 9-pack and it isn't yet properly formatted with the black pixel borders. The error message could be far more helpful, i.e. actually saying which file the error occurs with would be nice, but the solution is just to go through all your 9 pack files in Android Studio and open then save each of them.
First of all, check your layout directory in file explorer bcoz when you have made changes in the main layout file then you could have changed respective example: v-21 or v-13 layout file too. This error occurs when you apply some element property which is not supported by previous versions like v-21.
I hope I have given detail about this, if any explanations are needed plz let me know.
Yes, the problem is in 9-path image. At least in my case.
The problem was in black lines in the borders of image. It should be only black and transparent. Nothing else. In my case there was shadow from view with alpha. With photoshop I remove any color pixels of borders (except black lines)
At Android Studio launch Analyze -> Inspect code. Then resolve all errors
In my case , i have done mistake while writing color,
like -
<color name="mainBackground">#8e00ed></color>
then look i have added extra symbol this-">" after my color ,
it should only be
<color name="mainBackground">#8e00ed</color
Then it worked fine for me.
Just check between two symbols "only color code" should come "no extra symbols,no apostophies,no semicolons" should be there.
Thank You!!!

How to mod color of active photo background on PicsArt.apk using APKstudio

I need some help in modding apk of PicsArt. I have trouble seeing my transparent pictures in this window here that is the first editing mode when you entered PicsArt. I've successfully changed the background of number 1, as you can see, it was supposed to be dark/black but I changed it to this color code : #eeeeee the code was from colors.xml, you can find that in folder res/value/colors.xml then I changed it to #eeeeee.
Now I really need a help to change the color of number 2. FYI: it's not the picture that has color of black, but it's my transparent picture that shows in black color. I really hope someone could help me to change the color be like in the draw mode, you can see that window has checker-board pattern as the background.
Or if it's not possible it is alright for me to change just the color of it, example grey color.
I've tried myself to change and find some other color codes, but I keep failing to find and change that color. I'm using the latest version of PicsArt, you can download it for free on Play Store. I hope some experts in modding APK will come out and help me, it will be very helpful for me to make my work easier just using my phone.
EDIT : I've uploaded the colors.xml code somewhere click here to see ,
but I dont think any of these code will work for the background colors that I've talked above, because I've tried to change every of it and I failed. I think it's somewhere else in the other folder that contains xml files. please help me

Background not show in LinearLayout in version 4.2

my problem is that in version 4.2 the background in LinearLayout not showing, but in previous version it showing. I put the background like this:
android:background="#drawable/image"
I don't understand why.
I was just having the exact same problem. What fixed it for me was making sure I had the proper versions in the proper drawable-xxxx folder. For example...
If your image is in res/drawable but not in any other folder like res/drawable-hdpi, res/drawable-xhdpi, etc make sure you create a version appropriate for each of the screen sizes you are supporting and include that version in the corresponding drawable folder.
After I did that my bg drawable started showing up.
maybe it helps someone..I had a problem too with version 4.1.1 and everything I do was to set background programmatically
myLayout.setBackground(yourDrawable);
There isn't any problem with the syntax you are using. May be you are having some other problem. My advice would be to-
Try cleaning the project and run it again.
Check if you have the image named 'image.xxx' in your drawable folder.
Check if you are setting background of the correct layout.
or perhaps you can post some more code so that we can answer you more specifically.
Adding to the Above answer, check that the name of the image in drawable folder is in lower-case. All the drawables must have lower-case names.

Duplicating title bar shadow

How would I go about implementing a shadow like the one you see under the title bar? I know this can be done (see for example the app "Andlytics", where this effect shows on the bottom as well).
My best guess is that it's a banner image used as the background for the layout. But maybe there is a better way?
I looked through the images in the SDK's data/res folder and I found what is probably being used: title_bar_shadow.9.png . Errr, can't attach it here, but you should be able to find it in your android-sdk-location/platforms/android-N/data/res/drawable-hdpi/ folder.
I'm guessing it is probably achieved by using a 9-patch with a gradient on the top edge and corners as the layout background. I don't know of any better way, but this should be pretty simple to implement.
Take a look at this question: Custom ImageView with drop shadow
Or we could use a gradient - and Android seems to be going that way.
In later versions of the platform SDK code, the title bar image is replaced by action_bar_divider.xml.
The divide is nothing but:
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:startColor="#ffe1e2e4"
android:endColor="#ff95979a"
android:angle="270" />
</shape>
You can use it in an image view just below your title bar.

Categories

Resources