README-fragmentview.txt
1<!--
2 Copyright 2013 The Android Open Source Project
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15-->
16
17Steps to implement FragmentView template:
18-in template-params.xml.ftl:
19 -add the following line to common imports
20 <common src="activities"/>
21
22-Add a Fragment to show behavior. In your MainActivity.java class, it will reference a Fragment
23 called (yourProjectName)Fragment.java. Create that file in your project, using the "main" source
24 folder instead of "common" or "templates".
25 For instance, if your package name is com.example.foo, create the file
26 src/main/java/com/example/foo/FooFragment.java
27
28
29-Within this fragment, make sure that the onCreate method has the line
30 "setHasOptionsMenu(true);", to enable the fragment to handle menu events.
31
32-In order to override menu events, override onOptionsItemSelected.
33
34-refer to sampleSamples/fragmentViewSample for a reference implementation of a
35project built on this template.
36
37
38
README-singleview.txt
1<#--
2 Copyright 2015 The Android Open Source Project
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15-->
16
17Steps to implement SingleView template:
18-in template-params.xml.ftl:
19 -add the following line to common imports
20 <common src="activities"/>
21
22 -add a string for the action button's text using the element name "sample_action".
23 This element should be a child of <strings>:
24 <strings>
25 ...
26 <sample_action>ButtonText</sample_action>
27 ...
28 </strings>
29
30
31
32-Add a Fragment to handle behavior. In your MainActivity.java class, it will reference a Fragment
33 called (yourProjectName)Fragment.java. Create that file in your project, using the "main" source
34 folder instead of "common" or "templates".
35 For instance, if your package name is com.example.foo, create the file
36 src/main/java/com/example/foo/FooFragment.java
37
38
39-Within this fragment, make sure that the onCreate method has the line
40 "setHasOptionsMenu(true);", to enable the fragment to handle menu events.
41
42-In order to override menu events, override onOptionsItemSelected.
43
44-refer to sampleSamples/singleViewSample for a reference implementation of a
45project built on this template.
46
47
48