Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Carlos Gottberg
    @clinoge
    I'm using macroid-extras 0.3 and macroid M5. Scala version is 2.11.8 and sbt is 0.13.12. Android support v4 24.2.0 v7 24.2.0.
    I've tried googling, searching in the issues, sbt clean, sbt compile, read what the ProGuard guys have to say about it. But only found one StackOverflow answer which basically suggested to ignore these warnings... I don't know if that's the best idea...
    I'm sure I'm missing something totally stupid, but might be too tired to get it :c
    Niklas Klein
    @Taig
    @clinoge try to suppress the warnings in your ProGaurd config to get the app running. If that doesn't cause runtime errors you're fine
    Raúl Raja Martínez
    @raulraja
    @javipacheco are we seeing those in nine cards too? If so what is the way to fix them?
    Javi Pacheco
    @javipacheco
    We don't have this problem @clinoge Anyway, the TR (TypedResource) is a class for scala-android plugin. Maybe you can upgrade the plugin or ask in the GitHub of sbt-android project. Sorry, I can't help you about it
    Carlos Gottberg
    @clinoge

    No problem at all ^^. Today I hit another problem, but it might very well be my fault. When trying to tweak a Button

    w[Button] <~ lp[LinearLayout](64 dp, WRAP_CONTENT, 1)

    I'm getting java.lang.NoClassDefFoundError: Failed resolution of: Lscala/math/Numeric$IntIsIntegral$; at runtime :/.

    The only extra options I'm giving ProGuard are

    proguardOptions ++= Seq(
      "-dontwarn com.fortysevendeg.macroid.extras.*",
      "-dontwarn scala.async.internal.*",
      "-dontwarn scala.xml.parsing.*"
    )

    sbt android:run doesn't show any error at all. I don't think it's related to ProGuard... or maybe it is? I get the error from logcat :).

    GRBurst
    @GRBurst
    Hi folks,
    GRBurst
    @GRBurst
    Is there a way to use Futures with listables, e.g. to tweak my ListView with Future[List[something]]?
    val l: Future[List[Int]] = Future { List(2,3,4)}
    userListable.listAdapterTweak(l)
    GRBurst
    @GRBurst
    sry was not clear to me but this does the job
    l.map(li => userListable.listAdapterTweak(li))
    Raúl Raja Martínez
    @raulraja
    @GRBurst if you are not keeping the results of those tweaks you may want to use foreach instead of map to be explicit that you are performing side effects and it’s an impure operation.
    GRBurst
    @GRBurst
    @raulraja yes you are right, thanks for the hint :-)
    Raúl Raja Martínez
    @raulraja
    :thumbsup:
    Yilin Wei
    @yilinwei
    @raulraja are there any plans to make macroid compatible with iOS?
    Raúl Raja Martínez
    @raulraja
    @yilinwei I don’t know enough swift to determine if the lang would support a similar DSL. There is some Scala specific semantics that would need to be workaround or not provide parity of features. Do you have a use case?
    Yilin Wei
    @yilinwei
    @raulraja I don't quite currently (I have a similar compat issues so I was looking to see what you guys were doing) - but why do you want to use swift? There are several VM's which allow you to compile java code to obj-c
    We had a few PoC with RoboVM originally but that sadly died.
    And from working with swift you won't be able to do anything close to as rich - though it may have changed in the 1 year that I haven't used it.
    Raúl Raja Martínez
    @raulraja
    @yilinwei I thought you implied swift as nobody today uses Scala on iOS AFAIK. Hopefully Scala native would open some doors there, but still to early.
    Yilin Wei
    @yilinwei
    Like I said there are a few JVM's which run on iOS (Unity iirc uses a .NET based one, libGDX uses Xamarin atm). I don't expect the performance of scala on iOS to be particularly much worse than android.
    Raúl Raja Martínez
    @raulraja
    @yilinwei Are there any bindings to access UI stuff from Scala in iOS land in any of those platforms?
    Yilin Wei
    @yilinwei
    @raulraja Originally RoboVM has access to the API stuff (touch gesture etc...); Intel's JVM (which is what the libgdx) should also have bindings. We're probably going to do a deep dive on the JVM stuff in ~ 3 - 6m so we could sync up at that point to see whether it's feasible (since we'll have to perf test etc...).
    Raúl Raja Martínez
    @raulraja
    sounds good, looking forward to learn more about it.
    Yuriy Yarosh
    @yuriy-yarosh
    o/
    I wish there was a comparison chart of macroid with anko.
    The Almikey
    @TheAlmikey_twitter
    hey came across some dead link on the macroid page, like this one http://47deg.github.io/macroid/docs/api/core/macroid/Tweaks$.html , the pages have been moved to a new url maybe?
    Raúl Raja Martínez
    @raulraja
    @javipacheco do you know if the scaladocs are getting published somewhere ^^^?
    Raúl Raja Martínez
    @raulraja
    @TheAlmikey_twitter scaladocs are no longer getting published. I created 47deg/macroid#106 which will be adressed in the next sprint to fix those links and point to the actual Github sources.
    The Almikey
    @TheAlmikey_twitter
    Cool, thanks. Really want to explore the lib cant wait :thumbsup:
    Punita Ojha
    @punitaojha
    This message was deleted
    Haemin Yoo
    @yoohaemin
    Hi, are there any examples using ConstraintLayout? All the layouts I've tried worked fine, except for this one.
    scalac keeps saying "Could not find the appropriate LayoutParams constructor" when I use lp[ConstraintLayout] ()
    Raúl Raja Martínez
    @raulraja
    @yoo-haemin feel free to file an issue and we will look into adding support for that if it's broken. /cc @javipacheco
    Rytis Jazdauskas
    @RytisJ

    how does one add error handling on a listview?

    this doesn't seem to work :s

    w[ListView]
              <~
              new BackendConnector()
                .getJars
                .map(UserListable.listAdapterTweak)
                .recover {
                  case _: JsonParseError | _: BackendException =>
                    toast("Service unavailable, try again later") <~ long <~ fry
                    UserListable.listAdapterTweak(Nil)
                  case _: NoInternet =>
                    toast("Turn internet on and try again") <~ long <~ fry
                    UserListable.listAdapterTweak(Nil)
                }
              <~ CustomTweaks.List.noHighlighting + ListTweaks.noDivider
    Javi Pacheco
    @javipacheco
    @yoo-haemin maybe you have to use l[ConstraintLayout](), not LP
    Zachary Albia
    @zach-albia
    hi, is there a way to center widgets horizontally in macroid?
    There didn't seem to be any yet, judging by the source code. Maybe I missed something?
    Raúl Raja Martínez
    @raulraja
    @zach-albia You can use a tweak to access the view and apply any transformations you wish to the view, including changing its gravity and position parameters http://47deg.github.io/macroid/docs/guide/Tweaks.html
    Zachary Albia
    @zach-albia
    @raulraja Ok, I'm getting the sense that lp[<LayoutHere>] is what you meant. As I understand it now, I think this is how you add any arbitrary layout tweaks to a view. Thanks!
    Raúl Raja Martínez
    @raulraja
    Yeah you can apply tweaks to views in layouts. Tweaks are ui actions. There are several examples here of views getting tweaked and applied here http://47deg.github.io/macroid/docs/guide/Tweaks.html
    Zachary Albia
    @zach-albia

    hi, would there be value in adding a

    def margin(left: Int = 0, top: Int = 0, right: Int = 0, bottom: Int = 0, all: Int = -1): Tweak[View]

    tweak, in the same fashion as the paddingtweak?

    because I noticed that in previous versions where macroid.extras was still outside of macroid, there were tweaks like vMargin which do the same thing, but don't exist anymore in the main macroid repo.
    Raúl Raja Martínez
    @raulraja
    @zach-albia yes, that will be valuable, feel free to submit a PR
    Zsolt Szilagyi
    @esgott
    hi All, I'm pretty new to macroid. Is it possible to build AppWidgets with it? Didn't find anything about it in the docs
    Raúl Raja Martínez
    @raulraja
    @esgott AFAIK since those are just views you can potentially use macroid's dsl there as in a regular activity or fragment but to my knowledge nobody has attempted that yet.
    Felix Dietze
    @fdietze
    Hi, I'm trying to create a https://developer.android.com/reference/android/support/constraint/ConstraintSet.html#connect(int,%20int,%20int,%20int) tweak for ConstraintLayout. The problem I have is, that for applying the tweak, I need access to the view AND to the layout by calling https://developer.android.com/reference/android/support/constraint/ConstraintSet.html#applyTo(android.support.constraint.ConstraintLayout). So how do I do it?
    Renato Marinho
    @renatomarinho
    This message was deleted
    Renato Marinho
    @renatomarinho
    This message was deleted
    Richard Gomes
    @frgomes

    Hello. I'm new to macroid.
    I've created a PoC which is just the macroid-starter example with a few updates:

    • SBT 0.13.16
    • Scala 2.11.12
    • sbt-android 1.7.10

    I'm using macroid 2.0.0-M5.

    It works fine in the emulator, which is good. But IntelliJ complains that it cannot find several classes. This is a bit inconvenient because I cannot easily study the sources in deep detail.
    Is that only me or IntelliJ is not really able to find the classes for some reason?
    Thanks

    Richard Gomes
    @frgomes

    Hello, any idea why SBT cannot find macroid 2.1.0 ?

    [info] Resolving org.macroid#macroid-viewable_2.11;2.1.0 ...
    [warn]  module not found: org.macroid#macroid-viewable_2.11;2.1.0
    [warn] ==== local: tried
    [warn]   /home/rgomes/.ivy2/local/org.macroid/macroid-viewable_2.11/2.1.0/ivys/ivy.xml
    [warn] ==== public: tried
    [warn]   https://repo1.maven.org/maven2/org/macroid/macroid-viewable_2.11/2.1.0/macroid-viewable_2.11-2.1.0.pom
    [warn] ==== local-preloaded-ivy: tried
    [warn]   /home/rgomes/.sbt/preloaded/org.macroid/macroid-viewable_2.11/2.1.0/ivys/ivy.xml
    [warn] ==== local-preloaded: tried
    [warn]   file:////home/rgomes/.sbt/preloaded/org/macroid/macroid-viewable_2.11/2.1.0/macroid-viewable_2.11-2.1.0.pom
    [warn] ==== google libraries: tried
    [warn]   file:/home/rgomes/tools/sdk-tools-linux-4333796/extras/google/m2repository/org/macroid/macroid-viewable_2.11/2.1.0/macroid-viewable_2.11-2.1.0.pom
    [warn] ==== android libraries: tried
    [warn]   file:/home/rgomes/tools/sdk-tools-linux-4333796/extras/android/m2repository/org/macroid/macroid-viewable_2.11/2.1.0/macroid-viewable_2.11-2.1.0.pom
    [warn] ==== sonatype-releases: tried
    [warn]   https://oss.sonatype.org/content/repositories/releases/org/macroid/macroid-viewable_2.11/2.1.0/macroid-viewable_2.11-2.1.0.pom
    [warn] ==== jcenter: tried
    [warn]   http://jcenter.bintray.com/org/macroid/macroid-viewable_2.11/2.1.0/macroid-viewable_2.11-2.1.0.pom
    [warn] ==== Sonatype OSS Releasess: tried
    [warn]   https://oss.sonatype.org/content/repositories/releases/org/macroid/macroid-viewable_2.11/2.1.0/macroid-viewable_2.11-2.1.0.pom
    [info] Resolving jline#jline;2.14.3 ...
    [warn]  ::::::::::::::::::::::::::::::::::::::::::::::
    [warn]  ::          UNRESOLVED DEPENDENCIES         ::
    [warn]  ::::::::::::::::::::::::::::::::::::::::::::::
    [warn]  :: org.macroid#macroid_2.11;2.1.0: not found
    [warn]  :: org.macroid#macroid-viewable_2.11;2.1.0: not found
    [warn]  ::::::::::::::::::::::::::::::::::::::::::::::

    This is my build.sbt:

    import android.Keys._
    import android.Dependencies.{LibraryDependency, aar}
    
    enablePlugins(AndroidApp)
    
    platformTarget in Android := "android-22"
    
    name := "example"
    
    scalaVersion := "2.11.12"
    
    resolvers ++= Seq(
      Resolver.sonatypeRepo("releases"),
      "jcenter" at "http://jcenter.bintray.com",
      "Sonatype OSS Releasess" at "https://oss.sonatype.org/content/repositories/releases"
    )
    
    javacOptions ++= Seq("-source", "1.7", "-target", "1.7")
    scalacOptions ++= Seq("-feature", "-deprecation", "-target:jvm-1.7")
    
    libraryDependencies ++= Seq(
      aar("org.macroid" %% "macroid" % "2.1.0"),
      aar("org.macroid" %% "macroid-viewable" % "2.1.0"),
      aar("com.android.support" % "support-v4" % "24.0.0")
    )
    
    proguardScala in Android := true
    
    proguardOptions in Android ++= Seq(
      "-ignorewarnings",
      "-keep class scala.Dynamic"
    )