Skip to content

Commit

Permalink
Merge pull request #16 from Helmisek/patch-1
Browse files Browse the repository at this point in the history
Changed Android Studio template
  • Loading branch information
jakubkinst committed Feb 3, 2017
2 parents 429e18d + 978b9b8 commit 648da62
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
to="${escapeXmlAttribute(resOut)}/layout/${layoutName}.xml" />

<instantiate from="root/src/app_package/Screen.java.ftl"
to="${escapeXmlAttribute(srcOut)}/${screenClass}.java" />
to="${escapeXmlAttribute(srcOut)}/${scrPackage}/${screenClass}.java" />

<instantiate from="root/src/app_package/ViewModel.java.ftl"
to="${escapeXmlAttribute(srcOut)}/${viewModelClass}.java" />
to="${escapeXmlAttribute(srcOut)}/${vmPackage}/${viewModelClass}.java" />

<open file="${escapeXmlAttribute(srcOut)}/${screenClass}.java" />
<open file="${escapeXmlAttribute(resOut)}/layout/${layoutName}.xml" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" >

<application>
<activity android:name="${relativePackage}.${screenClass}"
<activity android:name="${relativePackage}.<#if scrPackage != "">${scrPackage}.</#if>${screenClass}"
<#if isNewProject>
android:label="@string/app_name"
<#else>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ${packageName};
package ${packageName}<#if scrPackage != "">.${scrPackage}</#if>;

<#if screenType == "Fragment">
import android.os.Bundle;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ${packageName};
package ${packageName}<#if vmPackage != "">.${vmPackage}</#if>;

import android.databinding.ObservableField;
import android.view.View;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<variable
name="viewModel"
type="${packageName}.${viewModelClass}"/>
type="${packageName}.<#if vmPackage != "">${vmPackage}.</#if>${viewModelClass}"/>
</data>
<#if useStatefulLayout>
<cz.kinst.jakub.view.StatefulLayout
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,18 @@
constraints="package"
default="com.mycompany.myapp" />

<parameter
id="vmPackage"
name="View Model Package name"
type="string"
default="viewmodel" />

<parameter
id="scrPackage"
name="Screen Package name"
type="string"
default="activity" />

<!-- 128x128 thumbnails relative to template.xml -->
<thumbs>
<!-- default thumbnail is required -->
Expand Down

0 comments on commit 648da62

Please sign in to comment.