Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit fd6c8bc
Showing
9 changed files
with
148 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*.zip | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Want to keep back-compatability? <a href="http://actionbarsherlock.com/">ActionBarSherlock</a> is here to help |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
$("#tool input").change(function(){ generate(); }).keyup(function(){ generate(); });; | ||
generate(); | ||
|
||
function c(i){ | ||
if($(i + ":checked").length == 0) | ||
return false; | ||
return true; | ||
} | ||
|
||
function generate(){ | ||
code = "Calendar calendar = Calendar.getInstance();\n"; | ||
code += "calendar.setTimeInMillis(System.currentTimeMillis());\n"; | ||
if($("#hours").val() != ""){ | ||
code += "calendar.add(Calendar.HOUR, " + $("#hours").val() + ");\n"; | ||
} if($("#mins").val() != ""){ | ||
code += "calendar.add(Calendar.MINUTE, " + $("#mins").val() + ");\n"; | ||
} if($("#secs").val() != ""){ | ||
code += "calendar.add(Calendar.SECOND, " + $("#secs").val() + ");\n"; | ||
} | ||
code += "alm.set"; | ||
if(c("#repeat")){ | ||
code += "Repeating"; | ||
} else if(c("#repeat_in")){ | ||
code += "InexactRepeating"; | ||
} | ||
code += "(AlarmManager.RTC, getTimeInMillis()"; | ||
if(c("#once")){ | ||
$("#repeatopts").hide(200); | ||
} else{ | ||
code += ", "; | ||
if(c("#in_hour")){ | ||
code += "AlarmManager.INTERVAL_HOUR"; | ||
} else if(c("#in_hhour")){ | ||
code += "AlarmManager.INTERVAL_HALF_HOUR"; | ||
} else if(c("#in_15")){ | ||
code += "AlarmManager.INTERVAL_FIFTEEN_MINUTES"; | ||
} else if(c("#in_day")){ | ||
code += "AlarmManager.INTERVAL_DAY"; | ||
} else if(c("#in_hday")){ | ||
code += "AlarmManager.INTERVAL_HALF_DAY"; | ||
} | ||
$("#repeatopts").show(200); | ||
} | ||
code += ", pendingIntent);"; | ||
$("#thecode").html(code); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<h2>Code Generator:</h2> | ||
<div id="tool"> | ||
Okay, so I've called my <a href="http://developer.android.com/reference/android/app/AlarmManager.html">AlarmManager</a> <code>alm</code>.<br/> | ||
I want an alarm which:<br/> | ||
<input type="radio" checked id="repeat" name="repeat"/><label for="repeat">Repeats exactly</label><br/> | ||
<input type="radio" id="repeat_in" name="repeat"/><label for="repeat_in">Repeats inexactly <span class="label success" title="Use this if you need to repeat operations and it is not absolutely crucial for those to run on time (for example, weather)">Good for battery life!</span></label><br/> | ||
<input type="radio" id="once" name="repeat"/><label for="once">Exactly on time</label><br/> | ||
And I want it to run first of all in <input placeholder="none" style="width:50px" id="hours"/> hours, <input id="mins" style="width:50px" placeholder="none"/> minuites and <input id="secs" value="5" placeholder="none" style="width:50px"/> seconds.<br/> | ||
<div id="repeatopts"> | ||
It needs to repeat every (if you need a custom, just replace the final result with your interval in microseconds (seconds * 1000) ):<br/> | ||
<input type="radio" checked id="in_hour" name="in"/><label for="in_hour">hour</label><br/> | ||
<input type="radio" id="in_hhour" name="in"/><label for="in_hhour">half hour</label><br/> | ||
<input type="radio" id="in_15" name="in"/><label for="in_15">15 mins</label><br/> | ||
<input type="radio" id="in_day" name="in"/><label for="in_day">day</label><br/> | ||
<input type="radio" id="in_hday" name="in"/><label for="in_hday">half a day</label><br/> | ||
</div> | ||
And the code is going to be roughly (updating whenever you do): | ||
<pre id="thecode"> | ||
// Please set something | ||
</pre> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<strong>Tip from Android G+ Developers:</strong> | ||
If you just want to keep the screen on, don't use a Wake Lock just use <a href="http://developer.android.com/reference/android/view/View.html#setKeepScreenOn(boolean)">View.setKeepScreenOn</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<p> | ||
This is really useful for glowable edges. You can rotate the canvas before drawing, which allows you to move the glow. By default it glows from the top edge. | ||
</p> | ||
<p> | ||
You can automate a glow by having a float value, increasing on <code>draw()</code>, and calling <code>onPull()</code> until a sepecified value, then <code>onRelease</code>. | ||
</p> |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"name": "Android Developer Improvements", | ||
"version": "1", | ||
"description": "New stuff for Android Devs", | ||
"permissions": [ | ||
"http://developer.android.com/" | ||
], | ||
"homepage_url": "http://kennydude.me", | ||
"content_scripts": [ | ||
{ | ||
"matches": ["http://developer.android.com/*"], | ||
"js": ["jquery.min.js","page.js"], | ||
"all_frames": true | ||
} | ||
] | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// AndroidAdditions | ||
|
||
function l(h, t, x_id){ | ||
// load item | ||
$.get(chrome.extension.getURL("content/" + h + "/"+t+".txt"), function(d, x, e){ | ||
$("<div>").addClass("aa-class-op").html(d).appendTo(".add-id-" + x_id); | ||
}); | ||
} | ||
|
||
$(document).ready(function(){ | ||
p = document.location.pathname.substr(1); | ||
p = p.split("/"); | ||
if(p[0] == "reference"){ | ||
// Reference guide | ||
// Remove ref | ||
p = jQuery.grep(p, function(k,value) { | ||
return value != 0; | ||
}); | ||
|
||
// Get rid of .html properly | ||
x = p[p.length-1].split("."); | ||
x = jQuery.grep(x, function(value) { | ||
return value != "html"; | ||
}); | ||
p[p.length-1] = x.join("."); | ||
|
||
h = p.join("."); | ||
|
||
// Request Class Overview | ||
$.get(chrome.extension.getURL("content/" + h + "/class-ov.txt"), function(d){ | ||
$("<div>").addClass("aa-class-ov").html("<h1>Android Additions Notes</h1>" + d).insertAfter(".jd-descr:first"); | ||
}, "text"); | ||
$.get(chrome.extension.getURL("content/" + h + "/class-ov.js"), function(){}, "script"); | ||
|
||
// Get all the detail extras | ||
var id = 0; | ||
$(".jd-details").each(function(){ | ||
t = $(".jd-details-title", this).clone(); | ||
$("span.normal", t).remove(); | ||
t = t.text().trim(); | ||
$(this).addClass("add-id-" + id); | ||
x_id = id; | ||
id = id+1; | ||
|
||
l(h, t, x_id); | ||
}); | ||
} | ||
}); |