Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for multiple devices and standard resources #37

Open
rxx opened this issue May 21, 2013 · 8 comments
Open

Support for multiple devices and standard resources #37

rxx opened this issue May 21, 2013 · 8 comments
Labels

Comments

@rxx
Copy link
Contributor

rxx commented May 21, 2013

Hello, I've looked on scaloid layouts without xml and I have some questions:

  • How do you imagine support multiple devices, tablets?
    In standart we can create similar xml files in children resource folders
    I mean this http://developer.android.com/guide/practices/screens_support.html
  • I think we should create some features for standard resources: strings(localization), dimensions, colors, etc if we don't want to use standard xml files
  • Auto build android manifest: add activities, services, permissions?
    With sbt or some scala script
@pocorall
Copy link
Owner

The approach that Scaloid advocate is ui-layout-without-xml, not replacing every kind of xml descriptions. Use your resources as described in Android developer guide.

Although I suggest that marking up layout with normal Scala code, Scaloid is fully compatible with xml layout. If your project's layouts are already written in xml, you can freely access it from Scala code:

val button = find[Button](R.id.mybutton)

@rxx
Copy link
Contributor Author

rxx commented May 22, 2013

@pocorall But we could create some template engine for resources. It will be compiled to xml on runtime or on request.
Crazy idea, of course.

@pocorall
Copy link
Owner

Every great ideas is looked crazy at first. I think your idea is worthwhile. I will reopen this issue until I rewrite this idea to be more detailed.

@pocorall pocorall reopened this May 22, 2013
@rxx
Copy link
Contributor Author

rxx commented May 23, 2013

@pocorall I think it could be like haml or jade
We will decide perfomance issues for games, for example
Resource's id will be auto generated and synchronised with layouts.

Can we do it? We'll name it - Scaloml template language (scaloid + xml)

@pocorall
Copy link
Owner

Before completely replace all of the XMLs, I will firstly focus on "supporting multiple devices". Because Scaloid layout is ordinary Scala code, there are almost nothing to do to adapt multiple devices, except some if statements.

However, because many peoples requested explicit example about this, I will write some helper doing this.

@rxx
Copy link
Contributor Author

rxx commented May 27, 2013

@pocorall I requested too 😄 I just think we must separate resources variables and layouts with other code

@rxx
Copy link
Contributor Author

rxx commented May 28, 2013

@pocorall One more thing for dsl - support IDE. For now, eclipse and intellij idea help us with build android resources and write xml-layouts. If we will use only dynamic resources, we will have to build all for ourselves.
If we have some standard rules for build layouts with scala we can create custom plugins for idea and eclipse for example. It is a not first-priority goal but we can look out it

@pocorall
Copy link
Owner

For statical analysis purpose, declarative language (e.g. XML and JSON) is better than procedural language (e.g. Java and Scala). For some alternative methods replacing XMLs, such as SBT and Spring Java Config, difficulty of IDE support is a major weakness.

As we don't have much workforce, plugin development will be an issue of someday in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants