-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathindex.html
330 lines (316 loc) · 14.3 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
<!DOCTYPE html>
<html>
<head>
<title>Android Layout Finder | Buzzing Android</title>
<meta name="description"
content="A free and fast online tool for generating Java code for your Android XML layouts.">
<script type="text/javascript" src="js/lib/jquery-1.8.3.min.js"></script>
<!--<script type="text/javascript" src="js/lib/jquery.zclip.min.js"></script>-->
<script type="text/javascript" src="js/lib/jquery-ui.custom.js"></script>
<script type="text/javascript" src="js/lib/jquery.cookie.js"></script>
<link rel='stylesheet' type='text/css' href='css/ui.dynatree.css'>
<link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
<script type="text/javascript" src="js/lib/jquery.dynatree.min.js"></script>
<script src="js/lib/bootstrap.min.js"></script>
<script type="text/javascript" src="js/parser.js"></script>
<script type="text/javascript" src="js/code_generators.js"></script>
<link rel='stylesheet' type='text/css' href='css/style.css'>
<!-- SHARE THIS -->
<script type="text/javascript">var switchTo5x=true;</script>
<script type="text/javascript"
src="http://w.sharethis.com/button/buttons.js"></script>
<script type="text/javascript">
stLight.options({doNotCopy:true});
-->
</script>
</head>
<body>
<div class="container-fluid">
<div class="row-fluid">
<div class="span8">
<h1>
Android Layout Finder | <a href="http://www.buzzingandroid.com">Buzzing
Android</a>
</h1>
<p class="lead">The Android Layout Finder helps you create the
code that ties your Android UI and Java code together.</p>
<p class="lead">It's real easy! Just paste your Android XML
layout code in the first text field, pick the views that you need,
and your code is automatically generated for you.</p>
<p class="lead">No more typing out all those nearly identical
findViewById() and findFragmentById() calls in your activities or
fragments whenever you change your Android layouts.</p>
</div>
</div>
<div class="row-fluid">
<div class="span8" id="main">
<div id="step_1">
<h3 class="three_header three_header_first">1. Enter Android
XML Layout:</h3>
<p class="three_header_tip">Paste in your Android XML Layout
code</p>
<textarea rows="10" class="input-block-level" id="xml_input">
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout android:id="@+id/RLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<TextView android:id="@+id/lblComments"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="Comments"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true" />
<EditText android:id="@+id/txtComments"
android:layout_width="fill_parent" android:layout_height="170px"
android:textSize="18sp"
android:layout_alignLeft="@+id/lblComments"
android:layout_below="@+id/lblComments"
android:layout_centerHorizontal="true" />
<Button android:id="@+id/btnSave" android:layout_width="125px"
android:layout_height="wrap_content" android:text="Save"
android:layout_below="@+id/txtComments"
android:layout_alignRight="@+id/txtComments" />
<Button android:id="@+id/btnCancel" android:layout_width="124px"
android:layout_height="wrap_content" android:text="Cancel"
android:layout_below="@+id/txtComments"
android:layout_alignLeft="@+id/txtComments" />
</RelativeLayout>
</textarea>
</div>
<div id="step_2">
<h3 class="three_header">2. Pick your Views:</h3>
<p class="three_header_tip">Select the views that you need to
interact with</p>
<div id="tree_alert"></div>
<div id="tree"></div>
</div>
<div id="step_3">
<h3 class="three_header">
3. Get your Java code:
<!-- <button class="btn" id="button_copy_java"><img src="img/icon-copy.png" /> Copy to clipboard</button>-->
</h3>
<p class="three_header_tip">Click on the code to select the
entire text</p>
<div id="code_alert"></div>
<pre id="output">public class MyCursorAdapter extends CursorAdapter {
private static class ViewHolder {
public final RelativeLayout rootView;
public final RelativeLayout RLayout;
public final TextView lblComments;
public final EditText txtComments;
public final Button btnSave;
public final Button btnCancel;
private ViewHolder(RelativeLayout rootView, RelativeLayout RLayout, TextView lblComments, EditText txtComments, Button btnSave, Button btnCancel) {
this.rootView = rootView;
this.RLayout = RLayout;
this.lblComments = lblComments;
this.txtComments = txtComments;
this.btnSave = btnSave;
this.btnCancel = btnCancel;
}
public static ViewHolder create(RelativeLayout rootView) {
RelativeLayout RLayout = (RelativeLayout)rootView.findViewById( R.id.RLayout );
TextView lblComments = (TextView)rootView.findViewById( R.id.lblComments );
EditText txtComments = (EditText)rootView.findViewById( R.id.txtComments );
Button btnSave = (Button)rootView.findViewById( R.id.btnSave );
Button btnCancel = (Button)rootView.findViewById( R.id.btnCancel );
return new ViewHolder( rootView, RLayout, lblComments, txtComments, btnSave, btnCancel );
}
}
@Override
public void bindView(View view, Context context, Cursor cursor) {
ViewHolder vh = (ViewHolder)view.getTag();
// Bind your data to the views here
}
@Override
public View newView(Context context, Cursor cursor, ViewGroup parent) {
View view = inflater.inflate( R.layout.listitem, parent, false );
view.setTag( ViewHolder.create( (RelativeLayout)view ) );
return view;
}
private LayoutInflater inflater;
// Constructors
public MyCursorAdapter(Context context, Cursor c, boolean autoRequery) {
super(context, c, autoRequery);
this.inflater = LayoutInflater.from( context );
}
public MyCursorAdapter(Context context, Cursor c, int flags) {
super(context, c, flags);
this.inflater = LayoutInflater.from( context );
}
}</pre>
<!-- <textarea rows="10" id="output" class="input-block-level"></textarea> -->
</div>
</div>
<div class="span4" id="menu">
<h5 class="menu_header">General settings</h5>
<div class="menu_fragment">
<form class="form-inline" id="setting_support">
<label class="checkbox"> <input type="checkbox"
id="chk_support" /> Use support package
</label> <img src="img/icon-help.png" style="margin-left: 5px"
id="help_support" />
</form>
<form class="form-inline" style="margin-top: 15px"
id="setting_includepackage">
<label class="checkbox"> <input type="checkbox"
id="chk_includepackage" /> Use full package name for custom
views
</label>
</form>
<form class="form-inline" style="margin-top: 15px"
id="setting_dontcamelcase">
<label class="checkbox"> <input type="checkbox"
id="chk_dontcamelcase" /> Don't convert underscores to camelCase
</label>
</form>
<form class="form-inline" style="margin-top: 15px"
id="setting_removeidprefix">
<input type="text" id="edt_removeidprefix" class="input-large"
placeholder="Remove ID prefix (None)"> <img src="img/icon-help.png" style="margin-left: 5px"
id="help_removeidprefix" />
</form>
<form class="form-inline" style="margin-top: 15px"
id="setting_varprefix">
<input type="text" id="edt_varprefix" class="input-large"
placeholder="Variable prefix (None)">
</form>
</div>
<h5 class="menu_header">Output settings</h5>
<div class="menu_fragment">
<strong>Generated code type:</strong> <label class="radio"
style="margin-top: 5px"> <input type="radio"
name="radio_codetype" id="radio_codetype_mv"
value="Member variables" checked> Member variables
</label> <label class="radio"> <input type="radio"
name="radio_codetype" id="radio_codetype_vh"
value="ViewHolder pattern"> ViewHolder pattern (<a
href="http://www.jmanzano.es/blog/?p=166" target="_blank">Link</a>)
</label><label class="radio"> <input type="radio"
name="radio_codetype" id="radio_codetype_aa"
value="ArrayAdapter with ViewHolder"> ArrayAdapter with
ViewHolder
</label><label class="radio"> <input type="radio"
name="radio_codetype" id="radio_codetype_ca"
value="CursorAdapter with ViewHolder"> CursorAdapter with
ViewHolder
</label><label class="radio"> <input type="radio"
name="radio_codetype" id="radio_codetype_rg" value="RoboGuice">
RoboGuice
</label>
<form class="form-inline" style="margin-top: 15px"
id="setting_mv_parentviewparam">
<label class="checkbox"> <input type="checkbox" id="chk_mv_parentviewparam" />
Pass root view as method parameter</label>
</form>
<form class="form-inline" style="margin-top: 15px"
id="setting_mv_parentview">
<input type="text" id="edt_mv_parentview" class="input-large"
placeholder="Custom view root variable"><img
style="margin-left: 10px" src="img/icon-help.png"
id="help_mv_parentview" />
</form>
<form class="form-inline" style="margin-top: 15px"
id="setting_mv_clicklisteners">
<label class="checkbox"> <input type="checkbox" id="chk_mv_clicklisteners" checked />
Implement ClickListeners for Buttons and ImageButtons</label>
</form>
<form class="form-inline" style="margin-top: 15px"
id="setting_vh_classname">
<input type="text" id="edt_vh_classname" class="input-large"
placeholder="Class name (ViewHolder)">
</form>
<form class="form-inline" style="margin-top: 15px"
id="setting_vh_visibility">
<p>Visibility:</b><br/>
<label class="radio inline"><input type="radio" name="radio_vh_visibility" id="radio_vh_visibility_private" checked />private</label>
<label class="radio inline"><input type="radio" name="radio_vh_visibility" id="radio_vh_visibility_default" />default</label>
<label class="radio inline"><input type="radio" name="radio_vh_visibility" id="radio_vh_visibility_protected" />protected</label>
<label class="radio inline"><input type="radio" name="radio_vh_visibility" id="radio_vh_visibility_public" />public</label>
</form>
<form class="form-inline" style="margin-top: 15px"
id="setting_aa_classname">
<input type="text" id="edt_aa_classname" class="input-large"
placeholder="Class name (MyArrayAdapter)">
</form>
<form class="form-inline" style="margin-top: 15px"
id="setting_aa_arraytype">
<input type="text" id="edt_aa_arraytype" class="input-large"
placeholder="Generic type (Object)">
</form>
<form class="form-inline" style="margin-top: 15px"
id="setting_ca_classname">
<input type="text" id="edt_ca_classname" class="input-large"
placeholder="Class name (MyCursorAdapter)">
</form>
<form class="form-inline" style="margin-top: 15px"
id="setting_layoutres">
<input type="text" id="edt_layoutres" class="input-large"
placeholder="Layout resource ID (listitem)">
</form>
<form class="form-inline" style="margin-top: 15px"
id="setting_ca_constructors">
<p>Constructors:</b><br/>
<label class="radio inline"><input type="radio" name="radio_ca_constructors" id="radio_ca_constructors_simple" checked />Simple</label>
<label class="radio inline"><input type="radio" name="radio_ca_constructors" id="radio_ca_constructors_default" />Default</label>
<label class="radio inline"><input type="radio" name="radio_ca_constructors" id="radio_ca_constructors_all" />All</label>
</form>
<form class="form-inline" style="margin-top: 15px"
id="setting_rg_linebreak">
<label class="checkbox"> <input type="checkbox"
id="chk_rg_linebreak" /> Break lines after @InjectView
</label>
</form>
</div>
<h5 class="menu_header">Example</h5>
<div class="menu_fragment">
<button class="btn" id="button_example">Paste example XML</button>
</div>
<h5 class="menu_header">Share this</h5>
<div class="menu_fragment">
<span class='st_facebook_large' displayText='Facebook'></span> <span
class='st_twitter_large' displayText='Tweet'></span> <span
class='st_googleplus_large' displayText='Google +'></span> <span
class='st_linkedin_large' displayText='LinkedIn'></span> <span
class='st_pinterest_large' displayText='Pinterest'></span> <span
class='st_email_large' displayText='Email'></span>
</div>
<h5 class="menu_header">Bitcoin donations</h5>
<div class="menu_fragment">
Please help support Buzzing Android by donating bitcoins:<br />
<a href="bitcoin:112xgkZJYn2PKiV42YCxgB83xfVJynGrsg"><img src="img/donation-qr.png" style="height:132px;width:132px;"/><br/>
<tt>112xgkZJYn2PKiV42YCxgB83xfVJynGrsg</tt></a>
</div>
<h5 class="menu_header">Comments and suggestions</h5>
<div class="menu_fragment">
<p>If you have any comments or suggestions to this tool, please leave a message <strong><a href="http://www.buzzingandroid.com/2013/01/android-layout-finder-online-tool/" title="Android Layout Finder online tool | Buzzing Android">here</a></strong>.</p>
</div>
</div>
</div>
<div class="row-floud">
<div class="span12" style="text-align: center; margin-top: 20px">
<small>Android Layout finder is made by <a
href="http://www.buzzingandroid.com">Jesper Borgstrup</a> 2013.
Using <a href="http://jquery.com">jQuery</a>, <a
href="http://code.google.com/p/dynatree/">Dynatree</a> and <a
href="http://twitter.github.com/bootstrap/index.html">Twitter
Bootstrap</a>.<br /> Android Layout Finder is licensed under the <a
href="http://www.gnu.org/licenses/">GNU General Public License</a>
and the source code is available at <a
href="https://github.com/jesperborgstrup/android-layout-finder">GitHub</a>.
</small>
</div>
</div>
</div>
<!-- GOOGLE ANALYTICS TRACKER CODE -->
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-36289895-1");
pageTracker._trackPageview();
} catch(err) {}</script>
</body>
</html>