Comments (27)
Certainly, common.scala has too many things to be easily grasp the overall structure. Splitting the source code file would be a natural solution to overcome this.
However, current version of the library actually has no version :D and not packaged yet. I will versioning it and upload it to the central maven repository. Then, I will split the file after that.
You also mentioned that re-positioning the helper classes to have the same package structure of Android API. I think this will arise a problem that the user always should import packages as a wildcard such as import android.view._
. Otherwise, Scaloid implicit conversion for getter/setters will not work. I made Scaloid to be used easily as possible. I believe that everything is functioning by just add single line of code (import org.scaloid.common._
) is a quite important part of the library.
However, I might be missing something. Let me know if you have any comment.
from scaloid.
Scaloid is now released to the central maven repository.
from scaloid.
Nice!
For modularization with single line import support, we can group them into traits and provide single object extending all of them.
here's an example from Scalaz. You can import all of scalaz features at once by:
import scalaz.Scalaz._
from scaloid.
Thank you for a good recommendation. I will split the file someday later, but I have to focus on enhancing features for now. I will let this issue is stay opened until then.
from scaloid.
NIce suggestion @guersam. I think the earlier the project is modularized the better.
from scaloid.
Current snapshot code is now subdivided into several groups. Therefore broken binary compatibility.
from scaloid.
3 months passed, a lot more interesting things are added - thanks again!
- Once again, Widget.scala has grown huge and it's hard to navigate. My suggestion is to move all widgets to
org.scaloid.widget
package and group them into corresponding traits living in there own files as described in UI section of Google Android API Guides. - What was your initial idea of
common
package? If you want to cover overall Android API, it would be better to replace it with corresponding Android package names. We can still provide one-line import feature using the same technique.
I'm considering opening a pull request with initial structure including empty traits, but it must break the source compatibility so maybe I have to do this in my own fork.
Do you have any idea?
from scaloid.
Widget.scala
is automatically generated from in-house template generator, in which I did not decided whether open-source it or not. Templating will boost adapting API changes as the Android API evolves. Splitting the file will involves huge refactoring on the template generator.
When I named common
package, I thought that Scaloid will be grown to be common things and optional things.
Although Scaloid does not have optional things yet, I reserved the third-level namespace for it.
Splitting it with corresponding Android package name also involves refactoring the template generator.
I understand the importance of modular file and package layout. However, Because I have no sponsor on this project, I am very limited about working hour on Scaloid. I have to prioritize new features and documents.
I will stay this issue opened until I actually done it.
from scaloid.
Sounds reasonable.
I'm still interested in modularization including package separation and multi-project implementation using SBT or Maven, like scaloid-common
, scaloid-support
, scaloid-extra
or etc.
Could you explain a little bit about how your template generator works? Currently preparing for API change is not my main interest so I might reorganize current generated code manually, but implementing macro-based Android API wrapper (directly or via SBT plugin) is one of my (maybe far..) future plans. I need a lot to study though....
But I also respect this project's priorities. Please let me know if there's something I can help.
from scaloid.
Thanks guersam for your help!
I think that Scaloid need to be more easy and intuitive for normal Java+Android developers. There are some novel ideas that can be unfamiliar for them such as UI-layout-without-XML. So I am more focused on writing documents and publicize it to make Scaloid's advantages are more clearly understandable.
There are a lot of getter/setter wrappers in Widget.scala
. All of these are generated by my in-house generator. I wrote it with PHP, because it is quick to write :-D
I have written Scaloid with a passion. However, open source cannot sustain without some financial support. Some of these are (1) self-donation from the developer (2) getting sponsor, and (3) commercializing additional components or services.
Currently, I am donating my time to Scaloid. If this project proven to be worthwhile for many peoples, method (2) or (3) should be considered.
Additional packages that covers compatibility support library or other extra goodies are some kind of the strategy (3). So I did not open-sourced the generator.
from scaloid.
I see. It must be great if you get (2) to boost up..
I've been interested in proceeding with my own Scaloid fork, but it would be bad for your financial strategies.
I'm not much experienced in hosting open-source projects, (even not in closed-source) but having more committers might be an alternative to save your time (afraid of time for code review though..)
What do you think about Scaloid's license?
from scaloid.
It is always great to have many commiters for open source project. And it is also nice to have forks that implements great idea. However, cooperation is better than working separately. Please let me know your plan to grow your fork.
Scaloid is Apache 2.0 license.
from scaloid.
Thanks, I agree on your point.
Currently Fragment with compatibility support is the most useful feature
for me but it's nice to have yet.
Would you find it useful if there's a SBT widget generator stated above?
It's still my main interest as a Scala/Android novice, but it must break
backward compatibility so that's why I mentioned another fork.
from scaloid.
Wrapper generator based on sbt would be a great idea! I want to help develop it, although I am novice about sbt.
from scaloid.
I could likely assist in converting your PHP generator to Scala code (for
use as an SBT plugin, or to be run separately).
On Mon, Apr 29, 2013 at 5:21 AM, Sung-Ho Lee [email protected]:
Wrapper generator based on sbt would be a great idea! I want to help
develop it, although I am novice about sbt.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/2#issuecomment-17156879
.
from scaloid.
Great! Because you are promised to help improving the generator, I will open the source under Apache license.
I will post a link to a new repository in a few days.
from scaloid.
I'm interested in contributing to the generator's conversion too. I still remember my
PHP lol
from scaloid.
Thanks @placrosse, @fayimora :)
Current stable SBT (0.12.3) is built in Scala 2.9.2 which is not shipped with macro by default. In this situation, converting existing generator to Scala will be a good bridge. SBT documentation has Generate sources section, and an example from shapeless is here:
from scaloid.
I created scaloid-stamper project.
I just needed a working result quickly, so please understand that this is far from neat code.
from scaloid.
I think Step 1 is to convert the generator to Scala such that it produces
the exact same code now produced by the PHP generator. This makes it easy
to determine that it is working properly by simply comparing the source
code files output from each.
Once we have that, then we can proceed to make additions to the generator
(for higher level Android APIs, etc.).
Comments?
Sung-Ho, do you want this done in the scaloid-stamper project, or added
into the scaloid project itself as part of its SBT build? If we add it to
scaloid, someone can checkout a single project to create their own scaloid
library jar instead of two projects and separate steps. If we did this,
the source files that come out of the new generator would no longer be part
of the checked-in source, but instead could be built during the SBT run
before the overall compilation.
On Wed, May 1, 2013 at 1:11 AM, Sung-Ho Lee [email protected]:
I created scaloid-stamper projecthttps://github.com/pocorall/scaloid-stamper
.I just needed a working result quickly, so please understand that this is
far from neat code.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/2#issuecomment-17269001
.
from scaloid.
Currently I'm working on SBT version of the generator using StringTemplate4.
The templates are moved to src/main/st
and will be converted during compilation into src_managed
under target
directory, which is not included in original source dir. If you want to include generated sources under src/main
, adding copy phase in SBT is pretty easy.
from scaloid.
If you don't want to add any external dependency, please let me know before I get too far.
from scaloid.
Either approach should work fine. Upon consideration, the Android API
doesn't change that quickly, so publishing the generator as a separate SBT
plugin shouldn't hinder anything.
On Wed, May 1, 2013 at 8:29 AM, guersam [email protected] wrote:
If you don't want to add any external dependency, please let me know
before I get too far.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/2#issuecomment-17279160
.
from scaloid.
IMHO, gathering related sources into one repository makes newcomers easier to understand & contribute unless the codebase is huge. But I see your point and agree on it.
from scaloid.
I also like prefer the single repository approach, to the point of also
including and "examples" directory. Since the goal is to make Android
development with Scala simple, and I believe we can do that to the point
where it is much easier than even the other (Java-based) alternatives,
On Wed, May 1, 2013 at 8:53 AM, guersam [email protected] wrote:
IMHO, gathering related sources into one repository makes newcomers easier
to understand & contribute unless the codebase is huge. But I see your
point and agree on it.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/2#issuecomment-17279973
.
from scaloid.
@guersam Using stringTemplate is awesome! Looking forward your initial contribution.
I also think that single repository or separated one has its own pros and cons. And also agree on starting as a separated plugin.
from scaloid.
Although still having much more to automate, now we seem to have new basement to go further.
My ideas are:
- Flatten Android packages into corresponding files like
Widget.scala
,Inputmethodservice.scala
underorg.scaloid.common
package. To keep single-point import support, we can make lowercase, underscored file names to flatten inner packages or just put them into parent files. - Delete
trait WidgetFamily
and bring the members out toWidget.scala
. Non-package members ofandroid.widget
will be moved into their own files. - Keep
package.scala
small to have only necessary members.
from scaloid.
Related Issues (20)
- Fragments with Sviews HOT 1
- TypedResource(TR) Reload HOT 1
- SArrayAdapter cannot be added to after initialization HOT 2
- java.lang.IllegalArgumentException: Lint HOT 2
- Scaloid with Akka/Play Json or spray HOT 1
- Event gravity does not take parameters or application crashs HOT 9
- sbt android:package HOT 1
- Broken inheritance between S[...] objects (like SView or SLinearlayout) HOT 1
- broadcastReceiver function for String argument inconsistent with the function taking IntentFilter HOT 2
- STextView "here" not working with textSize defined HOT 1
- API 8, 9 support using Scala 2.10 and Scaloid 3.3 HOT 3
- Anko style HOT 1
- String resources getting mixed up when using Java + Scaloid? HOT 2
- problem code `def >> : V = v` HOT 4
- How to dynamically add view components to SLinearLayout or SVerticalLayout HOT 1
- How to initialize LocalServiceConnection from a fragment HOT 2
- no method getVisibleTitleHeight in android.webkit.WebView HOT 2
- How to use dependency injection in an activity. HOT 2
- How is this library implemented? HOT 4
- Performence issue of Scala on android (may not be related to scaloid) HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scaloid.