These are chat archives for scala-android/sbt-android

8th
Aug 2016
Niklas Klein
@Taig
Aug 08 2016 11:37
<3 how TypedViewHolder nests xml-includes (:
Justin Kaeser
@jastice
Aug 08 2016 12:45
latest intellij-scala plugin nightly should now support sbt-android 1.6 and aar importing: https://confluence.jetbrains.com/display/SCA/Scala+Plugin+Nightly
Niklas Klein
@Taig
Aug 08 2016 15:02
Having fun with TypedViewHolder & shapeless.Witness :)
http://pastebin.com/9qzBBVja
Perry
@pfn
Aug 08 2016 15:29
eeek, what?
what's the witness for? I'm a bit confused, why not just do that directly using TypedViewHolder.setContentView? -- I guess you don't get the factory ref, but that shouldn't hurt
or does the witness improve intellij support? @Taig
Perry
@pfn
Aug 08 2016 15:40
@Taig and is Activity not android.app.Activity in Layout? how do you have onCreate(state: Option[Bundle])?
@Taig and I would typically do lazy val holder = TypedViewHolder.inflate(...) and reference it at the top of onCreate to make it show up
Niklas Klein
@Taig
Aug 08 2016 15:47
Without the Witness, Scala wouldn't infer the singleton type, and therefore fail to find the implicit factory. This is as easy as I could make it for the "user" aka me.
It's not android.app.Activity, I overrode this behavior in my Activity
I'm tending to abandon lazy recently. Falling back to cats.Eval if I need that behavior.
Perry
@pfn
Aug 08 2016 15:50
that's weird, the witness shouldn't be necessary
Niklas Klein
@Taig
Aug 08 2016 15:50
I'll have another look. I toyed around with that for a while.
Perry
@pfn
Aug 08 2016 15:52
if the witness were necessary, the original code in viewHolders.scala wouldn't compile either
if the Witness gives better intellij interop, though, that would be a nice workaround
Rafal Wachol
@charafau
Aug 08 2016 15:54
I should take a look at shapeless..
@jastice thank you for noticing :)
Perry
@pfn
Aug 08 2016 15:55
@charafau @jastice is the one who merged in my PRs :P
Niklas Klein
@Taig
Aug 08 2016 15:55
scala> def test( arg: String )( implicit ev: Ordering[arg.type] ) = ???
test: (arg: String)(implicit ev: Ordering[arg.type])Nothing

scala> class test( arg: String )( implicit ev: Ordering[arg.type] )
<console>:11: error: not found: value arg
       class test( arg: String )( implicit ev: Ordering[arg.type] )
Perry
@pfn
Aug 08 2016 15:57
interesting
sounds like a scala bug :P
unfortunately, I don't think it's something they'd fix in 2.11.x :(
Niklas Klein
@Taig
Aug 08 2016 15:58
I never really questioned that behavior. Bumping into that every once in a while.
It seems fairly odd though
Miles Sabin published a couple SI fixes recently which I'm really hoping for to be published to 2.11.x as well
Perry
@pfn
Aug 08 2016 16:00
they sound like they will all only go into 2.12
pretty much anything affecting syntax/grammar will not go into 2.11
Niklas Klein
@Taig
Aug 08 2016 16:01
2712 is already available as compiler plugin
Perry
@pfn
Aug 08 2016 16:01
i.e. if it produced a compilation error before, it will always do that
Niklas Klein
@Taig
Aug 08 2016 16:02
Hoping singleton types will be backported
Well, I would happily use the typelevel compiler fork if that means I can use up-to-date typelevel libraries
Perry
@pfn
Aug 08 2016 16:07
it may come to that; I might invest some time into retrolambda again as well
Rafal Wachol
@charafau
Aug 08 2016 16:07
@pfn yes I know :)
Perry
@pfn
Aug 08 2016 16:17
@silvaren what was put out last week should work fine, you need to clean build
hmm, still missing support rs jni
silvaren
@silvaren
Aug 08 2016 16:33
@pfn oh cool, I'll try it
maybe that's why it was crashing
Perry
@pfn
Aug 08 2016 16:33
hmm, not quite still
silvaren
@silvaren
Aug 08 2016 16:35
oh, is the bc packing problem that you mentioned before?
it's*
Perry
@pfn
Aug 08 2016 16:36
no, now it's a support rs packaging problem
but I fixed that
now it's something else weird: no static or non-static method "Landroid/support/v8/renderscript/RenderScript;.rsnScriptForEach(JJI[JJ[B[I)V"
silvaren
@silvaren
Aug 08 2016 16:36
eek
Perry
@pfn
Aug 08 2016 16:38
[pfnguyen@galactica rstoolbox] $ javap -classpath ~/android-sdk-windows/build-tools/23.0.3/renderscript/lib/renderscript-v8.jar android.support.v8.renderscript.RenderScript | grep rsnScriptForEach
  native void rsnScriptForEach(long, long, long, int, long, long, byte[], boolean);
  native void rsnScriptForEach(long, long, long, int, long, long, boolean);
  native void rsnScriptForEachClipped(long, long, long, int, long, long, byte[], int, int, int, int, int, int, boolean);
  native void rsnScriptForEachClipped(long, long, long, int, long, long, int, int, int, int, int, int, boolean);
signature doesn't match
it's looking for long, long, int, long[], long, byte[], int[]
silvaren
@silvaren
Aug 08 2016 16:40
that's weird
maybe mixing versions?
Perry
@pfn
Aug 08 2016 16:40
indeed, appears to be
 $ javap -classpath ~/android-sdk-windows/build-t ools/24.0.0/renderscript/lib/renderscript-v8.jar android.support.v8.renderscrip t.RenderScript | grep rsnScriptForEach
  native void rsnScriptForEach(long, long, long, int, long, long, byte[], boolean);
  native void rsnScriptForEach(long, long, long, int, long, long, boolean);
  native void rsnScriptForEachClipped(long, long, long, int, long, long, byte[], int, int, int, int, int, int, boolean);
  native void rsnScriptForEachClipped(long, long, long, int, long, long, int, int, int, int, int, int, boolean);
  native void rsnScriptForEach(long, long, int, long[], long, byte[], int[]);
pfn @pfn cleans again
silvaren
@silvaren
Aug 08 2016 16:41
hahah
Perry
@pfn
Aug 08 2016 16:41
yep, had some left over mixup because I didn't clean \o/
@silvaren alright, your project builds and runs now
Perry
@pfn
Aug 08 2016 16:47
but yeah, renderscript, yech
@silvaren give it a go (git pull, publish-local) let me know if everything works for you, this is gonna get published at sbt-android 1.6.11
silvaren
@silvaren
Aug 08 2016 16:49
ok
cool!
Perry
@pfn
Aug 08 2016 16:49
@silvaren and rstoolbox/clean app/clean -- make sure it is all clean
silvaren
@silvaren
Aug 08 2016 16:49
i'll try it
sure
Perry
@pfn
Aug 08 2016 16:50
interestingly, stupid gradle doesn't publish the buildToolsVersion used by the android plugin
silvaren
@silvaren
Aug 08 2016 16:51
same snapshot version right?
Perry
@pfn
Aug 08 2016 16:52
yes
oh, hmm, buildToolsVersion is published by AndroidProject now
silvaren
@silvaren
Aug 08 2016 17:00
you rock @pfn !
worked like a charm
Niklas Klein
@Taig
Aug 08 2016 17:15
@pfn I was just about to post the constructor dependent arguments issue to the Scala channel ;)
Glad to see it's almost fixed! In 2.12.x :/
Perry
@pfn
Aug 08 2016 20:34
@Taig yeah, :-/
silvaren
@silvaren
Aug 08 2016 21:47
out of curiosity, are you guys using android studio or "pure" intellij to code?
Perry
@pfn
Aug 08 2016 21:50
I use intellij, but grapevine says android studio works
silvaren
@silvaren
Aug 08 2016 21:51
cool
Yilin Wei
@yilinwei
Aug 08 2016 21:51
I use emacs
(with extensions obviously)
Perry
@pfn
Aug 08 2016 21:51
ensime works ok for sbt-android
dunno if there are good xml completion extensions
val aaptOptions = aaptAdditionalParams /++= Try(ap.getAaptOptions).toOption.flatMap(a => Try(a.getAdditionalParameters).toOption.filter(_ != null)).fold(List.empty[String])(_.asScala.toList)
friggin' wonderful...
Yilin Wei
@yilinwei
Aug 08 2016 22:08
Would be surprised if there wasn't
Perry
@pfn
Aug 08 2016 22:35
I assume that means you don't use such things