2

I have just spent a large majority of the day trying to implement AndroidPlot into my existing app but have reached a point where I can not see what I am doing wrong.

I have done the simple line graph tutorial that is posted on the main page at androidplot.com and it worked just nicely:

enter image description here

So I copied over the activity and layouts to my existing project, added the activity in the manifest and included "com.androidplot:androidplot-core:0.9.6" in build.gradle dependencies then re-synced.

I felt like I had touched on everything I had just done before. When I launched the newly added plot activity I noticed that the plot had absolutely no styling to it: enter image description here

I tried clean, rebuild, invalidate cache but still no styling was present.

I deleted everything and tried adding the tutorial code again.. same result. I even tried some minor variations.. same results.

My layout simple_xy_plot_example.xml which has the plot view was copied straight from the quickstart link on androidplot's website same with the code in onCreate of the activity I was launching. So looking at the tutorial I can not see any physical difference between it and what was added to my existing project. Both were even done in the same IDE!

Oddly enough after some struggling with google I stumbled upon a search (cant remember where) that showed instead of using the suggested ap:lable="mytltle" attribute they used androidPlot.title="mytitle". So I tried and the title did in fact show.

I immediately tried adding androidPlot.X="" to all of my plot's view xml attributes. Started the activity again and nope, only the text for the title and range showed, the background, text size, colors and all other style attributes did not seem to be having an affect.

I am willing to provide information/code in hopes of better understanding what is (or what is not) going on here. I just don't know what else to post or how to proceed as its pretty much an exact copy of the tutorial (just within another project with other activities).

AndroidPlot 0.9.6 running on Android 5

Please Help - I really wish to use this library!

Logic1
  • 1,806
  • 3
  • 26
  • 43
  • Pretty much given up on AndroidPlot as there appears to be no fix for this issue. Also there is no good support (the AndroidPlot forum seems to always be down??). So ill assume the AndroidPlot project is in decline and look for something elsewhere that's a bit more supported/reliable. – Logic1 Apr 13 '16 at 19:09

2 Answers2

0

The androidPlot:someAttr attrs are actually a legacy mechanism for supporting xml styleables (see the configurator docs) in an Android library in the pre .AAR days. It still works today though and is actually the only way to configure certain things via xml. The reason it only worked for one of the elements in your app is likely because Configurator uses a reflective mechanism to apply attrs to the plot, the attr naming scheme is different. I think that one element just happened to have the same name under both schemes.

Using Configurator is a solution but I think you'd have a much better experience using the first class styleable attrs instead. From what you wrote above it sounds like you're trying to integrate into an existing project, and since everything seems to be compiling successfully for you, I suspect there might be something going on in the build config.

A couple questions:

  • What's your build tools version?
  • What's your target SDK level?
  • Does your project use obfuscation? If so, does turning it off help?

PS - re the Androidplot forum - it's actually a google group so it should be up pretty much all the time. Here's a direct link if you need it.

Nick
  • 8,181
  • 4
  • 38
  • 63
0

I had a similar Problem. In my case the problem was that I uses a different applicationId in the build file than the specified packagename in the manifest. The Problem with this configuration is that the library expects the R.stylable class in the package defined in the build file but it is in the package defined in the manifest. I solved the problem by changing the packagenamein the manifest to match the other one. This requires a bit of refactoring. But I could not change the one in the build files since the app is already published.

Bernd
  • 928
  • 10
  • 8