3){throw new Error()}if(h[0]=="center"){if(h.length==1){h=["center","center"]}else{if(h.length==2&&h[1].match(/^[\d.]+x$/i)){h=["center","center",h[1]]}}}if(h.length==3){g=parseFloat(h[2].match(/^([\d.]+)x$/i)[1])}var j=h[0]+" "+h[1];if(j=="left top"||j=="top left"){return{xrel:0,yrel:0,zoom:g}}if(j=="left center"||j=="center left"){return{xrel:0,yrel:0.5,zoom:g}}if(j=="left bottom"||j=="bottom left"){return{xrel:0,yrel:1,zoom:g}}if(j=="center top"||j=="top center"){return{xrel:0.5,yrel:0,zoom:g}}if(j=="center center"){return{xrel:0.5,yrel:0.5,zoom:g}}if(j=="center bottom"||j=="bottom center"){return{xrel:0.5,yrel:1,zoom:g}}if(j=="right top"||j=="top right"){return{xrel:1,yrel:0,zoom:g}}if(j=="right center"||j=="center right"){return{xrel:1,yrel:0.5,zoom:g}}if(j=="right bottom"||j=="bottom right"){return{xrel:1,yrel:1,zoom:g}}return{xrel:parseInt(h[0].match(/^(\d+)%$/)[1])/100,yrel:parseInt(h[1].match(/^(\d+)%$/)[1])/100,zoom:g}}d.fn.crossSlide=function(i,k,l){var g=this,j=this.width(),h=this.height();if(g.length!=1){f("crossSlide() must be called on exactly 1 element")}g.get(0).crossSlideArgs=[i,k,l];k=d.map(k,function(m){return d.extend({},m)});if(!i.easing){i.easing=i.variant?"swing":"linear"}if(!l){l=function(){}}(function(o){var m=0;function n(q,p){p.onload=function(r){m++;k[q].width=p.width;k[q].height=p.height;if(m==k.length){o()}};p.src=k[q].src;if(q+1 ',m.src));if(m.href){y=d(e(' ',m.href)).append(s)}if(m.onclick){y.click(m.onclick)}if(m.alt){s.attr("alt",m.alt)}if(m.rel){y.attr("rel",m.rel)}if(m.href&&m.target){y.attr("target",m.target)}y.appendTo(g)}delete o;function n(D,C){var E=[0,A/(D.time_ms+2*A),1-A/(D.time_ms+2*A),1][C];return{left:Math.round(D.from.left+E*(D.to.left-D.from.left)),top:Math.round(D.from.top+E*(D.to.top-D.from.top)),width:Math.round(D.from.width+E*(D.to.width-D.from.width)),height:Math.round(D.from.height+E*(D.to.height-D.from.height))}}var u=g.find("img").css({position:"absolute",visibility:"hidden",top:0,left:0,border:0});u.eq(0).css({visibility:"visible"});if(!z){u.eq(0).css(n(k[0],i.variant?0:1))}var B=i.loop;function q(O,p){if(O%2==0){if(z){var E=O/2,S=(E-1+k.length)%k.length,P=u.eq(E),M=u.eq(S);var L=function(){l(E,P.get(0));M.css("visibility","hidden");setTimeout(p,z)}}else{var H=O/2,S=(H-1+k.length)%k.length,R=u.eq(H),M=u.eq(S),F=k[H].time_ms,N=n(k[H],i.variant?3:2);var L=function(){l(H,R.get(0));M.css("visibility","hidden");R[a](N,F,i.easing,p)}}}else{var D=Math.floor(O/2),G=Math.ceil(O/2)%k.length,Q=u.eq(D),C=u.eq(G),T={},K={visibility:"visible"},J={};if(G>D){K.opacity=0;J.opacity=1;if(i.doubleFade){T.opacity=0}}else{T.opacity=0;if(i.doubleFade){K.opacity=0;J.opacity=1}}if(!z){d.extend(K,n(k[G],0));if(!i.variant){d.extend(T,n(k[D],3));d.extend(J,n(k[G],1))}}if(d.isEmptyObject(J)){var L=function(){l(G,C.get(0),D,Q.get(0));C.css(K);Q[a](T,A,"linear",p)}}else{if(d.isEmptyObject(T)){var L=function(){l(G,C.get(0),D,Q.get(0));C.css(K);C[a](J,A,"linear",p)}}else{var L=function(){l(G,C.get(0),D,Q.get(0));C.css(K);C[a](J,A,"linear");Q[a](T,A,"linear",p)}}}}if(i.loop&&O==k.length*2-2){var I=L;L=function(){if(--B){I()}}}if(O>0){return q(O-1,L)}else{return L}}var r=q(k.length*2-1,function(){return r()});r()});return g};d.fn.crossSlideFreeze=function(){this.find("img").stop()};d.fn.crossSlideStop=function(){this.find("img").stop().remove()};d.fn.crossSlideRestart=function(){this.find("img").stop().remove();d.fn.crossSlide.apply(this,this.get(0).crossSlideArgs)};d.fn.crossSlidePause=function(){if(!d.fn.pause){f(c)}this.find("img").pause()};d.fn.crossSlideResume=function(){if(!d.fn.pause){f(c)}this.find("img").resume()}})();
\ No newline at end of file
diff --git a/actionbarsherlock/website/static/loading.gif b/actionbarsherlock/website/static/loading.gif
deleted file mode 100755
index d3b3b9fb1..000000000
Binary files a/actionbarsherlock/website/static/loading.gif and /dev/null differ
diff --git a/actionbarsherlock/website/static/loading_background.png b/actionbarsherlock/website/static/loading_background.png
deleted file mode 100755
index 6ae83e697..000000000
Binary files a/actionbarsherlock/website/static/loading_background.png and /dev/null differ
diff --git a/actionbarsherlock/website/static/logo.png b/actionbarsherlock/website/static/logo.png
deleted file mode 100755
index 2bdd61bd1..000000000
Binary files a/actionbarsherlock/website/static/logo.png and /dev/null differ
diff --git a/actionbarsherlock/website/static/logo.psd b/actionbarsherlock/website/static/logo.psd
deleted file mode 100755
index e79105a36..000000000
Binary files a/actionbarsherlock/website/static/logo.psd and /dev/null differ
diff --git a/actionbarsherlock/website/static/logo_small.png b/actionbarsherlock/website/static/logo_small.png
deleted file mode 100755
index 0c29d2441..000000000
Binary files a/actionbarsherlock/website/static/logo_small.png and /dev/null differ
diff --git a/actionbarsherlock/website/static/mascot.png b/actionbarsherlock/website/static/mascot.png
deleted file mode 100755
index 4b9b522e3..000000000
Binary files a/actionbarsherlock/website/static/mascot.png and /dev/null differ
diff --git a/actionbarsherlock/website/static/merch.png b/actionbarsherlock/website/static/merch.png
deleted file mode 100755
index 326a7176e..000000000
Binary files a/actionbarsherlock/website/static/merch.png and /dev/null differ
diff --git a/actionbarsherlock/website/static/octocat.png b/actionbarsherlock/website/static/octocat.png
deleted file mode 100755
index 2d4fa8508..000000000
Binary files a/actionbarsherlock/website/static/octocat.png and /dev/null differ
diff --git a/actionbarsherlock/website/static/overlay.png b/actionbarsherlock/website/static/overlay.png
deleted file mode 100755
index 53ea98f70..000000000
Binary files a/actionbarsherlock/website/static/overlay.png and /dev/null differ
diff --git a/actionbarsherlock/website/static/ribbon.png b/actionbarsherlock/website/static/ribbon.png
deleted file mode 100755
index 10c08f4d5..000000000
Binary files a/actionbarsherlock/website/static/ribbon.png and /dev/null differ
diff --git a/actionbarsherlock/website/static/samples/featuredemo_01_1.6.png b/actionbarsherlock/website/static/samples/featuredemo_01_1.6.png
deleted file mode 100755
index 8827f74f2..000000000
Binary files a/actionbarsherlock/website/static/samples/featuredemo_01_1.6.png and /dev/null differ
diff --git a/actionbarsherlock/website/static/samples/featuredemo_01_1.6.thumb.png b/actionbarsherlock/website/static/samples/featuredemo_01_1.6.thumb.png
deleted file mode 100755
index 9181b53e6..000000000
Binary files a/actionbarsherlock/website/static/samples/featuredemo_01_1.6.thumb.png and /dev/null differ
diff --git a/actionbarsherlock/website/static/samples/featuredemo_01_2.3.3.png b/actionbarsherlock/website/static/samples/featuredemo_01_2.3.3.png
deleted file mode 100755
index 758cedc28..000000000
Binary files a/actionbarsherlock/website/static/samples/featuredemo_01_2.3.3.png and /dev/null differ
diff --git a/actionbarsherlock/website/static/samples/featuredemo_01_2.3.3.thumb.png b/actionbarsherlock/website/static/samples/featuredemo_01_2.3.3.thumb.png
deleted file mode 100755
index ebbe66912..000000000
Binary files a/actionbarsherlock/website/static/samples/featuredemo_01_2.3.3.thumb.png and /dev/null differ
diff --git a/actionbarsherlock/website/static/samples/featuredemo_01_3.1.png b/actionbarsherlock/website/static/samples/featuredemo_01_3.1.png
deleted file mode 100755
index cb39e6532..000000000
Binary files a/actionbarsherlock/website/static/samples/featuredemo_01_3.1.png and /dev/null differ
diff --git a/actionbarsherlock/website/static/samples/featuredemo_01_3.1.thumb.png b/actionbarsherlock/website/static/samples/featuredemo_01_3.1.thumb.png
deleted file mode 100755
index 5ffebc7cb..000000000
Binary files a/actionbarsherlock/website/static/samples/featuredemo_01_3.1.thumb.png and /dev/null differ
diff --git a/actionbarsherlock/website/static/samples/featuredemo_02_1.6.png b/actionbarsherlock/website/static/samples/featuredemo_02_1.6.png
deleted file mode 100755
index b404ff9f7..000000000
Binary files a/actionbarsherlock/website/static/samples/featuredemo_02_1.6.png and /dev/null differ
diff --git a/actionbarsherlock/website/static/samples/featuredemo_02_1.6.thumb.png b/actionbarsherlock/website/static/samples/featuredemo_02_1.6.thumb.png
deleted file mode 100755
index 3c871d831..000000000
Binary files a/actionbarsherlock/website/static/samples/featuredemo_02_1.6.thumb.png and /dev/null differ
diff --git a/actionbarsherlock/website/static/samples/featuredemo_02_2.3.3.png b/actionbarsherlock/website/static/samples/featuredemo_02_2.3.3.png
deleted file mode 100755
index af4ee1e0c..000000000
Binary files a/actionbarsherlock/website/static/samples/featuredemo_02_2.3.3.png and /dev/null differ
diff --git a/actionbarsherlock/website/static/samples/featuredemo_02_2.3.3.thumb.png b/actionbarsherlock/website/static/samples/featuredemo_02_2.3.3.thumb.png
deleted file mode 100755
index 796dc41fd..000000000
Binary files a/actionbarsherlock/website/static/samples/featuredemo_02_2.3.3.thumb.png and /dev/null differ
diff --git a/actionbarsherlock/website/static/samples/featuredemo_02_3.1.png b/actionbarsherlock/website/static/samples/featuredemo_02_3.1.png
deleted file mode 100755
index ef74fbb3b..000000000
Binary files a/actionbarsherlock/website/static/samples/featuredemo_02_3.1.png and /dev/null differ
diff --git a/actionbarsherlock/website/static/samples/featuredemo_02_3.1.thumb.png b/actionbarsherlock/website/static/samples/featuredemo_02_3.1.thumb.png
deleted file mode 100755
index b9061a418..000000000
Binary files a/actionbarsherlock/website/static/samples/featuredemo_02_3.1.thumb.png and /dev/null differ
diff --git a/actionbarsherlock/website/static/samples/shakespeare_01_1.6.png b/actionbarsherlock/website/static/samples/shakespeare_01_1.6.png
deleted file mode 100755
index 82a318a29..000000000
Binary files a/actionbarsherlock/website/static/samples/shakespeare_01_1.6.png and /dev/null differ
diff --git a/actionbarsherlock/website/static/samples/shakespeare_01_1.6.thumb.png b/actionbarsherlock/website/static/samples/shakespeare_01_1.6.thumb.png
deleted file mode 100755
index 97d28a503..000000000
Binary files a/actionbarsherlock/website/static/samples/shakespeare_01_1.6.thumb.png and /dev/null differ
diff --git a/actionbarsherlock/website/static/samples/shakespeare_01_2.3.3.png b/actionbarsherlock/website/static/samples/shakespeare_01_2.3.3.png
deleted file mode 100755
index d1cdd22ce..000000000
Binary files a/actionbarsherlock/website/static/samples/shakespeare_01_2.3.3.png and /dev/null differ
diff --git a/actionbarsherlock/website/static/samples/shakespeare_01_2.3.3.thumb.png b/actionbarsherlock/website/static/samples/shakespeare_01_2.3.3.thumb.png
deleted file mode 100755
index 73026b161..000000000
Binary files a/actionbarsherlock/website/static/samples/shakespeare_01_2.3.3.thumb.png and /dev/null differ
diff --git a/actionbarsherlock/website/static/samples/shakespeare_01_3.1.png b/actionbarsherlock/website/static/samples/shakespeare_01_3.1.png
deleted file mode 100755
index 9710a4b72..000000000
Binary files a/actionbarsherlock/website/static/samples/shakespeare_01_3.1.png and /dev/null differ
diff --git a/actionbarsherlock/website/static/samples/shakespeare_01_3.1.thumb.png b/actionbarsherlock/website/static/samples/shakespeare_01_3.1.thumb.png
deleted file mode 100755
index 2d59ce638..000000000
Binary files a/actionbarsherlock/website/static/samples/shakespeare_01_3.1.thumb.png and /dev/null differ
diff --git a/actionbarsherlock/website/static/samples/shakespeare_02_2.3.3.png b/actionbarsherlock/website/static/samples/shakespeare_02_2.3.3.png
deleted file mode 100755
index 2b515c285..000000000
Binary files a/actionbarsherlock/website/static/samples/shakespeare_02_2.3.3.png and /dev/null differ
diff --git a/actionbarsherlock/website/static/samples/shakespeare_02_2.3.3.thumb.png b/actionbarsherlock/website/static/samples/shakespeare_02_2.3.3.thumb.png
deleted file mode 100755
index a7c3c853b..000000000
Binary files a/actionbarsherlock/website/static/samples/shakespeare_02_2.3.3.thumb.png and /dev/null differ
diff --git a/actionbarsherlock/website/static/samples/shakespeare_03_2.3.3.png b/actionbarsherlock/website/static/samples/shakespeare_03_2.3.3.png
deleted file mode 100755
index f45b70631..000000000
Binary files a/actionbarsherlock/website/static/samples/shakespeare_03_2.3.3.png and /dev/null differ
diff --git a/actionbarsherlock/website/static/samples/shakespeare_03_2.3.3.thumb.png b/actionbarsherlock/website/static/samples/shakespeare_03_2.3.3.thumb.png
deleted file mode 100755
index 9233fb780..000000000
Binary files a/actionbarsherlock/website/static/samples/shakespeare_03_2.3.3.thumb.png and /dev/null differ
diff --git a/actionbarsherlock/website/static/samples/styled_01_1.6.png b/actionbarsherlock/website/static/samples/styled_01_1.6.png
deleted file mode 100755
index 2b2a7fa3f..000000000
Binary files a/actionbarsherlock/website/static/samples/styled_01_1.6.png and /dev/null differ
diff --git a/actionbarsherlock/website/static/samples/styled_01_1.6.thumb.png b/actionbarsherlock/website/static/samples/styled_01_1.6.thumb.png
deleted file mode 100755
index fcbd32ea8..000000000
Binary files a/actionbarsherlock/website/static/samples/styled_01_1.6.thumb.png and /dev/null differ
diff --git a/actionbarsherlock/website/static/samples/styled_01_2.3.3.png b/actionbarsherlock/website/static/samples/styled_01_2.3.3.png
deleted file mode 100755
index 9d8f650eb..000000000
Binary files a/actionbarsherlock/website/static/samples/styled_01_2.3.3.png and /dev/null differ
diff --git a/actionbarsherlock/website/static/samples/styled_01_2.3.3.thumb.png b/actionbarsherlock/website/static/samples/styled_01_2.3.3.thumb.png
deleted file mode 100755
index 05f54549b..000000000
Binary files a/actionbarsherlock/website/static/samples/styled_01_2.3.3.thumb.png and /dev/null differ
diff --git a/actionbarsherlock/website/static/samples/styled_01_3.1.png b/actionbarsherlock/website/static/samples/styled_01_3.1.png
deleted file mode 100755
index d826b06cb..000000000
Binary files a/actionbarsherlock/website/static/samples/styled_01_3.1.png and /dev/null differ
diff --git a/actionbarsherlock/website/static/samples/styled_01_3.1.thumb.png b/actionbarsherlock/website/static/samples/styled_01_3.1.thumb.png
deleted file mode 100755
index 2985c4a37..000000000
Binary files a/actionbarsherlock/website/static/samples/styled_01_3.1.thumb.png and /dev/null differ
diff --git a/actionbarsherlock/website/static/samples/styled_02_1.6.png b/actionbarsherlock/website/static/samples/styled_02_1.6.png
deleted file mode 100755
index 986ba04f1..000000000
Binary files a/actionbarsherlock/website/static/samples/styled_02_1.6.png and /dev/null differ
diff --git a/actionbarsherlock/website/static/samples/styled_02_1.6.thumb.png b/actionbarsherlock/website/static/samples/styled_02_1.6.thumb.png
deleted file mode 100755
index f3db38d14..000000000
Binary files a/actionbarsherlock/website/static/samples/styled_02_1.6.thumb.png and /dev/null differ
diff --git a/actionbarsherlock/website/static/samples/styled_02_2.3.3.png b/actionbarsherlock/website/static/samples/styled_02_2.3.3.png
deleted file mode 100755
index 15800ab44..000000000
Binary files a/actionbarsherlock/website/static/samples/styled_02_2.3.3.png and /dev/null differ
diff --git a/actionbarsherlock/website/static/samples/styled_02_2.3.3.thumb.png b/actionbarsherlock/website/static/samples/styled_02_2.3.3.thumb.png
deleted file mode 100755
index 36c1586f5..000000000
Binary files a/actionbarsherlock/website/static/samples/styled_02_2.3.3.thumb.png and /dev/null differ
diff --git a/actionbarsherlock/website/static/samples/styled_02_3.1.png b/actionbarsherlock/website/static/samples/styled_02_3.1.png
deleted file mode 100755
index 6434b7b7a..000000000
Binary files a/actionbarsherlock/website/static/samples/styled_02_3.1.png and /dev/null differ
diff --git a/actionbarsherlock/website/static/samples/styled_02_3.1.thumb.png b/actionbarsherlock/website/static/samples/styled_02_3.1.thumb.png
deleted file mode 100755
index 1d2fd23b9..000000000
Binary files a/actionbarsherlock/website/static/samples/styled_02_3.1.thumb.png and /dev/null differ
diff --git a/actionbarsherlock/website/static/showdown.js b/actionbarsherlock/website/static/showdown.js
deleted file mode 100755
index 6738a371f..000000000
--- a/actionbarsherlock/website/static/showdown.js
+++ /dev/null
@@ -1,419 +0,0 @@
-/*
- A A L Source code at:
- T C A
- T K B
-*/
-
-var Showdown={};
-Showdown.converter=function(){
-var _1;
-var _2;
-var _3;
-var _4=0;
-this.makeHtml=function(_5){
-_1=new Array();
-_2=new Array();
-_3=new Array();
-_5=_5.replace(/~/g,"~T");
-_5=_5.replace(/\$/g,"~D");
-_5=_5.replace(/\r\n/g,"\n");
-_5=_5.replace(/\r/g,"\n");
-_5="\n\n"+_5+"\n\n";
-_5=_6(_5);
-_5=_5.replace(/^[ \t]+$/mg,"");
-_5=_7(_5);
-_5=_8(_5);
-_5=_9(_5);
-_5=_a(_5);
-_5=_5.replace(/~D/g,"$$");
-_5=_5.replace(/~T/g,"~");
-return _5;
-};
-var _8=function(_b){
-var _b=_b.replace(/^[ ]{0,3}\[(.+)\]:[ \t]*\n?[ \t]*(\S+?)>?[ \t]*\n?[ \t]*(?:(\n*)["(](.+?)[")][ \t]*)?(?:\n+|\Z)/gm,function(_c,m1,m2,m3,m4){
-m1=m1.toLowerCase();
-_1[m1]=_11(m2);
-if(m3){
-return m3+m4;
-}else{
-if(m4){
-_2[m1]=m4.replace(/"/g,""");
-}
-}
-return "";
-});
-return _b;
-};
-var _7=function(_12){
-_12=_12.replace(/\n/g,"\n\n");
-var _13="p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del";
-var _14="p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math";
-_12=_12.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\b[^\r]*?\n<\/\2>[ \t]*(?=\n+))/gm,_15);
-_12=_12.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math)\b[^\r]*?.*<\/\2>[ \t]*(?=\n+)\n)/gm,_15);
-_12=_12.replace(/(\n[ ]{0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,_15);
-_12=_12.replace(/(\n\n[ ]{0,3}[ \t]*(?=\n{2,}))/g,_15);
-_12=_12.replace(/(?:\n\n)([ ]{0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,_15);
-_12=_12.replace(/\n\n/g,"\n");
-return _12;
-};
-var _15=function(_16,m1){
-var _18=m1;
-_18=_18.replace(/\n\n/g,"\n");
-_18=_18.replace(/^\n/,"");
-_18=_18.replace(/\n+$/g,"");
-_18="\n\n~K"+(_3.push(_18)-1)+"K\n\n";
-return _18;
-};
-var _9=function(_19){
-_19=_1a(_19);
-var key=_1c(" ");
-_19=_19.replace(/^[ ]{0,2}([ ]?\*[ ]?){3,}[ \t]*$/gm,key);
-_19=_19.replace(/^[ ]{0,2}([ ]?\-[ ]?){3,}[ \t]*$/gm,key);
-_19=_19.replace(/^[ ]{0,2}([ ]?\_[ ]?){3,}[ \t]*$/gm,key);
-_19=_1d(_19);
-_19=_1e(_19);
-_19=_1f(_19);
-_19=_7(_19);
-_19=_20(_19);
-return _19;
-};
-var _21=function(_22){
-_22=_23(_22);
-_22=_24(_22);
-_22=_25(_22);
-_22=_26(_22);
-_22=_27(_22);
-_22=_28(_22);
-_22=_11(_22);
-_22=_29(_22);
-_22=_22.replace(/ +\n/g," \n");
-return _22;
-};
-var _24=function(_2a){
-var _2b=/(<[a-z\/!$]("[^"]*"|'[^']*'|[^'">])*>|)/gi;
-_2a=_2a.replace(_2b,function(_2c){
-var tag=_2c.replace(/(.)<\/?code>(?=.)/g,"$1`");
-tag=_2e(tag,"\\`*_");
-return tag;
-});
-return _2a;
-};
-var _27=function(_2f){
-_2f=_2f.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g,_30);
-_2f=_2f.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\]\([ \t]*()(.*?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,_30);
-_2f=_2f.replace(/(\[([^\[\]]+)\])()()()()()/g,_30);
-return _2f;
-};
-var _30=function(_31,m1,m2,m3,m4,m5,m6,m7){
-if(m7==undefined){
-m7="";
-}
-var _39=m1;
-var _3a=m2;
-var _3b=m3.toLowerCase();
-var url=m4;
-var _3d=m7;
-if(url==""){
-if(_3b==""){
-_3b=_3a.toLowerCase().replace(/ ?\n/g," ");
-}
-url="#"+_3b;
-if(_1[_3b]!=undefined){
-url=_1[_3b];
-if(_2[_3b]!=undefined){
-_3d=_2[_3b];
-}
-}else{
-if(_39.search(/\(\s*\)$/m)>-1){
-url="";
-}else{
-return _39;
-}
-}
-}
-url=_2e(url,"*_");
-var _3e=""+_3a+" ";
-return _3e;
-};
-var _26=function(_3f){
-_3f=_3f.replace(/(!\[(.*?)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g,_40);
-_3f=_3f.replace(/(!\[(.*?)\]\s?\([ \t]*()(\S+?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,_40);
-return _3f;
-};
-var _40=function(_41,m1,m2,m3,m4,m5,m6,m7){
-var _49=m1;
-var _4a=m2;
-var _4b=m3.toLowerCase();
-var url=m4;
-var _4d=m7;
-if(!_4d){
-_4d="";
-}
-if(url==""){
-if(_4b==""){
-_4b=_4a.toLowerCase().replace(/ ?\n/g," ");
-}
-url="#"+_4b;
-if(_1[_4b]!=undefined){
-url=_1[_4b];
-if(_2[_4b]!=undefined){
-_4d=_2[_4b];
-}
-}else{
-return _49;
-}
-}
-_4a=_4a.replace(/"/g,""");
-url=_2e(url,"*_");
-var _4e=" ";
-return _4e;
-};
-var _1a=function(_4f){
-_4f=_4f.replace(/^(.+)[ \t]*\n=+[ \t]*\n+/gm,function(_50,m1){
-return _1c(""+_21(m1)+" ");
-});
-_4f=_4f.replace(/^(.+)[ \t]*\n-+[ \t]*\n+/gm,function(_52,m1){
-return _1c(""+_21(m1)+" ");
-});
-_4f=_4f.replace(/^(\#{1,6})[ \t]*(.+?)[ \t]*\#*\n+/gm,function(_54,m1,m2){
-var _57=m1.length;
-return _1c(""+_21(m2)+" ");
-});
-return _4f;
-};
-var _58;
-var _1d=function(_59){
-_59+="~0";
-var _5a=/^(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm;
-if(_4){
-_59=_59.replace(_5a,function(_5b,m1,m2){
-var _5e=m1;
-var _5f=(m2.search(/[*+-]/g)>-1)?"ul":"ol";
-_5e=_5e.replace(/\n{2,}/g,"\n\n\n");
-var _60=_58(_5e);
-_60=_60.replace(/\s+$/,"");
-_60="<"+_5f+">"+_60+""+_5f+">\n";
-return _60;
-});
-}else{
-_5a=/(\n\n|^\n?)(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/g;
-_59=_59.replace(_5a,function(_61,m1,m2,m3){
-var _65=m1;
-var _66=m2;
-var _67=(m3.search(/[*+-]/g)>-1)?"ul":"ol";
-var _66=_66.replace(/\n{2,}/g,"\n\n\n");
-var _68=_58(_66);
-_68=_65+"<"+_67+">\n"+_68+""+_67+">\n";
-return _68;
-});
-}
-_59=_59.replace(/~0/,"");
-return _59;
-};
-_58=function(_69){
-_4++;
-_69=_69.replace(/\n{2,}$/,"\n");
-_69+="~0";
-_69=_69.replace(/(\n)?(^[ \t]*)([*+-]|\d+[.])[ \t]+([^\r]+?(\n{1,2}))(?=\n*(~0|\2([*+-]|\d+[.])[ \t]+))/gm,function(_6a,m1,m2,m3,m4){
-var _6f=m4;
-var _70=m1;
-var _71=m2;
-if(_70||(_6f.search(/\n{2,}/)>-1)){
-_6f=_9(_72(_6f));
-}else{
-_6f=_1d(_72(_6f));
-_6f=_6f.replace(/\n$/,"");
-_6f=_21(_6f);
-}
-return ""+_6f+" \n";
-});
-_69=_69.replace(/~0/g,"");
-_4--;
-return _69;
-};
-var _1e=function(_73){
-_73+="~0";
-_73=_73.replace(/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=~0))/g,function(_74,m1,m2){
-var _77=m1;
-var _78=m2;
-_77=_79(_72(_77));
-_77=_6(_77);
-_77=_77.replace(/^\n+/g,"");
-_77=_77.replace(/\n+$/g,"");
-_77=""+_77+"\n ";
-return _1c(_77)+_78;
-});
-_73=_73.replace(/~0/,"");
-return _73;
-};
-var _1c=function(_7a){
-_7a=_7a.replace(/(^\n+|\n+$)/g,"");
-return "\n\n~K"+(_3.push(_7a)-1)+"K\n\n";
-};
-var _23=function(_7b){
-_7b=_7b.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,function(_7c,m1,m2,m3,m4){
-var c=m3;
-c=c.replace(/^([ \t]*)/g,"");
-c=c.replace(/[ \t]*$/g,"");
-c=_79(c);
-return m1+""+c+"";
-});
-return _7b;
-};
-var _79=function(_82){
-_82=_82.replace(/&/g,"&");
-_82=_82.replace(//g,">");
-_82=_2e(_82,"*_{}[]\\",false);
-return _82;
-};
-var _29=function(_83){
-_83=_83.replace(/(\*\*|__)(?=\S)([^\r]*?\S[*_]*)\1/g,"$2 ");
-_83=_83.replace(/(\*|_)(?=\S)([^\r]*?\S)\1/g,"$2 ");
-return _83;
-};
-var _1f=function(_84){
-_84=_84.replace(/((^[ \t]*>[ \t]?.+\n(.+\n)*\n*)+)/gm,function(_85,m1){
-var bq=m1;
-bq=bq.replace(/^[ \t]*>[ \t]?/gm,"~0");
-bq=bq.replace(/~0/g,"");
-bq=bq.replace(/^[ \t]+$/gm,"");
-bq=_9(bq);
-bq=bq.replace(/(^|\n)/g,"$1 ");
-bq=bq.replace(/(\s*[^\r]+?<\/pre>)/gm,function(_88,m1){
-var pre=m1;
-pre=pre.replace(/^ /mg,"~0");
-pre=pre.replace(/~0/g,"");
-return pre;
-});
-return _1c("\n"+bq+"\n ");
-});
-return _84;
-};
-var _20=function(_8b){
-_8b=_8b.replace(/^\n+/g,"");
-_8b=_8b.replace(/\n+$/g,"");
-var _8c=_8b.split(/\n{2,}/g);
-var _8d=new Array();
-var end=_8c.length;
-for(var i=0;i=0){
-_8d.push(str);
-}else{
-if(str.search(/\S/)>=0){
-str=_21(str);
-str=str.replace(/^([ \t]*)/g,"");
-str+="
";
-_8d.push(str);
-}
-}
-}
-end=_8d.length;
-for(var i=0;i=0){
-var _91=_3[RegExp.$1];
-_91=_91.replace(/\$/g,"$$$$");
-_8d[i]=_8d[i].replace(/~K\d+K/,_91);
-}
-}
-return _8d.join("\n\n");
-};
-var _11=function(_92){
-_92=_92.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g,"&");
-_92=_92.replace(/<(?![a-z\/?\$!])/gi,"<");
-return _92;
-};
-var _25=function(_93){
-_93=_93.replace(/\\(\\)/g,_94);
-_93=_93.replace(/\\([`*_{}\[\]()>#+-.!])/g,_94);
-return _93;
-};
-var _28=function(_95){
-_95=_95.replace(/<((https?|ftp|dict):[^'">\s]+)>/gi,"$1 ");
-_95=_95.replace(/<(?:mailto:)?([-.\w]+\@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,function(_96,m1){
-return _98(_a(m1));
-});
-return _95;
-};
-var _98=function(_99){
-function char2hex(ch){
-var _9b="0123456789ABCDEF";
-var dec=ch.charCodeAt(0);
-return (_9b.charAt(dec>>4)+_9b.charAt(dec&15));
-}
-var _9d=[function(ch){
-return ""+ch.charCodeAt(0)+";";
-},function(ch){
-return ""+char2hex(ch)+";";
-},function(ch){
-return ch;
-}];
-_99="mailto:"+_99;
-_99=_99.replace(/./g,function(ch){
-if(ch=="@"){
-ch=_9d[Math.floor(Math.random()*2)](ch);
-}else{
-if(ch!=":"){
-var r=Math.random();
-ch=(r>0.9?_9d[2](ch):r>0.45?_9d[1](ch):_9d[0](ch));
-}
-}
-return ch;
-});
-_99=""+_99+" ";
-_99=_99.replace(/">.+:/g,"\">");
-return _99;
-};
-var _a=function(_a3){
-_a3=_a3.replace(/~E(\d+)E/g,function(_a4,m1){
-var _a6=parseInt(m1);
-return String.fromCharCode(_a6);
-});
-return _a3;
-};
-var _72=function(_a7){
-_a7=_a7.replace(/^(\t|[ ]{1,4})/gm,"~0");
-_a7=_a7.replace(/~0/g,"");
-return _a7;
-};
-var _6=function(_a8){
-_a8=_a8.replace(/\t(?=\t)/g," ");
-_a8=_a8.replace(/\t/g,"~A~B");
-_a8=_a8.replace(/~B(.+?)~A/g,function(_a9,m1,m2){
-var _ac=m1;
-var _ad=4-_ac.length%4;
-for(var i=0;i<_ad;i++){
-_ac+=" ";
-}
-return _ac;
-});
-_a8=_a8.replace(/~A/g," ");
-_a8=_a8.replace(/~B/g,"");
-return _a8;
-};
-var _2e=function(_af,_b0,_b1){
-var _b2="(["+_b0.replace(/([\[\]\\])/g,"\\$1")+"])";
-if(_b1){
-_b2="\\\\"+_b2;
-}
-var _b3=new RegExp(_b2,"g");
-_af=_af.replace(_b3,_94);
-return _af;
-};
-var _94=function(_b4,m1){
-var _b6=m1.charCodeAt(0);
-return "~E"+_b6+"E";
-};
-};
-if(typeof exports!='undefined')exports.Showdown=Showdown;
\ No newline at end of file
diff --git a/actionbarsherlock/website/static/styles.css b/actionbarsherlock/website/static/styles.css
deleted file mode 100755
index e3a0c3753..000000000
--- a/actionbarsherlock/website/static/styles.css
+++ /dev/null
@@ -1,236 +0,0 @@
-/* ============================== */
-/* ! Layout for desktop version */
-/* ============================== */
-
- body {
- font-family: "Helvetica Neue", Helvetica, sans-serif;
- font-size: 0.85em;
- background: #222 url('black_linen_v2.png') repeat;
- color: #aaa;
- padding: 30px 0 20px;
- text-shadow: 1px 0px 3px #000;
- }
- body#home {
- padding: 50px 0 20px;
- }
- h1 {
- color: #ddd;
- border-bottom: 3px solid #333;
- margin-bottom: 0.75em;
- font-size: 1.5em;
- }
- h2 {
- color: #ccc;
- border-bottom: 1px solid #333;
- margin-top: 1.5em;
- margin-bottom: 0.75em;
- font-size: 1.35em;
- }
- h3 {
- color: #c5c5c5;
- margin-top: 2em;
- margin-bottom: 0.75em;
- font-size: 1.25em;
- }
- p { margin: 1em 0; }
- p.lead { font-weight: bold; font-size: 1.2em; }
- p.link { font-family: "Courier New", Monaco, "DejaVu Sans Mono", monospace; margin-left: 1em; font-size: 0.9em; }
- ul, ol { margin: 1em 0 1em 2em; }
- li { margin: 0.25em 0; }
- dt { font-weight: bold; }
- dd { margin: 0.25em 0 1em 1em; }
- a img { border: 0; vertical-align: middle; }
- a:link, a:visited, a:active { color: #72a4b4; text-shadow: 1px 0px 1px #000; text-decoration: none; font-weight: bold; }
- a:hover { border-bottom: 1px #72a4b4 dotted; }
- a.img:hover { border-bottom: 0px; }
-
- .normal { font-weight: normal; }
- .centered { text-align: center; }
-
- .warning { border: 1px solid #d33; padding: 1em; margin: 2em 3em; background-color: rgba(255, 0, 0, 0.2); color: #ddd; }
-
- #header { margin: 0; }
-
- #nav { margin: 1em 0 2em; }
- #nav ul { margin: 0; padding: 0; overflow: hidden; }
- #nav li { list-style: none; margin: 1em; padding: 0 0 1px 0; float: left; }
- #nav li:first-child { margin-left: 0; }
- #nav li:last-child { margin-right: 0; }
-
- #feature { color: #ddd; padding-bottom: 10px; }
- #features { margin-top: 60px; }
- .feature { padding-bottom: 1px; }
- .feature h1 a:link, .feature h1 a:visited, .feature h1 a:active { color: #fff; }
- .feature h1 a:hover { border-bottom: none; }
- #apps { margin-top: 60px; }
- .app { margin-bottom: 2em; float: left; }
- .app img { float: left; }
- .app .info { margin-left: 90px; }
- .app h4 { margin: 0; font-size: 1.25em; }
- .app p { margin: .5em 0; }
-
- .gallery { margin: 1em; background-color: rgba(0, 0, 0, 0.1); padding: 1em 0 0 1em; overflow: hidden; }
- .gallery a { display: inline-block; float: left; margin: 0 1em 1em 0; }
-
- #footer { margin-top: 60px; font-size: 0.9em; color: #666; }
- #footer p { margin: 0; }
- #footer a:link, #footer a:visited, #footer a:active { color: #666; text-decoration: underline; text-shadow: 1px 0px 3px #000; }
- #footer a:hover { border-bottom: 0; color: #888; }
- #footer .social { text-align: right; }
-
- #sherlock { float: left; margin-right: 30px; }
- #sherlock a:hover { border-bottom: none; }
-
- #download { text-align: center; margin-top: 2.5em; margin-bottom: 2em; white-space: nowrap; }
- #download p { background: #333; display: inline; padding: 8px 15px; border-radius: 10px; text-shadow: none; font-weight: bold; }
- #download p span { padding-right: 5px; }
- #download p a { padding: 1px 3px; }
- #download_more { font-weight: normal; color: #666; text-shadow: none; font-size: 0.9em; }
- #download_more:hover { border-bottom: none; color: #999; }
-
- #theming ul li { color: #666; }
- #theming ul li code { color: #bbb; }
-
- #faq-table { border-collapse: collapse; width: 100%; border-top: 1px solid #333; margin-top: 50px; }
- #faq-table th, #faq-table td { border-bottom: 1px solid #333; padding: 1.5em 0; text-align: left; vertical-align: top; }
- #faq-table th { color: #ccc; padding-right: 1em; width: 50%; }
- #faq-table td { padding-left: 1em; width: 50%; }
- #faq-table td p:first-child { margin-top: 0; }
- #faq-table td p:last-child { margin-bottom: 0; }
-
- #changelog-content {
- color: #444;
- text-shadow: 1px 0px 3px #ddd;
- }
- #changelog-content h1 { color: #000; }
- #changelog-content h2 { color: #222; }
- #changelog-content a:link, #changelog-content a:visited, #changelog-content a:active, #changelog-content a:hover { color: #33d; text-shadow: 0px 0px 0px; font-weight: normal; }
- #changelog-content a:hover { border-bottom-color: #33f; }
-
- .dl {
- font-size: 24px;
- line-height: 24px;
- }
-
-
-/*
- ColorBox Core Style:
- The following CSS is consistent between example themes and should not be altered.
-*/
-#colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;}
-#cboxOverlay{position:fixed; width:100%; height:100%;}
-#cboxMiddleLeft, #cboxBottomLeft{clear:left;}
-#cboxContent{position:relative;}
-#cboxLoadedContent{overflow:auto;}
-#cboxTitle{margin:0;}
-#cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%;}
-#cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;}
-.cboxPhoto{float:left; margin:auto; border:0; display:block;}
-.cboxIframe{width:100%; height:100%; display:block; border:0;}
-
-/*
- User Style:
- Change the following styles to modify the appearance of ColorBox. They are
- ordered & tabbed in a way that represents the nesting of the generated HTML.
-*/
-#cboxOverlay{background:url('overlay.png') repeat 0 0;}
-#colorbox{}
- #cboxTopLeft{width:21px; height:21px; background:url('controls.png') no-repeat -100px 0;}
- #cboxTopRight{width:21px; height:21px; background:url('controls.png') no-repeat -129px 0;}
- #cboxBottomLeft{width:21px; height:21px; background:url('controls.png') no-repeat -100px -29px;}
- #cboxBottomRight{width:21px; height:21px; background:url('controls.png') no-repeat -129px -29px;}
- #cboxMiddleLeft{width:21px; background:url('controls.png') left top repeat-y;}
- #cboxMiddleRight{width:21px; background:url('controls.png') right top repeat-y;}
- #cboxTopCenter{height:21px; background:url('border.png') 0 0 repeat-x;}
- #cboxBottomCenter{height:21px; background:url('border.png') 0 -29px repeat-x;}
- #cboxContent{background:#fff; overflow:hidden;}
- #cboxError{padding:50px; border:1px solid #ccc;}
- #cboxLoadedContent{margin-bottom:28px;}
- #cboxTitle{position:absolute; bottom:4px; left:0; text-align:center; width:100%; text-shadow: none; color: #333;}
- #cboxCurrent{display:none;}
- #cboxSlideshow{position:absolute; bottom:4px; right:30px; color:#0092ef;}
- #cboxPrevious{position:absolute; bottom:0; left:0; background:url('controls.png') no-repeat -75px 0; width:25px; height:25px; text-indent:-9999px;}
- #cboxPrevious.hover{background-position:-75px -25px;}
- #cboxNext{position:absolute; bottom:0; left:27px; background:url('controls.png') no-repeat -50px 0; width:25px; height:25px; text-indent:-9999px;}
- #cboxNext.hover{background-position:-50px -25px;}
- #cboxLoadingOverlay{background:url('loading_background.png') no-repeat center center;}
- #cboxLoadingGraphic{background:url('loading.gif') no-repeat center center;}
- #cboxClose{position:absolute; bottom:0; right:0; background:url('controls.png') no-repeat -25px 0; width:25px; height:25px; text-indent:-9999px;}
- #cboxClose.hover{background-position:-25px -25px;}
-
-/*
- The following fixes a problem where IE7 and IE8 replace a PNG's alpha transparency with a black fill
- when an alpha filter (opacity change) is set on the element or ancestor element. This style is not applied to IE9.
-*/
-.cboxIE #cboxTopLeft,
-.cboxIE #cboxTopCenter,
-.cboxIE #cboxTopRight,
-.cboxIE #cboxBottomLeft,
-.cboxIE #cboxBottomCenter,
-.cboxIE #cboxBottomRight,
-.cboxIE #cboxMiddleLeft,
-.cboxIE #cboxMiddleRight {
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF);
-}
-
-/*
- The following provides PNG transparency support for IE6
-*/
-.cboxIE6 #cboxTopLeft{background:url(images/ie6/borderTopLeft.png);}
-.cboxIE6 #cboxTopCenter{background:url(images/ie6/borderTopCenter.png);}
-.cboxIE6 #cboxTopRight{background:url(images/ie6/borderTopRight.png);}
-.cboxIE6 #cboxBottomLeft{background:url(images/ie6/borderBottomLeft.png);}
-.cboxIE6 #cboxBottomCenter{background:url(images/ie6/borderBottomCenter.png);}
-.cboxIE6 #cboxBottomRight{background:url(images/ie6/borderBottomRight.png);}
-.cboxIE6 #cboxMiddleLeft{background:url(images/ie6/borderMiddleLeft.png);}
-.cboxIE6 #cboxMiddleRight{background:url(images/ie6/borderMiddleRight.png);}
-
-.cboxIE6 #cboxTopLeft,
-.cboxIE6 #cboxTopCenter,
-.cboxIE6 #cboxTopRight,
-.cboxIE6 #cboxBottomLeft,
-.cboxIE6 #cboxBottomCenter,
-.cboxIE6 #cboxBottomRight,
-.cboxIE6 #cboxMiddleLeft,
-.cboxIE6 #cboxMiddleRight {
- _behavior: expression(this.src = this.src ? this.src : this.currentStyle.backgroundImage.split('"')[1], this.style.background = "none", this.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src=" + this.src + ", sizingMethod='scale')");
-}
-
-
-/* ============================= */
-/* ! Layout for mobile version */
-/* ============================= */
-
-@media handheld, only screen and (max-width: 767px) {
- body { }
- #body { padding: 0; }
- #nav li { margin: 0.5em 0; width: 29%; text-align: center; padding: 0 2%; }
-
- h1, h2, h3, h4, h5, h6 { margin-top: 40px; }
-
- #header { padding-right: 15px; }
- #header.small { padding-right: 40px; }
- #features { margin-top: 0; }
- #footer { margin-top: 50px; }
- #sherlock { display: none; }
- #footer .social { text-align: left; }
- #github img { height: 100px; }
-
- #faq-table { display: block; width: 100%; }
- #faq-table tbody { display: block; }
- #faq-table tr { display: block; width: 100%; }
- #faq-table th, #faq-table td { display: block; width: 100%; padding-right: 0; padding-left: 0; margin: 0; }
- #faq-table th { border-bottom: none; padding-bottom: 0; }
-}
-
-
-/* ========================================== */
-/* ! Provide higher res assets for iPhone 4 */
-/* ========================================== */
-
-@media only screen and (-webkit-min-device-pixel-ratio: 2) {
-/* .logo {
- background: url(logo2x.jpg) no-repeat;
- background-size: 212px 303px;
- }*/
-}
diff --git a/actionbarsherlock/website/support.html b/actionbarsherlock/website/support.html
deleted file mode 100755
index 7d2758f2a..000000000
--- a/actionbarsherlock/website/support.html
+++ /dev/null
@@ -1,47 +0,0 @@
----
-title: Support
-layout: default
----
-
-
-
-
-
Support
-
Support for the implementation and development of ActionBarSherlock is available in the following places:
-
-
Google Group
-
Post a message to the Google Group about ActionBarSherlock. This will allow myself as well as other users of the library to assist you. It will also serve as a catalog of previous questions and announcements which may be useful. Please DO NOT post general questions about using the action bar APIs.
-
groups.google.com/group/actionbarsherlock
-
-
StackOverflow
-
Like Google Groups, this will allow fellow users to assist you solve your problem. This is also a more approriate place to post general questions about the action bar API.
-
stackoverflow.com/tags/actionbarsherlock
-
-
GitHub Issues
-
If you have found a bug or want to suggest a new feature then you can create an issue on the GitHub project.
-
github.com/JakeWharton/ActionBarSherlock/issues
-
-
Direct Contact
-
You may also contact me directly if the above two options are not sufficient.
-
-
-
-
...Of A Different Kind
-
If you are looking for ways to support the development and maintenance of this project there are various ways to contribute both directly and indirectly.
-
- Code
- Contributions of code are the best way to show your support of the library. For more information see the development page .
- Buy Merchandise
- An Android-themed mascot logo was commisioned for ActionBarSherlock and now you can wear it. The merchandise page has all the details.
- Donations
- Monetary support is accepted via PayPal or Flattr from the donation page .
- Be Social
- Educating other developers on the existence and advantages of this library is the quickest and easiest way to voice your support.
- Click the Google +1, Twitter, and/or Facebook links below to get started. Please also link to the site from blog posts and on StackOverflow answers.
-
-
-
\ No newline at end of file
diff --git a/actionbarsherlock/website/theming.html b/actionbarsherlock/website/theming.html
deleted file mode 100755
index 70d9ab448..000000000
--- a/actionbarsherlock/website/theming.html
+++ /dev/null
@@ -1,37 +0,0 @@
----
-title: Theming
-layout: default
----
-
-
-
-
Theming
-
-
Theming of the action bar to work on all devices is a very straightforward and simple process. You should follow the existing theming recommendations for customizing the native action bar with some minor tweaks.
-
An example of a customized action bar can be seen in the “Styled” example in the 'Demos' sample.
-
-
Parent Themes
-
In order for the custom action bar implementation to function your application must use Theme.Sherlock, Theme.Sherlock.Light, or Theme.Sherlock.Light.DarkActionBar, or your custom theme must use one of the aforementioned as its parent.
-
The themes should be defined in your manifest for the entire application or on a per-activity basis. You may also define the theme in the code of each activity before calling super.onCreate(Bundle). This must be done for every activity on which you extend from one of the 'Sherlock' activity base classes and intend to use the action bar. More information on how to specify a theme can be found in the official Android documentation .
-
-
Mirrored Attributes
-
Due to limitations in Android's theming system any theme customizations must be declared in two attributes. The normal android-prefixed attributes apply the theme to the native action bar and the unprefixed attributes are for the custom implementation. Since both theming APIs are exactly the same you need only reference your customizations twice rather than having to implement them twice.
-
The easiest way to convey exactly what this entails is with an example. The following is the full theme from the “Styled” example mentioned above:
-
<style name="Theme.Styled" parent="Theme.Sherlock.Light.DarkActionBar">
- <item name="actionBarStyle">@style/Widget.Styled.ActionBar</item>
- <item name="android:actionBarStyle">@style/Widget.Styled.ActionBar</item>
-</style>
-
-<style name="Widget.Styled.ActionBar" parent="Widget.Sherlock.Light.ActionBar.Solid.Inverse">
- <item name="background">@drawable/bg_striped</item>
- <item name="android:background">@drawable/bg_striped</item>
-
- <item name="backgroundSplit">@drawable/bg_striped_split</item>
- <item name="android:backgroundSplit">@drawable/bg_striped_split</item>
-</style>
-
-
Dialog
-
If you have a full activity that you wish to theme in the manner of a dialog there is also Theme.Sherlock.Dialog and Theme.Sherlock.Light.Dialog themes which will provide a consistent Ice Cream Sandwich look.
-
No additional dialog themes will be included. If you require some of the more advanced features of dialogs they must be implemented yourself.
-
-
diff --git a/actionbarsherlock/website/usage.html b/actionbarsherlock/website/usage.html
deleted file mode 100755
index d2858b964..000000000
--- a/actionbarsherlock/website/usage.html
+++ /dev/null
@@ -1,105 +0,0 @@
----
-title: Usage
-layout: default
----
-
-
-
-
-
-
-
Usage
-
Sticking with the theme of the official compatability library, ActionBarSherlock aims to allow the use of the action bar design pattern by mimicking the experience that would be found natively on Android Ice Cream Sandwich with as little effort as required.
-
-
Requirements
-
Due to its use of the native action bar and its related classes on Ice Cream Sandwich, the library requires that both it and your project are compiled with Android 4.0 or newer. The project also requires that you are compiling with JDK 1.6 in both your editor and any build systems that you may be using.
-
Since the library is an extension of the official support library you must also have the android-support-v4.jar referenced by your project.
-
-
Including In Your Project
-
There are a few ways to leverage ActionBarSherlock in your projects:
-
- If you’re using the Eclipse Development Environment with the ADT plugin version 0.9.7 or greater you can include ActionBarSherlock as a library project. Create a new Android project in Eclipse using the library/ folder as the existing source. Then, in your project properties, add the created project under the ‘Libraries’ section of the ‘Android’ category.
- If you use ant to compile from the command line you will need to run android update project -p . inside the library/ folder of the project. Once completed, you can reference the library/ folder of ActionBarSherlock from your application's project.properties file. For more information please see the Android developer guide for referencing library projects.
-
- If you use maven to build your Android project you can simply add a dependency for this library.
-
-<dependency>
- <groupId>com.actionbarsherlock</groupId>
- <artifactId>library</artifactId>
- <version>4.1.0 </version>
- <type>apklib</type>
-</dependency>
-
-
-
-
-
Action Bar API
-
When creating an activity to use the action bar on all versions of Android, you must declare your activity to extend any of the activity classes that start with 'Sherlock' (e.g., SherlockActivity, SherlockFragmentActivity). Interaction with the action bar is handled by calling getSupportActionBar() (instead of getActionBar() ).
-
The API exposed by the ActionBar instance is an exact duplicate of that which the native method exposes . Refer to its documentation as well as the articles on how to utilize its functionality in the "Related Links" section.
-
NOTE : When using SherlockFragmentActivity there are also 'Sherlock'-prefixed fragment classes which you should use to ensure proper functionality (e.g. SherlockFragment, SherlockListFragment). The activity will still function with the normal fragment classes but you will not be able to use any of the menu-related methods.
-
-
Required Theming
-
Since the action bar widget is very complex it requires a set of default themes. The library provides three core themes—one of which must be applied to each activity on which you want the action bar present.
-
See the theming page for more information.
-
-
Imports
-
In order to provide functionality that was not available on version of Android prior to 3.0, the library includes and uses a lot of classes that are named the same as their native counterparts. The three most common are:
-
- com.actionbarsherlock.app.ActionBar
- com.actionbarsherlock.view.Menu
- com.actionbarsherlock.view.MenuItem
- com.actionbarsherlock.view.MenuInflater
-
-
It is important to ensure that you are using these types where appropriate since they contain the additional functionality required to support the action bar.
-
NOTE : The majority of errors regarding the @Override-ing of methods from the activities are a result of using the incorrect imports. All of the classes which exist in the com.actionbarsherlock.* package whose names match that of a native class extend from that native class and as such can be used in their place.
-
NOTE : In order to inflate your menu from XML you should call getSupportMenuInflater() in your activities. The fragment callbacks will already have an instance of the inflater as an argument.
-
-
See Also...
-
This library was meant to be as behind-the-scenes as possible and require a minimal amount of changes to support. The core usage of the action bar itself is no different than if you were interacting with the native action bar.
-
Be sure to also visit the following pages:
-
-
-
-
Related Links
-
The following links are useful information on how to operate the native action bar. Other than the small tweaks mentioned on this page, the entire API is exactly the same.
-
-
Class APIs
-
- ActionBar
- Main API for nearly all interaction with the action bar. This is the exact API getSupportActionBar() exposes.
- Fragment
- New fundamental building block of layouts which enable your to provide rich experiences on a range of different devices without code duplication.
-
-
-
Articles
-
- Using the ActionBar
- Broad introduction on the action bar design paradign, the API, and common use cases.
- Creating Menus
- Menus drive the action bar's items.
- Using the Compatability Libary
- ActionBarSherlock is a superset of the official compatability library. All features in the Google library are also available for use through this library.
- Fragments
- Introduction to utilizing this new modularized view and its lifecycle.
-
-
-
diff --git a/android-aac-enc/.classpath b/android-aac-enc/.classpath
deleted file mode 100644
index 72f829802..000000000
--- a/android-aac-enc/.classpath
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/android-aac-enc/.gitignore b/android-aac-enc/.gitignore
deleted file mode 100644
index 280e65ce7..000000000
--- a/android-aac-enc/.gitignore
+++ /dev/null
@@ -1,10 +0,0 @@
-*~
-.metadata
-*.class
-org.eclipse.ltk.core.refactoring.prefs
-gen
-local.properties
-ecbuild
-
-bin
-obj
diff --git a/android-aac-enc/.project b/android-aac-enc/.project
deleted file mode 100644
index c0e662584..000000000
--- a/android-aac-enc/.project
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
- aac-enc
-
-
-
-
-
- com.android.ide.eclipse.adt.ResourceManagerBuilder
-
-
-
-
- com.android.ide.eclipse.adt.PreCompilerBuilder
-
-
-
-
- org.eclipse.jdt.core.javabuilder
-
-
-
-
- com.android.ide.eclipse.adt.ApkBuilder
-
-
-
-
-
- com.android.ide.eclipse.adt.AndroidNature
- org.eclipse.jdt.core.javanature
-
-
diff --git a/android-aac-enc/android-aac-enc.iml b/android-aac-enc/android-aac-enc.iml
new file mode 100644
index 000000000..5a731f9ea
--- /dev/null
+++ b/android-aac-enc/android-aac-enc.iml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/android-aac-enc/build.xml b/android-aac-enc/build.xml
deleted file mode 100644
index 1136eda20..000000000
--- a/android-aac-enc/build.xml
+++ /dev/null
@@ -1,85 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/api/.classpath b/api/.classpath
deleted file mode 100644
index a4763d1ee..000000000
--- a/api/.classpath
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/api/.gitignore b/api/.gitignore
deleted file mode 100644
index b5c234f8e..000000000
--- a/api/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-*~
-.metadata
-*.class
-org.eclipse.ltk.core.refactoring.prefs
-gen
-local.properties
-ecbuild
-
diff --git a/api/.project b/api/.project
deleted file mode 100644
index 3ce3a857b..000000000
--- a/api/.project
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
- astridApi
-
-
-
-
-
- com.android.ide.eclipse.adt.ResourceManagerBuilder
-
-
-
-
- com.android.ide.eclipse.adt.PreCompilerBuilder
-
-
-
-
- org.eclipse.jdt.core.javabuilder
-
-
-
-
- com.android.ide.eclipse.adt.ApkBuilder
-
-
-
-
-
- com.android.ide.eclipse.adt.AndroidNature
- org.eclipse.jdt.core.javanature
-
-
diff --git a/api/.settings/org.eclipse.jdt.core.prefs b/api/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index eb46ad156..000000000
--- a/api/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,342 +0,0 @@
-#Tue Mar 08 14:07:46 PST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.codeComplete.argumentPrefixes=
-org.eclipse.jdt.core.codeComplete.argumentSuffixes=
-org.eclipse.jdt.core.codeComplete.fieldPrefixes=
-org.eclipse.jdt.core.codeComplete.fieldSuffixes=
-org.eclipse.jdt.core.codeComplete.localPrefixes=
-org.eclipse.jdt.core.codeComplete.localSuffixes=
-org.eclipse.jdt.core.codeComplete.staticFieldPrefixes=
-org.eclipse.jdt.core.codeComplete.staticFieldSuffixes=
-org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes=
-org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes=
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
-org.eclipse.jdt.core.compiler.problem.deadCode=ignore
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
-org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
-org.eclipse.jdt.core.compiler.problem.nullReference=warning
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
-org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=ignore
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=warning
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.6
-org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_assignment=0
-org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
-org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
-org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
-org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
-org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
-org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=0
-org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
-org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
-org.eclipse.jdt.core.formatter.blank_lines_after_package=1
-org.eclipse.jdt.core.formatter.blank_lines_before_field=0
-org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
-org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
-org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
-org.eclipse.jdt.core.formatter.blank_lines_before_method=1
-org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
-org.eclipse.jdt.core.formatter.blank_lines_before_package=0
-org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
-org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
-org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
-org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
-org.eclipse.jdt.core.formatter.comment.format_block_comments=true
-org.eclipse.jdt.core.formatter.comment.format_header=false
-org.eclipse.jdt.core.formatter.comment.format_html=true
-org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
-org.eclipse.jdt.core.formatter.comment.format_line_comments=true
-org.eclipse.jdt.core.formatter.comment.format_source_code=true
-org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
-org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
-org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
-org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
-org.eclipse.jdt.core.formatter.comment.line_length=80
-org.eclipse.jdt.core.formatter.compact_else_if=true
-org.eclipse.jdt.core.formatter.continuation_indentation=2
-org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
-org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
-org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
-org.eclipse.jdt.core.formatter.indent_empty_lines=false
-org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
-org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
-org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
-org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
-org.eclipse.jdt.core.formatter.indentation.size=4
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
-org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
-org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
-org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
-org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
-org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.join_lines_in_comments=true
-org.eclipse.jdt.core.formatter.join_wrapped_lines=true
-org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
-org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
-org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
-org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
-org.eclipse.jdt.core.formatter.lineSplit=80
-org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
-org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
-org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
-org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
-org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
-org.eclipse.jdt.core.formatter.tabulation.char=space
-org.eclipse.jdt.core.formatter.tabulation.size=4
-org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
-org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
diff --git a/api/.settings/org.eclipse.jdt.ui.prefs b/api/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index 29fddf385..000000000
--- a/api/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,116 +0,0 @@
-#Tue Mar 08 14:08:11 PST 2011
-cleanup.add_default_serial_version_id=true
-cleanup.add_generated_serial_version_id=false
-cleanup.add_missing_annotations=true
-cleanup.add_missing_deprecated_annotations=true
-cleanup.add_missing_methods=false
-cleanup.add_missing_nls_tags=false
-cleanup.add_missing_override_annotations=true
-cleanup.add_serial_version_id=true
-cleanup.always_use_blocks=true
-cleanup.always_use_parentheses_in_expressions=false
-cleanup.always_use_this_for_non_static_field_access=false
-cleanup.always_use_this_for_non_static_method_access=false
-cleanup.convert_to_enhanced_for_loop=false
-cleanup.correct_indentation=false
-cleanup.format_source_code=false
-cleanup.format_source_code_changes_only=false
-cleanup.make_local_variable_final=true
-cleanup.make_parameters_final=false
-cleanup.make_private_fields_final=true
-cleanup.make_type_abstract_if_missing_method=false
-cleanup.make_variable_declarations_final=false
-cleanup.never_use_blocks=false
-cleanup.never_use_parentheses_in_expressions=true
-cleanup.organize_imports=true
-cleanup.qualify_static_field_accesses_with_declaring_class=false
-cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
-cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
-cleanup.qualify_static_member_accesses_with_declaring_class=true
-cleanup.qualify_static_method_accesses_with_declaring_class=false
-cleanup.remove_private_constructors=true
-cleanup.remove_trailing_whitespaces=true
-cleanup.remove_trailing_whitespaces_all=true
-cleanup.remove_trailing_whitespaces_ignore_empty=false
-cleanup.remove_unnecessary_casts=true
-cleanup.remove_unnecessary_nls_tags=true
-cleanup.remove_unused_imports=true
-cleanup.remove_unused_local_variables=false
-cleanup.remove_unused_private_fields=true
-cleanup.remove_unused_private_members=false
-cleanup.remove_unused_private_methods=true
-cleanup.remove_unused_private_types=true
-cleanup.sort_members=false
-cleanup.sort_members_all=false
-cleanup.use_blocks=false
-cleanup.use_blocks_only_for_return_and_throw=false
-cleanup.use_parentheses_in_expressions=false
-cleanup.use_this_for_non_static_field_access=false
-cleanup.use_this_for_non_static_field_access_only_if_necessary=true
-cleanup.use_this_for_non_static_method_access=false
-cleanup.use_this_for_non_static_method_access_only_if_necessary=true
-cleanup_profile=_Astrid
-cleanup_settings_version=2
-eclipse.preferences.version=1
-editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
-formatter_profile=_Astrid
-formatter_settings_version=11
-org.eclipse.jdt.ui.exception.name=e
-org.eclipse.jdt.ui.gettersetter.use.is=true
-org.eclipse.jdt.ui.ignorelowercasenames=true
-org.eclipse.jdt.ui.importorder=java;javax;org;com;
-org.eclipse.jdt.ui.keywordthis=false
-org.eclipse.jdt.ui.ondemandthreshold=99
-org.eclipse.jdt.ui.overrideannotation=true
-org.eclipse.jdt.ui.staticondemandthreshold=99
-sp_cleanup.add_default_serial_version_id=true
-sp_cleanup.add_generated_serial_version_id=false
-sp_cleanup.add_missing_annotations=true
-sp_cleanup.add_missing_deprecated_annotations=true
-sp_cleanup.add_missing_methods=false
-sp_cleanup.add_missing_nls_tags=false
-sp_cleanup.add_missing_override_annotations=true
-sp_cleanup.add_serial_version_id=false
-sp_cleanup.always_use_blocks=true
-sp_cleanup.always_use_parentheses_in_expressions=false
-sp_cleanup.always_use_this_for_non_static_field_access=false
-sp_cleanup.always_use_this_for_non_static_method_access=false
-sp_cleanup.convert_to_enhanced_for_loop=false
-sp_cleanup.correct_indentation=false
-sp_cleanup.format_source_code=false
-sp_cleanup.format_source_code_changes_only=false
-sp_cleanup.make_local_variable_final=false
-sp_cleanup.make_parameters_final=false
-sp_cleanup.make_private_fields_final=true
-sp_cleanup.make_type_abstract_if_missing_method=false
-sp_cleanup.make_variable_declarations_final=true
-sp_cleanup.never_use_blocks=false
-sp_cleanup.never_use_parentheses_in_expressions=true
-sp_cleanup.on_save_use_additional_actions=true
-sp_cleanup.organize_imports=true
-sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
-sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
-sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
-sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
-sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
-sp_cleanup.remove_private_constructors=true
-sp_cleanup.remove_trailing_whitespaces=true
-sp_cleanup.remove_trailing_whitespaces_all=true
-sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
-sp_cleanup.remove_unnecessary_casts=false
-sp_cleanup.remove_unnecessary_nls_tags=true
-sp_cleanup.remove_unused_imports=true
-sp_cleanup.remove_unused_local_variables=false
-sp_cleanup.remove_unused_private_fields=true
-sp_cleanup.remove_unused_private_members=false
-sp_cleanup.remove_unused_private_methods=true
-sp_cleanup.remove_unused_private_types=true
-sp_cleanup.sort_members=false
-sp_cleanup.sort_members_all=false
-sp_cleanup.use_blocks=false
-sp_cleanup.use_blocks_only_for_return_and_throw=false
-sp_cleanup.use_parentheses_in_expressions=false
-sp_cleanup.use_this_for_non_static_field_access=false
-sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
-sp_cleanup.use_this_for_non_static_method_access=false
-sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
diff --git a/api/api.iml b/api/api.iml
new file mode 100644
index 000000000..5a731f9ea
--- /dev/null
+++ b/api/api.iml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/api/build.xml b/api/build.xml
deleted file mode 100644
index 51da4e741..000000000
--- a/api/build.xml
+++ /dev/null
@@ -1,127 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/astrid/.classpath b/astrid/.classpath
deleted file mode 100644
index 4c3509217..000000000
--- a/astrid/.classpath
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/astrid/.project b/astrid/.project
deleted file mode 100644
index a8cc9332f..000000000
--- a/astrid/.project
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
- astrid
-
-
-
-
-
- org.eclipse.wst.common.project.facet.core.builder
-
-
-
-
- com.android.ide.eclipse.adt.ResourceManagerBuilder
-
-
-
-
- com.android.ide.eclipse.adt.PreCompilerBuilder
-
-
-
-
- org.eclipse.jdt.core.javabuilder
-
-
-
-
- com.android.ide.eclipse.adt.ApkBuilder
-
-
-
-
-
- com.android.ide.eclipse.adt.AndroidNature
- org.eclipse.jdt.core.javanature
- org.eclipse.wst.common.project.facet.core.nature
-
-
diff --git a/astrid/.settings/org.eclipse.core.resources.prefs b/astrid/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 06696f816..000000000
--- a/astrid/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Mon Nov 28 20:22:39 CET 2011
-eclipse.preferences.version=1
-encoding/AndroidManifest.xml=UTF-8
diff --git a/astrid/.settings/org.eclipse.jdt.core.prefs b/astrid/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index eb46ad156..000000000
--- a/astrid/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,342 +0,0 @@
-#Tue Mar 08 14:07:46 PST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.codeComplete.argumentPrefixes=
-org.eclipse.jdt.core.codeComplete.argumentSuffixes=
-org.eclipse.jdt.core.codeComplete.fieldPrefixes=
-org.eclipse.jdt.core.codeComplete.fieldSuffixes=
-org.eclipse.jdt.core.codeComplete.localPrefixes=
-org.eclipse.jdt.core.codeComplete.localSuffixes=
-org.eclipse.jdt.core.codeComplete.staticFieldPrefixes=
-org.eclipse.jdt.core.codeComplete.staticFieldSuffixes=
-org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes=
-org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes=
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
-org.eclipse.jdt.core.compiler.problem.deadCode=ignore
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
-org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
-org.eclipse.jdt.core.compiler.problem.nullReference=warning
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
-org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=ignore
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=warning
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.6
-org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_assignment=0
-org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
-org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
-org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
-org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
-org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
-org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=0
-org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
-org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
-org.eclipse.jdt.core.formatter.blank_lines_after_package=1
-org.eclipse.jdt.core.formatter.blank_lines_before_field=0
-org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
-org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
-org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
-org.eclipse.jdt.core.formatter.blank_lines_before_method=1
-org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
-org.eclipse.jdt.core.formatter.blank_lines_before_package=0
-org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
-org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
-org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
-org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
-org.eclipse.jdt.core.formatter.comment.format_block_comments=true
-org.eclipse.jdt.core.formatter.comment.format_header=false
-org.eclipse.jdt.core.formatter.comment.format_html=true
-org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
-org.eclipse.jdt.core.formatter.comment.format_line_comments=true
-org.eclipse.jdt.core.formatter.comment.format_source_code=true
-org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
-org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
-org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
-org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
-org.eclipse.jdt.core.formatter.comment.line_length=80
-org.eclipse.jdt.core.formatter.compact_else_if=true
-org.eclipse.jdt.core.formatter.continuation_indentation=2
-org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
-org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
-org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
-org.eclipse.jdt.core.formatter.indent_empty_lines=false
-org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
-org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
-org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
-org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
-org.eclipse.jdt.core.formatter.indentation.size=4
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
-org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
-org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
-org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
-org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
-org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.join_lines_in_comments=true
-org.eclipse.jdt.core.formatter.join_wrapped_lines=true
-org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
-org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
-org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
-org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
-org.eclipse.jdt.core.formatter.lineSplit=80
-org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
-org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
-org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
-org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
-org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
-org.eclipse.jdt.core.formatter.tabulation.char=space
-org.eclipse.jdt.core.formatter.tabulation.size=4
-org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
-org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
diff --git a/astrid/.settings/org.eclipse.jdt.ui.prefs b/astrid/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index 29fddf385..000000000
--- a/astrid/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,116 +0,0 @@
-#Tue Mar 08 14:08:11 PST 2011
-cleanup.add_default_serial_version_id=true
-cleanup.add_generated_serial_version_id=false
-cleanup.add_missing_annotations=true
-cleanup.add_missing_deprecated_annotations=true
-cleanup.add_missing_methods=false
-cleanup.add_missing_nls_tags=false
-cleanup.add_missing_override_annotations=true
-cleanup.add_serial_version_id=true
-cleanup.always_use_blocks=true
-cleanup.always_use_parentheses_in_expressions=false
-cleanup.always_use_this_for_non_static_field_access=false
-cleanup.always_use_this_for_non_static_method_access=false
-cleanup.convert_to_enhanced_for_loop=false
-cleanup.correct_indentation=false
-cleanup.format_source_code=false
-cleanup.format_source_code_changes_only=false
-cleanup.make_local_variable_final=true
-cleanup.make_parameters_final=false
-cleanup.make_private_fields_final=true
-cleanup.make_type_abstract_if_missing_method=false
-cleanup.make_variable_declarations_final=false
-cleanup.never_use_blocks=false
-cleanup.never_use_parentheses_in_expressions=true
-cleanup.organize_imports=true
-cleanup.qualify_static_field_accesses_with_declaring_class=false
-cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
-cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
-cleanup.qualify_static_member_accesses_with_declaring_class=true
-cleanup.qualify_static_method_accesses_with_declaring_class=false
-cleanup.remove_private_constructors=true
-cleanup.remove_trailing_whitespaces=true
-cleanup.remove_trailing_whitespaces_all=true
-cleanup.remove_trailing_whitespaces_ignore_empty=false
-cleanup.remove_unnecessary_casts=true
-cleanup.remove_unnecessary_nls_tags=true
-cleanup.remove_unused_imports=true
-cleanup.remove_unused_local_variables=false
-cleanup.remove_unused_private_fields=true
-cleanup.remove_unused_private_members=false
-cleanup.remove_unused_private_methods=true
-cleanup.remove_unused_private_types=true
-cleanup.sort_members=false
-cleanup.sort_members_all=false
-cleanup.use_blocks=false
-cleanup.use_blocks_only_for_return_and_throw=false
-cleanup.use_parentheses_in_expressions=false
-cleanup.use_this_for_non_static_field_access=false
-cleanup.use_this_for_non_static_field_access_only_if_necessary=true
-cleanup.use_this_for_non_static_method_access=false
-cleanup.use_this_for_non_static_method_access_only_if_necessary=true
-cleanup_profile=_Astrid
-cleanup_settings_version=2
-eclipse.preferences.version=1
-editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
-formatter_profile=_Astrid
-formatter_settings_version=11
-org.eclipse.jdt.ui.exception.name=e
-org.eclipse.jdt.ui.gettersetter.use.is=true
-org.eclipse.jdt.ui.ignorelowercasenames=true
-org.eclipse.jdt.ui.importorder=java;javax;org;com;
-org.eclipse.jdt.ui.keywordthis=false
-org.eclipse.jdt.ui.ondemandthreshold=99
-org.eclipse.jdt.ui.overrideannotation=true
-org.eclipse.jdt.ui.staticondemandthreshold=99
-sp_cleanup.add_default_serial_version_id=true
-sp_cleanup.add_generated_serial_version_id=false
-sp_cleanup.add_missing_annotations=true
-sp_cleanup.add_missing_deprecated_annotations=true
-sp_cleanup.add_missing_methods=false
-sp_cleanup.add_missing_nls_tags=false
-sp_cleanup.add_missing_override_annotations=true
-sp_cleanup.add_serial_version_id=false
-sp_cleanup.always_use_blocks=true
-sp_cleanup.always_use_parentheses_in_expressions=false
-sp_cleanup.always_use_this_for_non_static_field_access=false
-sp_cleanup.always_use_this_for_non_static_method_access=false
-sp_cleanup.convert_to_enhanced_for_loop=false
-sp_cleanup.correct_indentation=false
-sp_cleanup.format_source_code=false
-sp_cleanup.format_source_code_changes_only=false
-sp_cleanup.make_local_variable_final=false
-sp_cleanup.make_parameters_final=false
-sp_cleanup.make_private_fields_final=true
-sp_cleanup.make_type_abstract_if_missing_method=false
-sp_cleanup.make_variable_declarations_final=true
-sp_cleanup.never_use_blocks=false
-sp_cleanup.never_use_parentheses_in_expressions=true
-sp_cleanup.on_save_use_additional_actions=true
-sp_cleanup.organize_imports=true
-sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
-sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
-sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
-sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
-sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
-sp_cleanup.remove_private_constructors=true
-sp_cleanup.remove_trailing_whitespaces=true
-sp_cleanup.remove_trailing_whitespaces_all=true
-sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
-sp_cleanup.remove_unnecessary_casts=false
-sp_cleanup.remove_unnecessary_nls_tags=true
-sp_cleanup.remove_unused_imports=true
-sp_cleanup.remove_unused_local_variables=false
-sp_cleanup.remove_unused_private_fields=true
-sp_cleanup.remove_unused_private_members=false
-sp_cleanup.remove_unused_private_methods=true
-sp_cleanup.remove_unused_private_types=true
-sp_cleanup.sort_members=false
-sp_cleanup.sort_members_all=false
-sp_cleanup.use_blocks=false
-sp_cleanup.use_blocks_only_for_return_and_throw=false
-sp_cleanup.use_parentheses_in_expressions=false
-sp_cleanup.use_this_for_non_static_field_access=false
-sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
-sp_cleanup.use_this_for_non_static_method_access=false
-sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
diff --git a/astrid/ant.properties b/astrid/ant.properties
deleted file mode 100644
index eb9e6bcae..000000000
--- a/astrid/ant.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-# Astrid build properties
-
-# output files and apk
-out.dir=antbuild
-
-# source directory must be underneath output directory
-# because we pull in from multiple source folders
-source.dir=src-combined
-
-# Astrid source folders
-astrid.sources=src,common-src,plugin-src,src-legacy
-
-# Keystore
-signjar.keystore=/etc/todoroo/keystore
-signjar.keyalias=anddev.keystore
-signjar.passfile=/etc/todoroo/keypass
-
-# Default API Keys
-apikey.keyfile=/etc/todoroo/apikeys
-
-# suppress ant warnings
-build.sysclasspath=last
-
-proguard.config=proguard.cfg
diff --git a/astrid/antlib/ant-contrib-1.0b3.jar b/astrid/antlib/ant-contrib-1.0b3.jar
deleted file mode 100644
index 062537661..000000000
Binary files a/astrid/antlib/ant-contrib-1.0b3.jar and /dev/null differ
diff --git a/astrid/antlib/debug.keystore b/astrid/antlib/debug.keystore
deleted file mode 100644
index e55ac7903..000000000
Binary files a/astrid/antlib/debug.keystore and /dev/null differ
diff --git a/astrid/antlib/proguard.jar b/astrid/antlib/proguard.jar
deleted file mode 100644
index 56d68ba15..000000000
Binary files a/astrid/antlib/proguard.jar and /dev/null differ
diff --git a/astrid/astrid.iml b/astrid/astrid.iml
new file mode 100644
index 000000000..84a2768c5
--- /dev/null
+++ b/astrid/astrid.iml
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/astrid/astrid.launch b/astrid/astrid.launch
deleted file mode 100644
index cb174a74d..000000000
--- a/astrid/astrid.launch
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/astrid/build.xml b/astrid/build.xml
deleted file mode 100644
index c338721d1..000000000
--- a/astrid/build.xml
+++ /dev/null
@@ -1,488 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ====== context classes without setContext =====
-
-
-
-
-
- ====== entry points without initializing Astrid DI =====
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Signing final apk...
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Final Release Package: ${out.release.file}
-
-
-
-
-
-
-
-
-
-
-
-
-
- Final Release Package: ${out.release.file}
-
-
-
-
-
-
diff --git a/build.xml b/build.xml
deleted file mode 100644
index d46ecbf0e..000000000
--- a/build.xml
+++ /dev/null
@@ -1,100 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/docs/Contributors Licensing Agreement.pdf b/docs/Contributors Licensing Agreement.pdf
deleted file mode 100644
index fc0b5d462..000000000
Binary files a/docs/Contributors Licensing Agreement.pdf and /dev/null differ
diff --git a/facebook/.gitignore b/facebook/.gitignore
deleted file mode 100644
index 4c2961413..000000000
--- a/facebook/.gitignore
+++ /dev/null
@@ -1,15 +0,0 @@
-*~
-*.DS_Store
-*.class
-*java#
-examples/*/.classpath
-examples/*/.project
-examples/*/.settings
-facebook/bin/
-facebook/gen/
-examples/stream/bin/
-examples/simple/bin/
-examples/stream/gen/
-examples/simple/gen/
-tests/bin
-tests/gen
diff --git a/facebook/facebook.iml b/facebook/facebook.iml
new file mode 100644
index 000000000..d5c074327
--- /dev/null
+++ b/facebook/facebook.iml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/facebook/facebook/.classpath b/facebook/facebook/.classpath
deleted file mode 100644
index a4763d1ee..000000000
--- a/facebook/facebook/.classpath
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/facebook/facebook/.project b/facebook/facebook/.project
deleted file mode 100644
index d0551a112..000000000
--- a/facebook/facebook/.project
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
- FacebookSDK
-
-
-
-
-
- com.android.ide.eclipse.adt.ResourceManagerBuilder
-
-
-
-
- com.android.ide.eclipse.adt.PreCompilerBuilder
-
-
-
-
- org.eclipse.jdt.core.javabuilder
-
-
-
-
- com.android.ide.eclipse.adt.ApkBuilder
-
-
-
-
-
- com.android.ide.eclipse.adt.AndroidNature
- org.eclipse.jdt.core.javanature
-
-
diff --git a/facebook/facebook/TestApp/ant.properties b/facebook/facebook/TestApp/ant.properties
deleted file mode 100644
index b0971e891..000000000
--- a/facebook/facebook/TestApp/ant.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-# This file is used to override default values used by the Ant build system.
-#
-# This file must be checked into Version Control Systems, as it is
-# integral to the build system of your project.
-
-# This file is only used by the Ant script.
-
-# You can use this to override default values such as
-# 'source.dir' for the location of your java source folder and
-# 'out.dir' for the location of your output folder.
-
-# You can also use it define how the release builds are signed by declaring
-# the following properties:
-# 'key.store' for the location of your keystore and
-# 'key.alias' for the name of the key to use.
-# The password will be asked during the build when you use the 'release' target.
-
diff --git a/facebook/facebook/TestApp/build.xml b/facebook/facebook/TestApp/build.xml
deleted file mode 100644
index ea49a3fca..000000000
--- a/facebook/facebook/TestApp/build.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/facebook/facebook/ant.properties b/facebook/facebook/ant.properties
deleted file mode 100644
index b206ddecc..000000000
--- a/facebook/facebook/ant.properties
+++ /dev/null
@@ -1,2 +0,0 @@
-jar.libs.dir=../lib
-java.compilerargs=-Xlint -Werror
\ No newline at end of file
diff --git a/facebook/facebook/build.xml b/facebook/facebook/build.xml
deleted file mode 100644
index d85ad3e64..000000000
--- a/facebook/facebook/build.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/facebook/facebook/facebook.iml b/facebook/facebook/facebook.iml
new file mode 100644
index 000000000..bc3e1adeb
--- /dev/null
+++ b/facebook/facebook/facebook.iml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/facebook/facebook/tests/.classpath b/facebook/facebook/tests/.classpath
deleted file mode 100644
index a4763d1ee..000000000
--- a/facebook/facebook/tests/.classpath
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/facebook/facebook/tests/.project b/facebook/facebook/tests/.project
deleted file mode 100644
index 82993b5a8..000000000
--- a/facebook/facebook/tests/.project
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
- SDKTests
-
-
-
-
-
- com.android.ide.eclipse.adt.ResourceManagerBuilder
-
-
-
-
- com.android.ide.eclipse.adt.PreCompilerBuilder
-
-
-
-
- org.eclipse.jdt.core.javabuilder
-
-
-
-
- com.android.ide.eclipse.adt.ApkBuilder
-
-
-
-
-
- com.android.ide.eclipse.adt.AndroidNature
- org.eclipse.jdt.core.javanature
-
-
diff --git a/facebook/facebook/tests/ant.properties b/facebook/facebook/tests/ant.properties
deleted file mode 100644
index 928de2ff9..000000000
--- a/facebook/facebook/tests/ant.properties
+++ /dev/null
@@ -1,20 +0,0 @@
-# This file is used to override default values used by the Ant build system.
-#
-# This file must be checked into Version Control Systems, as it is
-# integral to the build system of your project.
-
-# This file is only used by the Ant script.
-
-# You can use this to override default values such as
-# 'source.dir' for the location of your java source folder and
-# 'out.dir' for the location of your output folder.
-
-# You can also use it define how the release builds are signed by declaring
-# the following properties:
-# 'key.store' for the location of your keystore and
-# 'key.alias' for the name of the key to use.
-# The password will be asked during the build when you use the 'release' target.
-
-# Removed based on advice at code.google.com/p/android/issues/detail?id=21108#c2
-# and the comment that follows.
-# tested.project.dir=../TestApp
diff --git a/facebook/facebook/tests/build.xml b/facebook/facebook/tests/build.xml
deleted file mode 100644
index 34c89faa8..000000000
--- a/facebook/facebook/tests/build.xml
+++ /dev/null
@@ -1,101 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Running tests...
-
-
-
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/BooleanOGSample/.classpath b/facebook/samples/BooleanOGSample/.classpath
deleted file mode 100644
index 655a4a827..000000000
--- a/facebook/samples/BooleanOGSample/.classpath
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/BooleanOGSample/.project b/facebook/samples/BooleanOGSample/.project
deleted file mode 100644
index cd9402a77..000000000
--- a/facebook/samples/BooleanOGSample/.project
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
- BooleanOGSample
-
-
-
-
-
- com.android.ide.eclipse.adt.ResourceManagerBuilder
-
-
-
-
- com.android.ide.eclipse.adt.PreCompilerBuilder
-
-
-
-
- org.eclipse.jdt.core.javabuilder
-
-
-
-
- com.android.ide.eclipse.adt.ApkBuilder
-
-
-
-
-
- com.android.ide.eclipse.adt.AndroidNature
- org.eclipse.jdt.core.javanature
-
-
diff --git a/facebook/samples/BooleanOGSample/AndroidManifest.xml b/facebook/samples/BooleanOGSample/AndroidManifest.xml
deleted file mode 100644
index d2ac13fc1..000000000
--- a/facebook/samples/BooleanOGSample/AndroidManifest.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/BooleanOGSample/ant.properties b/facebook/samples/BooleanOGSample/ant.properties
deleted file mode 100644
index 939105d52..000000000
--- a/facebook/samples/BooleanOGSample/ant.properties
+++ /dev/null
@@ -1,18 +0,0 @@
-# This file is used to override default values used by the Ant build system.
-#
-# This file must be checked into Version Control Systems, as it is
-# integral to the build system of your project.
-
-# This file is only used by the Ant script.
-
-# You can use this to override default values such as
-# 'source.dir' for the location of your java source folder and
-# 'out.dir' for the location of your output folder.
-
-# You can also use it define how the release builds are signed by declaring
-# the following properties:
-# 'key.store' for the location of your keystore and
-# 'key.alias' for the name of the key to use.
-# The password will be asked during the build when you use the 'release' target.
-
-java.compilerargs=-Xlint -Werror
diff --git a/facebook/samples/BooleanOGSample/build.xml b/facebook/samples/BooleanOGSample/build.xml
deleted file mode 100644
index ce5402793..000000000
--- a/facebook/samples/BooleanOGSample/build.xml
+++ /dev/null
@@ -1,92 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/BooleanOGSample/proguard-project.txt b/facebook/samples/BooleanOGSample/proguard-project.txt
deleted file mode 100644
index f2fe1559a..000000000
--- a/facebook/samples/BooleanOGSample/proguard-project.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-# To enable ProGuard in your project, edit project.properties
-# to define the proguard.config property as described in that file.
-#
-# Add project specific ProGuard rules here.
-# By default, the flags in this file are appended to flags specified
-# in ${sdk.dir}/tools/proguard/proguard-android.txt
-# You can edit the include path and order by changing the ProGuard
-# include property in project.properties.
-#
-# For more details, see
-# http://developer.android.com/guide/developing/tools/proguard.html
-
-# Add any project specific keep options here:
-
-# If your project uses WebView with JS, uncomment the following
-# and specify the fully qualified class name to the JavaScript interface
-# class:
-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
-# public *;
-#}
diff --git a/facebook/samples/BooleanOGSample/project.properties b/facebook/samples/BooleanOGSample/project.properties
deleted file mode 100644
index cee0509c6..000000000
--- a/facebook/samples/BooleanOGSample/project.properties
+++ /dev/null
@@ -1,15 +0,0 @@
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-#
-# This file must be checked in Version Control Systems.
-#
-# To customize properties used by the Ant build system edit
-# "ant.properties", and override values to adapt the script to your
-# project structure.
-#
-# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
-#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
-
-# Project target.
-target=android-8
-android.library.reference.1=../../facebook
diff --git a/facebook/samples/BooleanOGSample/res/drawable-hdpi/icon.png b/facebook/samples/BooleanOGSample/res/drawable-hdpi/icon.png
deleted file mode 100644
index 5bc5b2cea..000000000
Binary files a/facebook/samples/BooleanOGSample/res/drawable-hdpi/icon.png and /dev/null differ
diff --git a/facebook/samples/BooleanOGSample/res/drawable-mdpi/icon.png b/facebook/samples/BooleanOGSample/res/drawable-mdpi/icon.png
deleted file mode 100644
index f621e908c..000000000
Binary files a/facebook/samples/BooleanOGSample/res/drawable-mdpi/icon.png and /dev/null differ
diff --git a/facebook/samples/BooleanOGSample/res/drawable-xhdpi/icon.png b/facebook/samples/BooleanOGSample/res/drawable-xhdpi/icon.png
deleted file mode 100644
index 1adb6bfa3..000000000
Binary files a/facebook/samples/BooleanOGSample/res/drawable-xhdpi/icon.png and /dev/null differ
diff --git a/facebook/samples/BooleanOGSample/res/drawable/false_content.png b/facebook/samples/BooleanOGSample/res/drawable/false_content.png
deleted file mode 100644
index a86d4d296..000000000
Binary files a/facebook/samples/BooleanOGSample/res/drawable/false_content.png and /dev/null differ
diff --git a/facebook/samples/BooleanOGSample/res/drawable/icon.png b/facebook/samples/BooleanOGSample/res/drawable/icon.png
deleted file mode 100644
index f621e908c..000000000
Binary files a/facebook/samples/BooleanOGSample/res/drawable/icon.png and /dev/null differ
diff --git a/facebook/samples/BooleanOGSample/res/drawable/true_content.png b/facebook/samples/BooleanOGSample/res/drawable/true_content.png
deleted file mode 100644
index ce7694f83..000000000
Binary files a/facebook/samples/BooleanOGSample/res/drawable/true_content.png and /dev/null differ
diff --git a/facebook/samples/BooleanOGSample/res/layout/content_group.xml b/facebook/samples/BooleanOGSample/res/layout/content_group.xml
deleted file mode 100644
index 151c17e41..000000000
--- a/facebook/samples/BooleanOGSample/res/layout/content_group.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/BooleanOGSample/res/layout/friend_activity_row.xml b/facebook/samples/BooleanOGSample/res/layout/friend_activity_row.xml
deleted file mode 100644
index 895cc334e..000000000
--- a/facebook/samples/BooleanOGSample/res/layout/friend_activity_row.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/BooleanOGSample/res/layout/friends_group.xml b/facebook/samples/BooleanOGSample/res/layout/friends_group.xml
deleted file mode 100644
index ba7276d5c..000000000
--- a/facebook/samples/BooleanOGSample/res/layout/friends_group.xml
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/BooleanOGSample/res/layout/logic_group.xml b/facebook/samples/BooleanOGSample/res/layout/logic_group.xml
deleted file mode 100644
index 27449519a..000000000
--- a/facebook/samples/BooleanOGSample/res/layout/logic_group.xml
+++ /dev/null
@@ -1,85 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/BooleanOGSample/res/layout/main.xml b/facebook/samples/BooleanOGSample/res/layout/main.xml
deleted file mode 100644
index 7ca777d60..000000000
--- a/facebook/samples/BooleanOGSample/res/layout/main.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/BooleanOGSample/res/layout/settings_group.xml b/facebook/samples/BooleanOGSample/res/layout/settings_group.xml
deleted file mode 100644
index 5cee0a29a..000000000
--- a/facebook/samples/BooleanOGSample/res/layout/settings_group.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/BooleanOGSample/res/values/strings.xml b/facebook/samples/BooleanOGSample/res/values/strings.xml
deleted file mode 100644
index 2aef901c1..000000000
--- a/facebook/samples/BooleanOGSample/res/values/strings.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-
-
-
-
- BooleanOGSample
- 369258453126794
- You Rock!
- Rock with Friends
- Settings
- Content
- Rock the Logic
- False
- True
- AND
- OR
- Friends using Rock the Logic!
- Friend activity
- You Rock!
- Social Features Disabled
-
- There is no open session with Facebook.
- Use the Settings tab to log in and use the social features of this application.
-
- Error
- OK
-
- - @string/true_value
- - @string/false_value
-
-
- You attempted to launch the app from the Facebook app, but are already logged in as a different
- user. Please log out and try again.
-
-
diff --git a/facebook/samples/BooleanOGSample/src/com/facebook/samples/booleanog/LogicActivity.java b/facebook/samples/BooleanOGSample/src/com/facebook/samples/booleanog/LogicActivity.java
deleted file mode 100644
index bd8b6fbb6..000000000
--- a/facebook/samples/BooleanOGSample/src/com/facebook/samples/booleanog/LogicActivity.java
+++ /dev/null
@@ -1,824 +0,0 @@
-/**
- * Copyright 2012 Facebook
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.facebook.samples.booleanog;
-
-import android.app.AlertDialog;
-import android.content.Intent;
-import android.database.MatrixCursor;
-import android.net.Uri;
-import android.os.Bundle;
-import android.os.Parcel;
-import android.os.Parcelable;
-import android.support.v4.app.FragmentActivity;
-import android.support.v4.app.FragmentManager;
-import android.support.v4.app.FragmentTransaction;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.*;
-import com.facebook.*;
-import com.facebook.model.*;
-import com.facebook.widget.FriendPickerFragment;
-import com.facebook.widget.UserSettingsFragment;
-import com.facebook.widget.PickerFragment;
-
-import java.text.SimpleDateFormat;
-import java.util.*;
-
-public class LogicActivity extends FragmentActivity {
-
- private static final String TAG = "BooleanOpenGraphSample";
-
- private static final String SAVE_ACTIVE_TAB = TAG + ".SAVE_ACTIVE_TAB";
- private static final String SAVE_CONTENT_SELECTION = TAG + ".SAVE_CONTENT_SELECTION";
- private static final String SAVE_LEFT_OPERAND_SELECTION = TAG + ".SAVE_LEFT_OPERAND_SELECTION";
- private static final String SAVE_RIGHT_OPERAND_SELECTION = TAG + ".SAVE_RIGHT_OPERAND_SELECTION";
- private static final String SAVE_RESULT_TEXT = TAG + ".SAVE_RESULT_TEXT";
- private static final String SAVE_POST_RESULT_TEXT = TAG + ".SAVE_POST_RESULT_TEXT";
- private static final String SAVE_PENDING = TAG + ".SAVE_PENDING";
- private static final String SAVE_FRIEND_ACTIONS = TAG + ".SAVE_FRIEND_ACTIONS";
- private static final String PENDING_POST_PATH = "PENDING_POST_PATH";
- private static final String PENDING_POST_LEFT = "PENDING_POST_LEFT";
- private static final String PENDING_POST_RIGHT = "PENDING_POST_RIGHT";
- private static final String PENDING_POST_RESULT = "PENDING_POST_RESULT";
-
- private static final String AND_ACTION = "fb_sample_boolean_og:and";
- private static final String OR_ACTION = "fb_sample_boolean_og:or";
- private static final String POST_AND_ACTION_PATH = "me/" + AND_ACTION;
- private static final String POST_OR_ACTION_PATH = "me/" + OR_ACTION;
- private static final String TRUE_GRAPH_OBJECT_URL = "http://samples.ogp.me/369360019783304";
- private static final String FALSE_GRAPH_OBJECT_URL = "http://samples.ogp.me/369360256449947";
- private static final String INSTALLED = "installed";
- private static final List PERMISSIONS = Arrays.asList("publish_actions");
-
- private static volatile TruthValueGraphObject TRUE_GRAPH_OBJECT;
- private static volatile TruthValueGraphObject FALSE_GRAPH_OBJECT;
- private static volatile int TRUE_SPINNER_INDEX = -1;
- private static volatile int FALSE_SPINNER_INDEX = -1;
-
- // Main layout
- private Button logicButton;
- private Button friendsButton;
- private Button settingsButton;
- private Button contentButton;
- private String activeTab;
-
- // Logic group
- private ViewGroup logicGroup;
- private Spinner leftSpinner;
- private Spinner rightSpinner;
- private Button andButton;
- private Button orButton;
- private TextView resultText;
- private TextView postResultText;
- private Bundle pendingPost;
-
- // Friends group
- private ViewGroup friendsGroup;
- private FriendPickerFragment friendPickerFragment;
- private RequestAsyncTask pendingRequest;
- private SimpleCursorAdapter friendActivityAdapter;
- private ProgressBar friendActivityProgressBar;
- private ArrayList friendActionList;
-
- // Login group
- private ViewGroup settingsGroup;
- private UserSettingsFragment userSettingsFragment;
-
- // Content group
- private ViewGroup contentGroup;
- private ImageView contentImage;
- private Spinner contentSpinner;
-
- private UiLifecycleHelper uiHelper;
- private Session.StatusCallback callback = new Session.StatusCallback() {
- @Override
- public void call(Session session, SessionState state, Exception exception) {
- if (exception != null) {
- pendingPost = null;
- } else if (state == SessionState.OPENED) {
- friendPickerFragment.loadData(false);
- } else if (state == SessionState.OPENED_TOKEN_UPDATED) {
- sendPendingPost();
- }
- }
- };
-
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- uiHelper = new UiLifecycleHelper(this, callback);
- uiHelper.onCreate(savedInstanceState);
-
- setContentView(R.layout.main);
-
- // Views
- logicButton = (Button) findViewById(R.id.logic_button);
- friendsButton = (Button) findViewById(R.id.friends_button);
- settingsButton = (Button) findViewById(R.id.settings_button);
- contentButton = (Button) findViewById(R.id.content_button);
-
- logicGroup = (ViewGroup) findViewById(R.id.logic_group);
- leftSpinner = (Spinner) findViewById(R.id.left_spinner);
- rightSpinner = (Spinner) findViewById(R.id.right_spinner);
- andButton = (Button) findViewById(R.id.and_button);
- orButton = (Button) findViewById(R.id.or_button);
- resultText = (TextView) findViewById(R.id.result_text);
- postResultText = (TextView) findViewById(R.id.post_result_text);
-
- friendsGroup = (ViewGroup) findViewById(R.id.friends_group);
- ListView friendActivityList = (ListView) findViewById(R.id.friend_activity_list);
- String[] mapColumnNames = {"date", "action"};
- int[] mapViewIds = {R.id.friend_action_date, R.id.friend_action_data};
- friendActivityAdapter = new SimpleCursorAdapter(this, R.layout.friend_activity_row, createEmptyCursor(),
- mapColumnNames, mapViewIds);
- friendActivityList.setAdapter(friendActivityAdapter);
- friendActivityProgressBar = (ProgressBar) findViewById(R.id.friend_activity_progress_bar);
-
- settingsGroup = (ViewGroup) findViewById(R.id.settings_group);
-
- contentGroup = (ViewGroup) findViewById(R.id.content_group);
- contentImage = (ImageView) findViewById(R.id.content_image);
- contentSpinner = (Spinner) findViewById(R.id.content_spinner);
-
- // Fragments
- FragmentManager fragmentManager = getSupportFragmentManager();
- FragmentTransaction transaction = fragmentManager.beginTransaction();
-
- friendPickerFragment = (FriendPickerFragment) fragmentManager.findFragmentById(R.id.friend_picker_fragment);
- if (friendPickerFragment == null) {
- Bundle args = new Bundle();
- args.putBoolean(FriendPickerFragment.SHOW_TITLE_BAR_BUNDLE_KEY, false);
- friendPickerFragment = new FriendPickerFragment(args);
- transaction.add(R.id.friend_picker_fragment, friendPickerFragment);
- }
-
- userSettingsFragment = (UserSettingsFragment) fragmentManager.findFragmentById(R.id.login_fragment);
- if (userSettingsFragment == null) {
- userSettingsFragment = new UserSettingsFragment();
- transaction.add(R.id.login_fragment, userSettingsFragment);
- }
-
- transaction.commit();
-
- // Spinners
- ArrayAdapter truthAdapter = ArrayAdapter
- .createFromResource(this, R.array.truth_values, android.R.layout.simple_spinner_item);
- truthAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
- leftSpinner.setAdapter(truthAdapter);
- rightSpinner.setAdapter(truthAdapter);
- contentSpinner.setAdapter(truthAdapter);
- leftSpinner.setSelection(0);
- rightSpinner.setSelection(0);
-
- // Navigation
- for (Button button : Arrays.asList(logicButton, friendsButton, settingsButton, contentButton)) {
- initializeNavigationButton(button);
- }
-
- // Logic
- initializeCalculationButton(andButton);
- initializeCalculationButton(orButton);
-
- // Friends
- friendPickerFragment.setOnErrorListener(new PickerFragment.OnErrorListener() {
- @Override
- public void onError(PickerFragment> fragment, FacebookException error) {
- LogicActivity.this.onError(error);
- }
- });
- friendPickerFragment.setUserId("me");
- friendPickerFragment.setMultiSelect(false);
- friendPickerFragment.setOnSelectionChangedListener(new PickerFragment.OnSelectionChangedListener() {
- @Override
- public void onSelectionChanged(PickerFragment> fragment) {
- LogicActivity.this.onFriendSelectionChanged();
- }
- });
- friendPickerFragment.setExtraFields(Arrays.asList(INSTALLED));
- friendPickerFragment.setFilter(new PickerFragment.GraphObjectFilter() {
- @Override
- public boolean includeItem(GraphUser graphObject) {
- Boolean installed = graphObject.cast(GraphUserWithInstalled.class).getInstalled();
- return (installed != null) && installed.booleanValue();
- }
- });
-
- // Content
- contentSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
- @Override
- public void onItemSelected(AdapterView> adapterView, View view, int i, long l) {
- LogicActivity.this.onContentSelectionChanged();
- }
-
- @Override
- public void onNothingSelected(AdapterView> adapterView) {
- LogicActivity.this.onContentSelectionChanged();
- }
- });
-
- // Restore saved state
- Button startButton = logicButton;
-
- if (savedInstanceState != null) {
- leftSpinner.setSelection(savedInstanceState.getInt(SAVE_LEFT_OPERAND_SELECTION));
- rightSpinner.setSelection(savedInstanceState.getInt(SAVE_RIGHT_OPERAND_SELECTION));
- contentSpinner.setSelection(savedInstanceState.getInt(SAVE_CONTENT_SELECTION));
- resultText.setText(savedInstanceState.getString(SAVE_RESULT_TEXT));
- postResultText.setText(savedInstanceState.getString(SAVE_POST_RESULT_TEXT));
- activeTab = savedInstanceState.getString(SAVE_ACTIVE_TAB);
- pendingPost = savedInstanceState.getBundle(SAVE_PENDING);
-
- friendActionList = savedInstanceState.getParcelableArrayList(SAVE_FRIEND_ACTIONS);
- if ((friendActionList != null) && (friendActionList.size() > 0)) {
- updateCursor(friendActionList);
- }
-
- if (getString(R.string.navigate_friends).equals(activeTab)) {
- startButton = friendsButton;
- } else if (getString(R.string.navigate_content).equals(activeTab)) {
- startButton = contentButton;
- } else if (getString(R.string.navigate_settings).equals(activeTab)) {
- startButton = settingsButton;
- }
- }
-
- if (!handleNativeLink()) {
- onNavigateButtonClick(startButton);
- }
- }
-
- // -----------------------------------------------------------------------------------
- // Activity lifecycle
-
- @Override
- public void onStart() {
- super.onStart();
- Session session = Session.getActiveSession();
- if (session != null && session.isOpened()) {
- friendPickerFragment.loadData(false);
- }
- }
-
- @Override
- public void onResume() {
- super.onResume();
- uiHelper.onResume();
- }
-
- @Override
- protected void onSaveInstanceState(Bundle outState) {
- super.onSaveInstanceState(outState);
- uiHelper.onSaveInstanceState(outState);
-
- outState.putInt(SAVE_LEFT_OPERAND_SELECTION, leftSpinner.getSelectedItemPosition());
- outState.putInt(SAVE_RIGHT_OPERAND_SELECTION, rightSpinner.getSelectedItemPosition());
- outState.putInt(SAVE_CONTENT_SELECTION, contentSpinner.getSelectedItemPosition());
- outState.putString(SAVE_RESULT_TEXT, resultText.getText().toString());
- outState.putString(SAVE_POST_RESULT_TEXT, postResultText.getText().toString());
- outState.putString(SAVE_ACTIVE_TAB, activeTab);
- outState.putBundle(SAVE_PENDING, pendingPost);
- outState.putParcelableArrayList(SAVE_FRIEND_ACTIONS, friendActionList);
- }
-
- @Override
- public void onPause() {
- super.onPause();
- uiHelper.onPause();
- }
-
- @Override
- public void onDestroy() {
- super.onDestroy();
- uiHelper.onDestroy();
-
- friendPickerFragment.setOnErrorListener(null);
- friendPickerFragment.setOnSelectionChangedListener(null);
- }
-
- @Override
- public void onActivityResult(int requestCode, int resultCode, Intent data) {
- super.onActivityResult(requestCode, resultCode, data);
- uiHelper.onActivityResult(requestCode, resultCode, data);
- }
-
- // -----------------------------------------------------------------------------------
- // Navigation
-
- private void initializeNavigationButton(Button button) {
- button.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- onNavigateButtonClick((Button) view);
- }
- });
- }
-
- private void onNavigateButtonClick(Button source) {
- activeTab = source.getText().toString();
-
- logicGroup.setVisibility(getGroupVisibility(source, logicButton));
- friendsGroup.setVisibility(getGroupVisibility(source, friendsButton));
- settingsGroup.setVisibility(getGroupVisibility(source, settingsButton));
- contentGroup.setVisibility(getGroupVisibility(source, contentButton));
-
- // Show an error if viewing friends and there is no logged in user.
- if (source == friendsButton) {
- Session session = Session.getActiveSession();
- if ((session == null) || !session.isOpened()) {
- new AlertDialog.Builder(this)
- .setTitle(R.string.feature_requires_login_title)
- .setMessage(R.string.feature_requires_login_message)
- .setPositiveButton(R.string.ok_button, null)
- .show();
- }
- }
- }
-
- private int getGroupVisibility(Button source, Button groupButton) {
- if (source == groupButton) {
- return View.VISIBLE;
- } else {
- return View.GONE;
- }
- }
-
- // -----------------------------------------------------------------------------------
- // Logic group
-
- private void initializeCalculationButton(Button button) {
- button.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- onOperationButtonClick(view);
- }
- });
- }
-
- private void onOperationButtonClick(View view) {
- if (view == andButton) {
- onAndButtonClick();
- } else if (view == orButton) {
- onOrButtonClick();
- } else {
- assert false;
- }
- }
-
- private void onAndButtonClick() {
- boolean leftOperand = getSpinnerBoolean(leftSpinner);
- boolean rightOperand = getSpinnerBoolean(rightSpinner);
- boolean result = leftOperand && rightOperand;
-
- resultText.setText(getLogicText(getString(R.string.and_operation), leftOperand, rightOperand, result));
- postAction(POST_AND_ACTION_PATH, leftOperand, rightOperand, result);
- }
-
- private void onOrButtonClick() {
- boolean leftOperand = getSpinnerBoolean(leftSpinner);
- boolean rightOperand = getSpinnerBoolean(rightSpinner);
- boolean result = leftOperand || rightOperand;
-
- resultText.setText(getLogicText(getString(R.string.or_operation), leftOperand, rightOperand, result));
- postAction(POST_OR_ACTION_PATH, leftOperand, rightOperand, result);
- }
-
- private String getLogicText(String op, boolean leftOperand, boolean rightOperand, boolean result) {
- String trueString = getString(R.string.true_value);
- String falseString = getString(R.string.false_value);
- String arg0String = leftOperand ? trueString : falseString;
- String arg1String = rightOperand ? trueString : falseString;
- String resultString = result ? trueString : falseString;
-
- return String.format("%s %s %s = %s", arg0String, op, arg1String, resultString);
- }
-
- private void postAction(final String actionPath, final boolean leftOperand, final boolean rightOperand,
- final boolean result) {
- Bundle post = new Bundle();
- post.putString(PENDING_POST_PATH, actionPath);
- post.putBoolean(PENDING_POST_LEFT, leftOperand);
- post.putBoolean(PENDING_POST_RIGHT, rightOperand);
- post.putBoolean(PENDING_POST_RESULT, result);
- pendingPost = post;
-
- sendPendingPost();
- }
-
- private void sendPendingPost() {
- if (pendingPost == null) {
- return;
- }
-
- Session session = Session.getActiveSession();
- if ((session == null) || !session.isOpened()) {
- postResultText.setText("Not logged in, no post generated.");
- pendingPost = null;
- return;
- }
-
- List permissions = session.getPermissions();
- if (!permissions.containsAll(PERMISSIONS)) {
- Session.NewPermissionsRequest newPermissionsRequest = new Session.NewPermissionsRequest(this, PERMISSIONS);
- session.requestNewPublishPermissions(newPermissionsRequest);
- return;
- }
-
- postResultText.setText("Posting action...");
-
- // For demo purposes, result is just a boolean, but operands are Open Graph objects
- String actionPath = pendingPost.getString(PENDING_POST_PATH);
- boolean leftOperand = pendingPost.getBoolean(PENDING_POST_LEFT);
- boolean rightOperand = pendingPost.getBoolean(PENDING_POST_RIGHT);
- boolean result = pendingPost.getBoolean(PENDING_POST_RESULT);
-
- LogicAction action = GraphObject.Factory.create(LogicAction.class);
- action.setResult(result);
- action.setTruthvalue(getTruthValueObject(leftOperand));
- action.setAnothertruthvalue(getTruthValueObject(rightOperand));
-
- Request.Callback callback = new Request.Callback() {
- @Override
- public void onCompleted(Response response) {
- onPostActionResponse(response);
- }
- };
- Request request = new Request(session, actionPath, null, HttpMethod.POST,
- callback);
- request.setGraphObject(action);
- RequestAsyncTask task = new RequestAsyncTask(request);
-
- task.execute();
- }
-
- private void onPostActionResponse(Response response) {
- PostResponse postResponse = response.getGraphObjectAs(PostResponse.class);
- if (postResponse != null && postResponse.getId() != null) {
- postResultText.setText("Post id = " + postResponse.getId());
- } else if (response.getError() != null) {
- postResultText.setText(response.getError().getErrorMessage());
- } else {
- postResultText.setText("");
- }
- }
-
- private TruthValueGraphObject getTruthValueObject(boolean value) {
- if (value) {
- if (TRUE_GRAPH_OBJECT == null) {
- TruthValueGraphObject object = GraphObject.Factory
- .create(TruthValueGraphObject.class);
- object.setUrl(TRUE_GRAPH_OBJECT_URL);
- TRUE_GRAPH_OBJECT = object;
- }
- return TRUE_GRAPH_OBJECT;
- } else {
- if (FALSE_GRAPH_OBJECT == null) {
- TruthValueGraphObject object = GraphObject.Factory
- .create(TruthValueGraphObject.class);
- object.setUrl(FALSE_GRAPH_OBJECT_URL);
- FALSE_GRAPH_OBJECT = object;
- }
- return FALSE_GRAPH_OBJECT;
- }
- }
-
- // -----------------------------------------------------------------------------------
- // Friends group
-
- private void onFriendSelectionChanged() {
- GraphUser user = chooseOne(friendPickerFragment.getSelection());
- if (user != null) {
- onChooseFriend(user.getId());
- } else {
- friendActivityAdapter.changeCursor(createEmptyCursor());
- }
- }
-
- private void onChooseFriend(String friendId) {
- friendActivityProgressBar.setVisibility(View.VISIBLE);
-
- String andPath = String.format("%s/%s", friendId, AND_ACTION);
- String orPath = String.format("%s/%s", friendId, OR_ACTION);
- Request getAnds = new Request(Session.getActiveSession(), andPath, null, HttpMethod.GET);
- Request getOrs = new Request(Session.getActiveSession(), orPath, null, HttpMethod.GET);
-
- RequestBatch batch = new RequestBatch(getAnds, getOrs);
-
- if (pendingRequest != null) {
- pendingRequest.cancel(true);
- }
-
- pendingRequest = new RequestAsyncTask(batch) {
- @Override
- protected void onPostExecute(List result) {
- if (pendingRequest == this) {
- pendingRequest = null;
-
- LogicActivity.this.onPostExecute(result);
- }
- }
- };
-
- pendingRequest.execute();
- }
-
- private void onPostExecute(List result) {
- friendActivityProgressBar.setVisibility(View.GONE);
-
- friendActionList = createActionRows(result);
- updateCursor(friendActionList);
- }
-
- private ArrayList createActionRows(List result) {
- ArrayList publishedItems = new ArrayList();
-
- for (Response response : result) {
- if (response.getError() != null) {
- continue;
- }
-
- GraphMultiResult list = response.getGraphObjectAs(GraphMultiResult.class);
- List listData = list.getData().castToListOf(PublishedLogicAction.class);
-
- for (PublishedLogicAction action : listData) {
- publishedItems.add(createActionRow(action));
- }
- }
-
- Collections.sort(publishedItems);
- return publishedItems;
- }
-
- private void updateCursor(Iterable publishedItems) {
- MatrixCursor cursor = createEmptyCursor();
- SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd", Locale.getDefault());
-
- int id = 0;
- for (ActionRow item : publishedItems) {
- Object[] row = new Object[3];
- row[0] = id++;
- row[1] = dateFormat.format(item.publishDate);
- row[2] = item.actionText;
- cursor.addRow(row);
- }
-
- friendActivityAdapter.changeCursor(cursor);
- friendActivityAdapter.notifyDataSetChanged();
- }
-
- private MatrixCursor createEmptyCursor() {
- String[] cursorColumns = {"_ID", "date", "action"};
- return new MatrixCursor(cursorColumns);
- }
-
- private ActionRow createActionRow(PublishedLogicAction action) {
- String actionText = getActionText(action);
- Date publishDate = action.getPublishTime();
-
- return new ActionRow(actionText, publishDate);
- }
-
- private String getActionText(PublishedLogicAction action) {
- LogicAction actionData = action.getData();
- if (actionData == null) {
- return "";
- }
-
- TruthValueGraphObject left = actionData.getTruthvalue();
- TruthValueGraphObject right = actionData.getAnothertruthvalue();
- Boolean actionResult = actionData.getResult();
-
- String verb = action.getType();
- if (AND_ACTION.equals(verb)) {
- verb = getString(R.string.and_operation);
- } else if (OR_ACTION.equals(verb)) {
- verb = getString(R.string.or_operation);
- }
-
- if ((left == null) || (right == null) || (actionResult == null) || (verb == null)) {
- return "";
- }
-
- return String.format("%s %s %s = %s", left.getTitle(), verb, right.getTitle(), actionResult.toString());
- }
-
- // -----------------------------------------------------------------------------------
- // Content group
-
- private Boolean getDeepLinkContent(Uri deepLinkUri) {
- if (deepLinkUri != null) {
- String deepLink = deepLinkUri.toString();
-
- if (deepLink.startsWith(TRUE_GRAPH_OBJECT_URL)) {
- return Boolean.TRUE;
- } else if (deepLink.startsWith(FALSE_GRAPH_OBJECT_URL)) {
- return Boolean.FALSE;
- }
- }
-
- return null;
- }
-
- private void onContentSelectionChanged() {
- Boolean spinnerBoolean = getSpinnerBoolean(contentSpinner);
- if (Boolean.TRUE.equals(spinnerBoolean)) {
- contentImage.setVisibility(View.VISIBLE);
- contentImage.setImageResource(R.drawable.true_content);
- } else if (Boolean.FALSE.equals(spinnerBoolean)) {
- contentImage.setVisibility(View.VISIBLE);
- contentImage.setImageResource(R.drawable.false_content);
- } else {
- contentImage.setImageResource(View.INVISIBLE);
- }
- }
-
- // -----------------------------------------------------------------------------------
- // Utility methods
-
- private boolean handleNativeLink() {
- Session existingSession = Session.getActiveSession();
- // If we have a valid existing session, we'll use it; if not, open one using the provided Intent
- // but do not cache the token (we don't want to use the same user identity the next time the
- // app is run).
- if (existingSession == null || !existingSession.isOpened()) {
- AccessToken accessToken = AccessToken.createFromNativeLinkingIntent(getIntent());
- if (accessToken != null) {
- Session newSession = new Session.Builder(this).setTokenCachingStrategy(new NonCachingTokenCachingStrategy())
- .build();
- newSession.open(accessToken, null);
-
- Session.setActiveSession(newSession);
- }
- }
- // See if we have a deep link in addition.
- Boolean deepLinkContent = getDeepLinkContent(getIntent().getData());
- if (deepLinkContent != null) {
- onNavigateButtonClick(contentButton);
- contentSpinner.setSelection(getSpinnerPosition(deepLinkContent));
- return true;
- }
-
- return false;
- }
-
- private int getSpinnerPosition(Boolean value) {
- initializeSpinnerIndexes();
-
- if (Boolean.TRUE.equals(value)) {
- return TRUE_SPINNER_INDEX;
- } else if (Boolean.FALSE.equals(value)) {
- return FALSE_SPINNER_INDEX;
- } else {
- return -1;
- }
- }
-
- private Boolean getSpinnerBoolean(Spinner spinner) {
- initializeSpinnerIndexes();
-
- int position = spinner.getSelectedItemPosition();
- if (position == TRUE_SPINNER_INDEX) {
- return Boolean.TRUE;
- } else if (position == FALSE_SPINNER_INDEX) {
- return Boolean.FALSE;
- } else {
- return null;
- }
- }
-
- private void initializeSpinnerIndexes() {
- if ((TRUE_SPINNER_INDEX < 0) || (FALSE_SPINNER_INDEX < 0)) {
- String[] truthArray = getResources().getStringArray(R.array.truth_values);
- List truthList = Arrays.asList(truthArray);
- TRUE_SPINNER_INDEX = truthList.indexOf(getString(R.string.true_value));
- FALSE_SPINNER_INDEX = truthList.indexOf(getString(R.string.false_value));
- }
- }
-
- private void onError(Exception error) {
- showErrorMessage(error.getMessage());
- }
-
- private void showErrorMessage(String message) {
- new AlertDialog.Builder(this)
- .setTitle(R.string.error_dialog_title)
- .setMessage(message)
- .setPositiveButton(R.string.ok_button, null)
- .show();
- }
-
- private T chooseOne(List ts) {
- for (T t : ts) {
- return t;
- }
-
- return null;
- }
-
- // -----------------------------------------------------------------------------------
- // Supporting types
-
- private interface GraphUserWithInstalled extends GraphUser {
- Boolean getInstalled();
- }
-
- private static class ActionRow implements Comparable, Parcelable {
- final String actionText;
- final Date publishDate;
-
- ActionRow(String actionText, Date publishDate) {
- this.actionText = actionText;
- this.publishDate = publishDate;
- }
-
- @Override
- public int compareTo(ActionRow other) {
- if (other == null) {
- return 1;
- } else {
- return publishDate.compareTo(other.publishDate);
- }
- }
-
- @Override
- public int describeContents() {
- return 0;
- }
-
- @Override
- public void writeToParcel(Parcel parcel, int flags) {
- parcel.writeString(actionText);
- parcel.writeLong(publishDate.getTime());
- }
-
- @SuppressWarnings("unused")
- public final Creator CREATOR = new Creator() {
- @Override
- public ActionRow createFromParcel(Parcel parcel) {
- String actionText = parcel.readString();
- Date publishDate = new Date(parcel.readLong());
- return new ActionRow(actionText, publishDate);
- }
-
- @Override
- public ActionRow[] newArray(int size) {
- return new ActionRow[size];
- }
- };
- }
-
- /**
- * Used to create and consume TruthValue open graph objects.
- */
- private interface TruthValueGraphObject extends GraphObject {
- void setUrl(String url);
-
- String getTitle();
- }
-
- /**
- * Used to create and consume And an Or open graph actions
- */
- private interface LogicAction extends OpenGraphAction {
- Boolean getResult();
-
- void setResult(Boolean result);
-
- TruthValueGraphObject getTruthvalue();
-
- void setTruthvalue(TruthValueGraphObject truthvalue);
-
- TruthValueGraphObject getAnothertruthvalue();
-
- void setAnothertruthvalue(TruthValueGraphObject anothertruthvalue);
- }
-
- /**
- * Used to consume published And and Or open graph actions.
- */
- private interface PublishedLogicAction extends OpenGraphAction {
- LogicAction getData();
-
- String getType();
- }
-
- /**
- * Used to inspect the response from posting an action
- */
- private interface PostResponse extends GraphObject {
- String getId();
- }
-}
diff --git a/facebook/samples/FriendPickerSample/.classpath b/facebook/samples/FriendPickerSample/.classpath
deleted file mode 100644
index 655a4a827..000000000
--- a/facebook/samples/FriendPickerSample/.classpath
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/FriendPickerSample/.project b/facebook/samples/FriendPickerSample/.project
deleted file mode 100644
index c956fc90d..000000000
--- a/facebook/samples/FriendPickerSample/.project
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
- FriendPickerSample
-
-
-
-
-
- com.android.ide.eclipse.adt.ResourceManagerBuilder
-
-
-
-
- com.android.ide.eclipse.adt.PreCompilerBuilder
-
-
-
-
- org.eclipse.jdt.core.javabuilder
-
-
-
-
- com.android.ide.eclipse.adt.ApkBuilder
-
-
-
-
-
- com.android.ide.eclipse.adt.AndroidNature
- org.eclipse.jdt.core.javanature
-
-
diff --git a/facebook/samples/FriendPickerSample/AndroidManifest.xml b/facebook/samples/FriendPickerSample/AndroidManifest.xml
deleted file mode 100644
index d8f1911cd..000000000
--- a/facebook/samples/FriendPickerSample/AndroidManifest.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/FriendPickerSample/ant.properties b/facebook/samples/FriendPickerSample/ant.properties
deleted file mode 100644
index 939105d52..000000000
--- a/facebook/samples/FriendPickerSample/ant.properties
+++ /dev/null
@@ -1,18 +0,0 @@
-# This file is used to override default values used by the Ant build system.
-#
-# This file must be checked into Version Control Systems, as it is
-# integral to the build system of your project.
-
-# This file is only used by the Ant script.
-
-# You can use this to override default values such as
-# 'source.dir' for the location of your java source folder and
-# 'out.dir' for the location of your output folder.
-
-# You can also use it define how the release builds are signed by declaring
-# the following properties:
-# 'key.store' for the location of your keystore and
-# 'key.alias' for the name of the key to use.
-# The password will be asked during the build when you use the 'release' target.
-
-java.compilerargs=-Xlint -Werror
diff --git a/facebook/samples/FriendPickerSample/build.xml b/facebook/samples/FriendPickerSample/build.xml
deleted file mode 100644
index 92f485560..000000000
--- a/facebook/samples/FriendPickerSample/build.xml
+++ /dev/null
@@ -1,92 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/FriendPickerSample/proguard-project.txt b/facebook/samples/FriendPickerSample/proguard-project.txt
deleted file mode 100644
index f2fe1559a..000000000
--- a/facebook/samples/FriendPickerSample/proguard-project.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-# To enable ProGuard in your project, edit project.properties
-# to define the proguard.config property as described in that file.
-#
-# Add project specific ProGuard rules here.
-# By default, the flags in this file are appended to flags specified
-# in ${sdk.dir}/tools/proguard/proguard-android.txt
-# You can edit the include path and order by changing the ProGuard
-# include property in project.properties.
-#
-# For more details, see
-# http://developer.android.com/guide/developing/tools/proguard.html
-
-# Add any project specific keep options here:
-
-# If your project uses WebView with JS, uncomment the following
-# and specify the fully qualified class name to the JavaScript interface
-# class:
-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
-# public *;
-#}
diff --git a/facebook/samples/FriendPickerSample/project.properties b/facebook/samples/FriendPickerSample/project.properties
deleted file mode 100644
index cee0509c6..000000000
--- a/facebook/samples/FriendPickerSample/project.properties
+++ /dev/null
@@ -1,15 +0,0 @@
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-#
-# This file must be checked in Version Control Systems.
-#
-# To customize properties used by the Ant build system edit
-# "ant.properties", and override values to adapt the script to your
-# project structure.
-#
-# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
-#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
-
-# Project target.
-target=android-8
-android.library.reference.1=../../facebook
diff --git a/facebook/samples/FriendPickerSample/res/drawable-hdpi/icon.png b/facebook/samples/FriendPickerSample/res/drawable-hdpi/icon.png
deleted file mode 100644
index 6a930c6c6..000000000
Binary files a/facebook/samples/FriendPickerSample/res/drawable-hdpi/icon.png and /dev/null differ
diff --git a/facebook/samples/FriendPickerSample/res/drawable-mdpi/icon.png b/facebook/samples/FriendPickerSample/res/drawable-mdpi/icon.png
deleted file mode 100644
index 33b418b7a..000000000
Binary files a/facebook/samples/FriendPickerSample/res/drawable-mdpi/icon.png and /dev/null differ
diff --git a/facebook/samples/FriendPickerSample/res/drawable-xhdpi/icon.png b/facebook/samples/FriendPickerSample/res/drawable-xhdpi/icon.png
deleted file mode 100644
index 494e37a8d..000000000
Binary files a/facebook/samples/FriendPickerSample/res/drawable-xhdpi/icon.png and /dev/null differ
diff --git a/facebook/samples/FriendPickerSample/res/drawable/icon.png b/facebook/samples/FriendPickerSample/res/drawable/icon.png
deleted file mode 100644
index 33b418b7a..000000000
Binary files a/facebook/samples/FriendPickerSample/res/drawable/icon.png and /dev/null differ
diff --git a/facebook/samples/FriendPickerSample/res/layout/main.xml b/facebook/samples/FriendPickerSample/res/layout/main.xml
deleted file mode 100644
index e767ff16f..000000000
--- a/facebook/samples/FriendPickerSample/res/layout/main.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/FriendPickerSample/res/layout/pick_friends_activity.xml b/facebook/samples/FriendPickerSample/res/layout/pick_friends_activity.xml
deleted file mode 100644
index 3dbf01b9a..000000000
--- a/facebook/samples/FriendPickerSample/res/layout/pick_friends_activity.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-
-
-
diff --git a/facebook/samples/FriendPickerSample/res/values/strings.xml b/facebook/samples/FriendPickerSample/res/values/strings.xml
deleted file mode 100644
index ebe6e4bcf..000000000
--- a/facebook/samples/FriendPickerSample/res/values/strings.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
- FriendPickerSample
- 370546396320150
- Error
- OK
-
diff --git a/facebook/samples/FriendPickerSample/src/com/facebook/samples/friendpicker/FriendPickerApplication.java b/facebook/samples/FriendPickerSample/src/com/facebook/samples/friendpicker/FriendPickerApplication.java
deleted file mode 100644
index d72c593eb..000000000
--- a/facebook/samples/FriendPickerSample/src/com/facebook/samples/friendpicker/FriendPickerApplication.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * Copyright 2012 Facebook
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.facebook.samples.friendpicker;
-
-import android.app.Application;
-import com.facebook.model.GraphUser;
-
-import java.util.Collection;
-
-// We use a custom Application class to store our minimal state data (which users have been selected).
-// A real-world application will likely require a more robust data model.
-public class FriendPickerApplication extends Application {
- private Collection selectedUsers;
-
- public Collection getSelectedUsers() {
- return selectedUsers;
- }
-
- public void setSelectedUsers(Collection selectedUsers) {
- this.selectedUsers = selectedUsers;
- }
-}
diff --git a/facebook/samples/FriendPickerSample/src/com/facebook/samples/friendpicker/FriendPickerSampleActivity.java b/facebook/samples/FriendPickerSample/src/com/facebook/samples/friendpicker/FriendPickerSampleActivity.java
deleted file mode 100644
index 42cdfc69e..000000000
--- a/facebook/samples/FriendPickerSample/src/com/facebook/samples/friendpicker/FriendPickerSampleActivity.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/**
- * Copyright 2012 Facebook
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.facebook.samples.friendpicker;
-
-import android.content.Intent;
-import android.os.Bundle;
-import android.support.v4.app.FragmentActivity;
-import android.text.TextUtils;
-import android.view.View;
-import android.widget.Button;
-import android.widget.TextView;
-import com.facebook.model.GraphUser;
-import com.facebook.Session;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-public class FriendPickerSampleActivity extends FragmentActivity {
- private static final int PICK_FRIENDS_ACTIVITY = 1;
- private Button pickFriendsButton;
- private TextView resultsTextView;
-
-
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
-
- resultsTextView = (TextView) findViewById(R.id.resultsTextView);
- pickFriendsButton = (Button) findViewById(R.id.pickFriendsButton);
- pickFriendsButton.setOnClickListener(new View.OnClickListener() {
- public void onClick(View view) {
- onClickPickFriends();
- }
- });
-
- if (Session.getActiveSession() == null ||
- Session.getActiveSession().isClosed()) {
- Session.openActiveSession(this, true, null);
- }
- }
-
- @Override
- protected void onStart() {
- super.onStart();
-
- // Update the display every time we are started.
- displaySelectedFriends(RESULT_OK);
- }
-
- public void onActivityResult(int requestCode, int resultCode, Intent data) {
- switch (requestCode) {
- case PICK_FRIENDS_ACTIVITY:
- displaySelectedFriends(resultCode);
- break;
- default:
- Session.getActiveSession().onActivityResult(this, requestCode, resultCode, data);
- break;
- }
- }
-
- private void displaySelectedFriends(int resultCode) {
- String results = "";
- FriendPickerApplication application = (FriendPickerApplication) getApplication();
-
- Collection selection = application.getSelectedUsers();
- if (selection != null && selection.size() > 0) {
- ArrayList names = new ArrayList();
- for (GraphUser user : selection) {
- names.add(user.getName());
- }
- results = TextUtils.join(", ", names);
- } else {
- results = "";
- }
-
- resultsTextView.setText(results);
- }
-
- private void onClickPickFriends() {
- FriendPickerApplication application = (FriendPickerApplication) getApplication();
- application.setSelectedUsers(null);
-
- Intent intent = new Intent(this, PickFriendsActivity.class);
- // Note: The following line is optional, as multi-select behavior is the default for
- // FriendPickerFragment. It is here to demonstrate how parameters could be passed to the
- // friend picker if single-select functionality was desired, or if a different user ID was
- // desired (for instance, to see friends of a friend).
- PickFriendsActivity.populateParameters(intent, null, true, true);
- startActivityForResult(intent, PICK_FRIENDS_ACTIVITY);
- }
-}
diff --git a/facebook/samples/FriendPickerSample/src/com/facebook/samples/friendpicker/PickFriendsActivity.java b/facebook/samples/FriendPickerSample/src/com/facebook/samples/friendpicker/PickFriendsActivity.java
deleted file mode 100644
index d7232f374..000000000
--- a/facebook/samples/FriendPickerSample/src/com/facebook/samples/friendpicker/PickFriendsActivity.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/**
- * Copyright 2012 Facebook
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.facebook.samples.friendpicker;
-
-import android.app.AlertDialog;
-import android.content.Intent;
-import android.os.Bundle;
-import android.support.v4.app.FragmentActivity;
-import android.support.v4.app.FragmentManager;
-import com.facebook.FacebookException;
-import com.facebook.widget.FriendPickerFragment;
-import com.facebook.widget.PickerFragment;
-
-// This class provides an example of an Activity that uses FriendPickerFragment to display a list of
-// the user's friends. It takes a programmatic approach to creating the FriendPickerFragment with the
-// desired parameters -- see PickPlaceActivity in the PlacePickerSample project for an example of an
-// Activity creating a fragment (in this case a PlacePickerFragment) via XML layout rather than
-// programmatically.
-public class PickFriendsActivity extends FragmentActivity {
- FriendPickerFragment friendPickerFragment;
-
- // A helper to simplify life for callers who want to populate a Bundle with the necessary
- // parameters. A more sophisticated Activity might define its own set of parameters; our needs
- // are simple, so we just populate what we want to pass to the FriendPickerFragment.
- public static void populateParameters(Intent intent, String userId, boolean multiSelect, boolean showTitleBar) {
- intent.putExtra(FriendPickerFragment.USER_ID_BUNDLE_KEY, userId);
- intent.putExtra(FriendPickerFragment.MULTI_SELECT_BUNDLE_KEY, multiSelect);
- intent.putExtra(FriendPickerFragment.SHOW_TITLE_BAR_BUNDLE_KEY, showTitleBar);
- }
-
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.pick_friends_activity);
-
- FragmentManager fm = getSupportFragmentManager();
-
- if (savedInstanceState == null) {
- // First time through, we create our fragment programmatically.
- final Bundle args = getIntent().getExtras();
- friendPickerFragment = new FriendPickerFragment(args);
- fm.beginTransaction()
- .add(R.id.friend_picker_fragment, friendPickerFragment)
- .commit();
- } else {
- // Subsequent times, our fragment is recreated by the framework and already has saved and
- // restored its state, so we don't need to specify args again. (In fact, this might be
- // incorrect if the fragment was modified programmatically since it was created.)
- friendPickerFragment = (FriendPickerFragment) fm.findFragmentById(R.id.friend_picker_fragment);
- }
-
- friendPickerFragment.setOnErrorListener(new PickerFragment.OnErrorListener() {
- @Override
- public void onError(PickerFragment> fragment, FacebookException error) {
- PickFriendsActivity.this.onError(error);
- }
- });
-
- friendPickerFragment.setOnDoneButtonClickedListener(new PickerFragment.OnDoneButtonClickedListener() {
- @Override
- public void onDoneButtonClicked(PickerFragment> fragment) {
- // We just store our selection in the Application for other activities to look at.
- FriendPickerApplication application = (FriendPickerApplication) getApplication();
- application.setSelectedUsers(friendPickerFragment.getSelection());
-
- setResult(RESULT_OK, null);
- finish();
- }
- });
- }
-
- private void onError(Exception error) {
- new AlertDialog.Builder(this)
- .setTitle(R.string.error_dialog_title)
- .setMessage(error.getMessage())
- .setPositiveButton(R.string.ok_button, null)
- .show();
- }
-
- @Override
- protected void onStart() {
- super.onStart();
- try {
- // Load data, unless a query has already taken place.
- friendPickerFragment.loadData(false);
- } catch (Exception ex) {
- onError(ex);
- }
- }
-}
diff --git a/facebook/samples/GraphApiSample/.classpath b/facebook/samples/GraphApiSample/.classpath
deleted file mode 100644
index 655a4a827..000000000
--- a/facebook/samples/GraphApiSample/.classpath
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/GraphApiSample/.project b/facebook/samples/GraphApiSample/.project
deleted file mode 100644
index cb993bbc8..000000000
--- a/facebook/samples/GraphApiSample/.project
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
- GraphApiSample
-
-
-
-
-
- com.android.ide.eclipse.adt.ResourceManagerBuilder
-
-
-
-
- com.android.ide.eclipse.adt.PreCompilerBuilder
-
-
-
-
- org.eclipse.jdt.core.javabuilder
-
-
-
-
- com.android.ide.eclipse.adt.ApkBuilder
-
-
-
-
-
- com.android.ide.eclipse.adt.AndroidNature
- org.eclipse.jdt.core.javanature
-
-
diff --git a/facebook/samples/GraphApiSample/AndroidManifest.xml b/facebook/samples/GraphApiSample/AndroidManifest.xml
deleted file mode 100644
index 3647ce9a0..000000000
--- a/facebook/samples/GraphApiSample/AndroidManifest.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/GraphApiSample/ant.properties b/facebook/samples/GraphApiSample/ant.properties
deleted file mode 100644
index 939105d52..000000000
--- a/facebook/samples/GraphApiSample/ant.properties
+++ /dev/null
@@ -1,18 +0,0 @@
-# This file is used to override default values used by the Ant build system.
-#
-# This file must be checked into Version Control Systems, as it is
-# integral to the build system of your project.
-
-# This file is only used by the Ant script.
-
-# You can use this to override default values such as
-# 'source.dir' for the location of your java source folder and
-# 'out.dir' for the location of your output folder.
-
-# You can also use it define how the release builds are signed by declaring
-# the following properties:
-# 'key.store' for the location of your keystore and
-# 'key.alias' for the name of the key to use.
-# The password will be asked during the build when you use the 'release' target.
-
-java.compilerargs=-Xlint -Werror
diff --git a/facebook/samples/GraphApiSample/build.xml b/facebook/samples/GraphApiSample/build.xml
deleted file mode 100644
index b2456a58c..000000000
--- a/facebook/samples/GraphApiSample/build.xml
+++ /dev/null
@@ -1,92 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/GraphApiSample/proguard-project.txt b/facebook/samples/GraphApiSample/proguard-project.txt
deleted file mode 100644
index f2fe1559a..000000000
--- a/facebook/samples/GraphApiSample/proguard-project.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-# To enable ProGuard in your project, edit project.properties
-# to define the proguard.config property as described in that file.
-#
-# Add project specific ProGuard rules here.
-# By default, the flags in this file are appended to flags specified
-# in ${sdk.dir}/tools/proguard/proguard-android.txt
-# You can edit the include path and order by changing the ProGuard
-# include property in project.properties.
-#
-# For more details, see
-# http://developer.android.com/guide/developing/tools/proguard.html
-
-# Add any project specific keep options here:
-
-# If your project uses WebView with JS, uncomment the following
-# and specify the fully qualified class name to the JavaScript interface
-# class:
-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
-# public *;
-#}
diff --git a/facebook/samples/GraphApiSample/project.properties b/facebook/samples/GraphApiSample/project.properties
deleted file mode 100644
index cee0509c6..000000000
--- a/facebook/samples/GraphApiSample/project.properties
+++ /dev/null
@@ -1,15 +0,0 @@
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-#
-# This file must be checked in Version Control Systems.
-#
-# To customize properties used by the Ant build system edit
-# "ant.properties", and override values to adapt the script to your
-# project structure.
-#
-# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
-#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
-
-# Project target.
-target=android-8
-android.library.reference.1=../../facebook
diff --git a/facebook/samples/GraphApiSample/res/drawable-hdpi/icon.png b/facebook/samples/GraphApiSample/res/drawable-hdpi/icon.png
deleted file mode 100644
index a888af1c6..000000000
Binary files a/facebook/samples/GraphApiSample/res/drawable-hdpi/icon.png and /dev/null differ
diff --git a/facebook/samples/GraphApiSample/res/drawable-mdpi/icon.png b/facebook/samples/GraphApiSample/res/drawable-mdpi/icon.png
deleted file mode 100644
index 2275c8571..000000000
Binary files a/facebook/samples/GraphApiSample/res/drawable-mdpi/icon.png and /dev/null differ
diff --git a/facebook/samples/GraphApiSample/res/drawable-xhdpi/icon.png b/facebook/samples/GraphApiSample/res/drawable-xhdpi/icon.png
deleted file mode 100644
index 31201f160..000000000
Binary files a/facebook/samples/GraphApiSample/res/drawable-xhdpi/icon.png and /dev/null differ
diff --git a/facebook/samples/GraphApiSample/res/drawable/icon.png b/facebook/samples/GraphApiSample/res/drawable/icon.png
deleted file mode 100644
index 2275c8571..000000000
Binary files a/facebook/samples/GraphApiSample/res/drawable/icon.png and /dev/null differ
diff --git a/facebook/samples/GraphApiSample/res/layout/main.xml b/facebook/samples/GraphApiSample/res/layout/main.xml
deleted file mode 100644
index 3861aebbf..000000000
--- a/facebook/samples/GraphApiSample/res/layout/main.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/GraphApiSample/res/values/strings.xml b/facebook/samples/GraphApiSample/res/values/strings.xml
deleted file mode 100644
index f30f73b1f..000000000
--- a/facebook/samples/GraphApiSample/res/values/strings.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-
-
-
- Hello World, GraphApiSampleActivity!
- GraphApiSample
- Request
- Login to create a link to fetch account data
- Log out
- Login failed
- OK
-
-
diff --git a/facebook/samples/GraphApiSample/src/com/facebook/samples/graphapi/GraphApiSampleActivity.java b/facebook/samples/GraphApiSample/src/com/facebook/samples/graphapi/GraphApiSampleActivity.java
deleted file mode 100644
index b3b1c2f44..000000000
--- a/facebook/samples/GraphApiSample/src/com/facebook/samples/graphapi/GraphApiSampleActivity.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/**
- * Copyright 2012 Facebook
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.facebook.samples.graphapi;
-
-import android.app.Activity;
-import android.app.AlertDialog;
-import android.content.Intent;
-import android.os.Bundle;
-import android.view.View;
-import android.view.View.OnClickListener;
-import android.widget.Button;
-import android.widget.EditText;
-import android.widget.TextView;
-import com.facebook.*;
-import com.facebook.Session.StatusCallback;
-import com.facebook.model.GraphObject;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class GraphApiSampleActivity extends Activity {
- static final String applicationId = "307234779396415";
- static final String PENDING_REQUEST_BUNDLE_KEY = "com.facebook.samples.graphapi:PendingRequest";
-
- Button buttonRequest;
- EditText editRequests;
- TextView textViewResults;
- Session session;
- boolean pendingRequest;
-
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
- this.buttonRequest = (Button) findViewById(R.id.buttonRequest);
- this.buttonRequest.setOnClickListener(new OnClickListener() {
- public void onClick(View view) {
- onClickRequest();
- }
- });
- this.editRequests = (EditText) findViewById(R.id.editRequests);
- this.textViewResults = (TextView) findViewById(R.id.textViewResults);
-
- this.session = createSession();
- Settings.addLoggingBehavior(LoggingBehavior.INCLUDE_ACCESS_TOKENS);
- }
-
- public void onActivityResult(int requestCode, int resultCode, Intent data) {
- if (this.session.onActivityResult(this, requestCode, resultCode, data) &&
- pendingRequest &&
- this.session.getState().isOpened()) {
- sendRequests();
- }
- }
-
- @Override
- protected void onRestoreInstanceState(Bundle savedInstanceState) {
- super.onRestoreInstanceState(savedInstanceState);
-
- pendingRequest = savedInstanceState.getBoolean(PENDING_REQUEST_BUNDLE_KEY, pendingRequest);
- }
-
- @Override
- protected void onSaveInstanceState(Bundle outState) {
- super.onSaveInstanceState(outState);
-
- outState.putBoolean(PENDING_REQUEST_BUNDLE_KEY, pendingRequest);
- }
-
- private void onClickRequest() {
- if (this.session.isOpened()) {
- sendRequests();
- } else {
- StatusCallback callback = new StatusCallback() {
- public void call(Session session, SessionState state, Exception exception) {
- if (exception != null) {
- new AlertDialog.Builder(GraphApiSampleActivity.this)
- .setTitle(R.string.login_failed_dialog_title)
- .setMessage(exception.getMessage())
- .setPositiveButton(R.string.ok_button, null)
- .show();
- GraphApiSampleActivity.this.session = createSession();
- }
- }
- };
- pendingRequest = true;
- this.session.openForRead(new Session.OpenRequest(this).setCallback(callback));
- }
- }
-
- private void sendRequests() {
- textViewResults.setText("");
-
- String requestIdsText = editRequests.getText().toString();
- String[] requestIds = requestIdsText.split(",");
-
- List requests = new ArrayList();
- for (final String requestId : requestIds) {
- requests.add(new Request(session, requestId, null, null, new Request.Callback() {
- public void onCompleted(Response response) {
- GraphObject graphObject = response.getGraphObject();
- FacebookRequestError error = response.getError();
- String s = textViewResults.getText().toString();
- if (graphObject != null) {
- if (graphObject.getProperty("id") != null) {
- s = s + String.format("%s: %s\n", graphObject.getProperty("id"), graphObject.getProperty(
- "name"));
- } else {
- s = s + String.format("%s: \n", requestId);
- }
- } else if (error != null) {
- s = s + String.format("Error: %s", error.getErrorMessage());
- }
- textViewResults.setText(s);
- }
- }));
- }
- pendingRequest = false;
- Request.executeBatchAndWait(requests);
- }
-
- private Session createSession() {
- Session activeSession = Session.getActiveSession();
- if (activeSession == null || activeSession.getState().isClosed()) {
- activeSession = new Session.Builder(this).setApplicationId(applicationId).build();
- Session.setActiveSession(activeSession);
- }
- return activeSession;
- }
-}
diff --git a/facebook/samples/Hackbook/.classpath b/facebook/samples/Hackbook/.classpath
deleted file mode 100644
index 655a4a827..000000000
--- a/facebook/samples/Hackbook/.classpath
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/Hackbook/.project b/facebook/samples/Hackbook/.project
deleted file mode 100644
index c453fce2f..000000000
--- a/facebook/samples/Hackbook/.project
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
- Hackbook
-
-
-
-
-
- com.android.ide.eclipse.adt.ResourceManagerBuilder
-
-
-
-
- com.android.ide.eclipse.adt.PreCompilerBuilder
-
-
-
-
- org.eclipse.jdt.core.javabuilder
-
-
-
-
- com.android.ide.eclipse.adt.ApkBuilder
-
-
-
-
-
- com.android.ide.eclipse.adt.AndroidNature
- org.eclipse.jdt.core.javanature
-
-
diff --git a/facebook/samples/Hackbook/AndroidManifest.xml b/facebook/samples/Hackbook/AndroidManifest.xml
deleted file mode 100644
index 3d48e43b5..000000000
--- a/facebook/samples/Hackbook/AndroidManifest.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/Hackbook/Hackbook.eml b/facebook/samples/Hackbook/Hackbook.eml
deleted file mode 100644
index 4104d1ffc..000000000
--- a/facebook/samples/Hackbook/Hackbook.eml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
diff --git a/facebook/samples/Hackbook/README.md b/facebook/samples/Hackbook/README.md
deleted file mode 100644
index 3036a187e..000000000
--- a/facebook/samples/Hackbook/README.md
+++ /dev/null
@@ -1,130 +0,0 @@
-This 'Hackbook for Android' app includes Single Sign On implementation (SSO), sample API calls and Graph API Explorer and is targeted towards android developers who want to make their apps social using Facebook Social Graph. The Code provided here is to showcase how to implement the SSO and make the API calls. If you have any questiosn or comments related to this sample app, please post them here - http://facebook.stackoverflow.com/questions/tagged/hackbook-for-android
-
-Getting Started
-===============
-
-See Android tutorial - https://developers.facebook.com/docs/mobile/android/build/
-
-Configuring the app
-===============
-
-1. Launch Eclipse
-2. Ensure you have installed the Android plugin.
-3. Create Facebook SDK Project - follow the Step-1 instructions in the tutorial
-4. Create the Hackbook Project :
- 4.1 Select __File__ -> __New__ -> __Project__, choose __Android Project__, and then click __Next__.
- 4.2 Select "Create project from existing source".
- 4.3. Choose examples/Hackbook. You should see the project properties populated.
- 4.4. Click Finish to continue.
-5. Add reference to the Facebook SDK - follow the Step-3 instructions in the tutorial
-6. Create a Facebook app if you don't have one already and add the app id in the Hackbook.java->APP_ID
-
-Build the app
-===============
-
-7. And you are done and ready to compile the project:
- 7.1 From the Project menu, select "Build Project".
-
-Run the app
-===============
-
-8. Hopefully project would compile fine. Next run the app on the emulator or on the phone (See http://developer.android.com/guide/developing/eclipse-adt.html#RunConfig for more details.)
- 8.1 If you plan to run on emulator, ensure you have created an Android Virtual Device (AVD):
- 8.1.1 Go to Window -> Android SDK and AVD Manager -> Click New
- 8.1.2 Provide a Name (AVD 2.3 e.g.) and choose the Target (Android 2.3 if available).
- 8.1.3 Click 'Create AVD' at the bottom and that should create an AVD which you can run the app on described next.
-
- 8.2 Go to Run->Run Configurations->Android Application->create a new run configuration by clicking the icon with + button on it.
- 8.3 Name it 'Hackbook'
- 8.4 Under the Project, Browse and choose Hackbook
- 8.5 Go to Target tab -> Choose manual if you wish to run on the phone, else choose Automatic and select an AVD created in step 8.1
- 8.6 Click Run and your 'Hackbook for Android' app should be up and running.
-
-
-Installing the Facebook app
-===============
-
-You will need to have the Facebook application on the handset or the emulator to test the Single Sign On. The SDK includes a developer release of the Facebook application that can be side-loaded for testing purposes. On an actual device, you can just download the latest version of the app from the Android Market, but on the emulator you will have to install it yourself:
-
- adb install FBAndroid.apk
-
-What's in there
-===============
-
-Note: The source tags are provided through out the code base to facilitate easy search for the relevant code. Do a project-wide search for the source tags to get straight to the relevant code. Refer below for source tags for each feature.
-
-1. Login button - This uses SSO to authorize the app. Clicking on Login should activate SSO (if the app is installed) or show OAuth dialog. When authorizing, no permissions are requested and the app will get basic permission by default.
-
-Source Tag - login_tag
-
-- Hackbook.java - this layout the login button and initialize it. Since this is also the calling acitivty, this overrides the onActivityResult() method.
-- LoginButton.java - this calls the mFb.authorize(mActivity, mPermissions, mActivityCode, new LoginDialogListener()) which authorizes the app via SSO or OAuth.
-- SessionStore.java - stores the access token and access expiry time for future app launch. This is important that you save the access token, else user will need to authorize your app each time they launch it which is annoying and user is likely to churn out.
-- SessionEvents.java - Authorization state tracker, calls the listener on login/logout success or error.
-------------------------
-
-2. Update Status - this allows user to update his status by calling the 'feed' dialog. More info on feed dialog - https://developers.facebook.com/docs/reference/dialogs/feed/
-
-Source Tag - update_status_tag, view_post_tag, delete_post_tag
-
-- Hackbook.java - Case 0: update status by calling the 'feed' dialog.
-- UpdateStatusResultDialog.java - shows the object-id returned in the dialog response. You can view or delete the post here.
-------------------------
-
-3. App Requests - this allows to send app requests to user's friends by calling the 'apprequests' dialog. More info - https://developers.facebook.com/docs/reference/dialogs/requests/
-
-Source Tag - app_requests_tag
-
-- Hackbook.java - Case 1: send the app requests by calling the the 'apprequests' dialog.
-------------------------
-
-4. Get Friends - Get user's friends via Graph API or FQL Query. User must be logged-in to use this. Also post on a friend's wall by clicking on his name in the list.
-
-Source Tag - get_friends_tag, friend_wall_tag
-
-- Hackbook.java - Case 2: Use Graph API 'me/friends' which returns friends sorted by UID, currently it's not possible to sort any other way in the Graph API. Use the FQL Query to sort by name - select name, current_location, uid, pic_square from user where uid in (select uid2 from friend where uid1=me()) order by name
-- FriendsList.java - displays the friends profile pic and names as returned by the api. Also post on friend's wall by clicking on the friend.
-- FriendsModel.java - run async tasks to fetch the profile picture limited to 15 tasks at any given time.
-
-5. Upload Photo - Upload a photo either from the media gallery or from a remote server. You require 'photo_upload' to upload photos on user profile.
-
-Source Tag - upload_photo, view_photo_tag, tag_photo_tag
-
-- Hackbook.java - Case 3: Photo is uploaded by posting byte-array or url to me/photos endpoint. Media Gallery is launched by invoking the MediaStore.Images.Media.EXTERNAL_CONTENT_URI intent and overriding the OnActivityResult() to get the picture from the media gallery. Photo from remote server is uploaded by simply providing the image url in the 'url' param in the graph.facebook.com/me/photos endpoint.
-- UploadPhotoResultDialog.java - shows the object-id returned after uploaded the photo. You can view or tag the photo here.
-------------------------
-
-
-6. Place Check-in - Fetch user's current location or use Times Square as the current location and get nearby places which user can check-in at.
-
-Source Tag - fetch_places_tag, check_in_tag
-
-- Hackbook.java - Case 4: Ask to fetch current location or use Times Square as the current location.
-- Places.java - Get user's current location and fetch the nearby places by calling the graph.facebook.com/search?type=places&distance=1000¢er=lat,lon. Check-in user at a place by calling the graph.facebook.com/me/checkins&place=&message=&coordinates={"latitude": , "longitude:": }
-------------------------
-
-7. Run FQL Query - Type and run any FQL Query and see the results.
-
-Source Tag - fql_query_tag
-
-- FQLQuery.java - Layout the FQL Query Dialog and run the query and show the results.
-------------------------
-
-8. Graph API Explorer - Explore user's social graph, see his and friends' connections and get new permissions. This is similar to the Graph Explorer dev tool - http://developers.facebook.com/tools/explorer/. The ObjectIDs in the API response are linkified and can be clicked to fetch object specific data.
- - Click the 'x' button to clear the textfield
- - Click the green up arrow button in the textfield to get the 'me' object data.
- - Click on 'Get Permissions' to get new permissions including user's, his friends or extended permissions.
- - Click on 'Fields/Connections' to see current object's fields and connections.
- - On the Fields & Connections dialog, in the Fields tab, select the fields to view or in the Connections tab, click the connection to view it's content.
-
-Source Tag - graph_explorer
-
-- Hackbook.java - Case 5: Launch the GraphExplorer intent
-- GraphExplorer.java - Layout and execute the graph explorer
-- IntentUriHandler.java - Handle the fbgraphex: schema generated while linkifying the Object IDs in the graph explorer output
-
-
-
-Report Issues/Bugs
-===============
-Please report issues here - http://facebook.stackoverflow.com/questions/tagged/hackbook-for-android
diff --git a/facebook/samples/Hackbook/build.xml b/facebook/samples/Hackbook/build.xml
deleted file mode 100644
index 6c4e58004..000000000
--- a/facebook/samples/Hackbook/build.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/Hackbook/default.properties b/facebook/samples/Hackbook/default.properties
deleted file mode 100644
index 74d10005d..000000000
--- a/facebook/samples/Hackbook/default.properties
+++ /dev/null
@@ -1,14 +0,0 @@
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-#
-# This file must be checked in Version Control Systems.
-#
-# To customize properties used by the Ant build system use,
-# "build.properties", and override values to adapt the script to your
-# project structure.
-
-# Indicates whether an apk should be generated for each density.
-split.density=false
-# Project target.
-target=android-8
-android.library.reference.1=../../facebook
diff --git a/facebook/samples/Hackbook/proguard-project.txt b/facebook/samples/Hackbook/proguard-project.txt
deleted file mode 100644
index f2fe1559a..000000000
--- a/facebook/samples/Hackbook/proguard-project.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-# To enable ProGuard in your project, edit project.properties
-# to define the proguard.config property as described in that file.
-#
-# Add project specific ProGuard rules here.
-# By default, the flags in this file are appended to flags specified
-# in ${sdk.dir}/tools/proguard/proguard-android.txt
-# You can edit the include path and order by changing the ProGuard
-# include property in project.properties.
-#
-# For more details, see
-# http://developer.android.com/guide/developing/tools/proguard.html
-
-# Add any project specific keep options here:
-
-# If your project uses WebView with JS, uncomment the following
-# and specify the fully qualified class name to the JavaScript interface
-# class:
-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
-# public *;
-#}
diff --git a/facebook/samples/Hackbook/project.properties b/facebook/samples/Hackbook/project.properties
deleted file mode 100644
index d97d486bd..000000000
--- a/facebook/samples/Hackbook/project.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-#
-# This file must be checked in Version Control Systems.
-#
-# To customize properties used by the Ant build system edit
-# "ant.properties", and override values to adapt the script to your
-# project structure.
-#
-# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
-#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
-
-# Indicates whether an apk should be generated for each density.
-split.density=false
-# Project target.
-target=android-8
-android.library.reference.1=../../facebook
diff --git a/facebook/samples/Hackbook/res/drawable-hdpi/splash.png b/facebook/samples/Hackbook/res/drawable-hdpi/splash.png
deleted file mode 100644
index 3efb5e80a..000000000
Binary files a/facebook/samples/Hackbook/res/drawable-hdpi/splash.png and /dev/null differ
diff --git a/facebook/samples/Hackbook/res/drawable/icon.png b/facebook/samples/Hackbook/res/drawable/icon.png
deleted file mode 100644
index 7a2d0cbe4..000000000
Binary files a/facebook/samples/Hackbook/res/drawable/icon.png and /dev/null differ
diff --git a/facebook/samples/Hackbook/res/drawable/icon_hack.png b/facebook/samples/Hackbook/res/drawable/icon_hack.png
deleted file mode 100644
index a812187e6..000000000
Binary files a/facebook/samples/Hackbook/res/drawable/icon_hack.png and /dev/null differ
diff --git a/facebook/samples/Hackbook/res/drawable/login.png b/facebook/samples/Hackbook/res/drawable/login.png
deleted file mode 100644
index 95c8dc156..000000000
Binary files a/facebook/samples/Hackbook/res/drawable/login.png and /dev/null differ
diff --git a/facebook/samples/Hackbook/res/drawable/login_button.xml b/facebook/samples/Hackbook/res/drawable/login_button.xml
deleted file mode 100644
index fff9888c6..000000000
--- a/facebook/samples/Hackbook/res/drawable/login_button.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
diff --git a/facebook/samples/Hackbook/res/drawable/login_down.png b/facebook/samples/Hackbook/res/drawable/login_down.png
deleted file mode 100644
index 10d216b3f..000000000
Binary files a/facebook/samples/Hackbook/res/drawable/login_down.png and /dev/null differ
diff --git a/facebook/samples/Hackbook/res/drawable/logout.png b/facebook/samples/Hackbook/res/drawable/logout.png
deleted file mode 100644
index 290272aa0..000000000
Binary files a/facebook/samples/Hackbook/res/drawable/logout.png and /dev/null differ
diff --git a/facebook/samples/Hackbook/res/drawable/logout_button.xml b/facebook/samples/Hackbook/res/drawable/logout_button.xml
deleted file mode 100644
index 0c0c42eb0..000000000
--- a/facebook/samples/Hackbook/res/drawable/logout_button.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
diff --git a/facebook/samples/Hackbook/res/drawable/logout_down.png b/facebook/samples/Hackbook/res/drawable/logout_down.png
deleted file mode 100644
index 1ab14b9dc..000000000
Binary files a/facebook/samples/Hackbook/res/drawable/logout_down.png and /dev/null differ
diff --git a/facebook/samples/Hackbook/res/drawable/me.png b/facebook/samples/Hackbook/res/drawable/me.png
deleted file mode 100644
index 413e20bb9..000000000
Binary files a/facebook/samples/Hackbook/res/drawable/me.png and /dev/null differ
diff --git a/facebook/samples/Hackbook/res/drawable/splash.png b/facebook/samples/Hackbook/res/drawable/splash.png
deleted file mode 100644
index 1892fcec6..000000000
Binary files a/facebook/samples/Hackbook/res/drawable/splash.png and /dev/null differ
diff --git a/facebook/samples/Hackbook/res/drawable/x.png b/facebook/samples/Hackbook/res/drawable/x.png
deleted file mode 100644
index f0978141d..000000000
Binary files a/facebook/samples/Hackbook/res/drawable/x.png and /dev/null differ
diff --git a/facebook/samples/Hackbook/res/layout-land/main.xml b/facebook/samples/Hackbook/res/layout-land/main.xml
deleted file mode 100644
index a5431efb9..000000000
--- a/facebook/samples/Hackbook/res/layout-land/main.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/Hackbook/res/layout-port/main.xml b/facebook/samples/Hackbook/res/layout-port/main.xml
deleted file mode 100644
index a5431efb9..000000000
--- a/facebook/samples/Hackbook/res/layout-port/main.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/Hackbook/res/layout/connection_item.xml b/facebook/samples/Hackbook/res/layout/connection_item.xml
deleted file mode 100644
index 2e0942d06..000000000
--- a/facebook/samples/Hackbook/res/layout/connection_item.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-
-
-
-
diff --git a/facebook/samples/Hackbook/res/layout/fields_connections_list.xml b/facebook/samples/Hackbook/res/layout/fields_connections_list.xml
deleted file mode 100644
index 56a30b868..000000000
--- a/facebook/samples/Hackbook/res/layout/fields_connections_list.xml
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/Hackbook/res/layout/fields_item.xml b/facebook/samples/Hackbook/res/layout/fields_item.xml
deleted file mode 100644
index 0e6c6da11..000000000
--- a/facebook/samples/Hackbook/res/layout/fields_item.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
-
-
diff --git a/facebook/samples/Hackbook/res/layout/fql_query.xml b/facebook/samples/Hackbook/res/layout/fql_query.xml
deleted file mode 100644
index 925cd85cd..000000000
--- a/facebook/samples/Hackbook/res/layout/fql_query.xml
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/Hackbook/res/layout/friend_item.xml b/facebook/samples/Hackbook/res/layout/friend_item.xml
deleted file mode 100644
index 08f167dfe..000000000
--- a/facebook/samples/Hackbook/res/layout/friend_item.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/Hackbook/res/layout/friends_list.xml b/facebook/samples/Hackbook/res/layout/friends_list.xml
deleted file mode 100644
index c6bd45b2d..000000000
--- a/facebook/samples/Hackbook/res/layout/friends_list.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
-
-
diff --git a/facebook/samples/Hackbook/res/layout/graph_explorer.xml b/facebook/samples/Hackbook/res/layout/graph_explorer.xml
deleted file mode 100644
index 9269d45dc..000000000
--- a/facebook/samples/Hackbook/res/layout/graph_explorer.xml
+++ /dev/null
@@ -1,119 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/Hackbook/res/layout/main_list_item.xml b/facebook/samples/Hackbook/res/layout/main_list_item.xml
deleted file mode 100644
index eefb54494..000000000
--- a/facebook/samples/Hackbook/res/layout/main_list_item.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
diff --git a/facebook/samples/Hackbook/res/layout/permission_item.xml b/facebook/samples/Hackbook/res/layout/permission_item.xml
deleted file mode 100644
index 8acabe5dd..000000000
--- a/facebook/samples/Hackbook/res/layout/permission_item.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
diff --git a/facebook/samples/Hackbook/res/layout/permissions_list.xml b/facebook/samples/Hackbook/res/layout/permissions_list.xml
deleted file mode 100644
index f8aafe41f..000000000
--- a/facebook/samples/Hackbook/res/layout/permissions_list.xml
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/Hackbook/res/layout/place_item.xml b/facebook/samples/Hackbook/res/layout/place_item.xml
deleted file mode 100644
index ff89942e1..000000000
--- a/facebook/samples/Hackbook/res/layout/place_item.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-
-
-
-
diff --git a/facebook/samples/Hackbook/res/layout/places_list.xml b/facebook/samples/Hackbook/res/layout/places_list.xml
deleted file mode 100644
index 578774425..000000000
--- a/facebook/samples/Hackbook/res/layout/places_list.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
-
-
diff --git a/facebook/samples/Hackbook/res/layout/splash.xml b/facebook/samples/Hackbook/res/layout/splash.xml
deleted file mode 100644
index 21f1e2dae..000000000
--- a/facebook/samples/Hackbook/res/layout/splash.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
diff --git a/facebook/samples/Hackbook/res/layout/token_refresh.xml b/facebook/samples/Hackbook/res/layout/token_refresh.xml
deleted file mode 100644
index d3b662e93..000000000
--- a/facebook/samples/Hackbook/res/layout/token_refresh.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/Hackbook/res/layout/update_post_response.xml b/facebook/samples/Hackbook/res/layout/update_post_response.xml
deleted file mode 100644
index 34460d7d7..000000000
--- a/facebook/samples/Hackbook/res/layout/update_post_response.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/Hackbook/res/layout/upload_photo_response.xml b/facebook/samples/Hackbook/res/layout/upload_photo_response.xml
deleted file mode 100644
index 49af55d85..000000000
--- a/facebook/samples/Hackbook/res/layout/upload_photo_response.xml
+++ /dev/null
@@ -1,87 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/Hackbook/res/values/colors.xml b/facebook/samples/Hackbook/res/values/colors.xml
deleted file mode 100644
index 095921db0..000000000
--- a/facebook/samples/Hackbook/res/values/colors.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
- #ffffff
- #000000
- #23cf34
- #E47833
- #4E78A0
- #0000FF
- #FF909090
-
diff --git a/facebook/samples/Hackbook/res/values/strings.xml b/facebook/samples/Hackbook/res/values/strings.xml
deleted file mode 100644
index 73d278723..000000000
--- a/facebook/samples/Hackbook/res/values/strings.xml
+++ /dev/null
@@ -1,104 +0,0 @@
-
-
-
-
- Hackbook for Android
- Check out Hackbook for Android to learn how you can make your android apps social using Facebook Platform.
- I am using the Hackbook for Android
- Learn how to make your android apps social.
- Request!
- Upload Photo Wall Post!
- Delete Post
- Graph API Explorer
- Get Permissions
- Access Token:
- https://graph.facebook.com/
- Submit
- Output:
- Show metadata
- Show picture
- URL
- Target URL:
- Exception:
- Tip:
- Error
- Facebook Error:
- Api Response:
- View Source
- View Post
- Delete Post
- Source Code:
- Please wait...
- View Photo
- Hide Photo
- Tag Photo
- Graph API
- FQL Query
- Source tag:
- Source tag: \"perms_tag\"
- Graph API or FQL Query?
- Get friends using Graph or FQL Query?\n\nWith FQL query you can sort the list by names, whereas with Graph list will be ordered by UID and can\'t be changed.
- Post on friend\'s wall
- Friends list fetched. You can post on friend\'s wall by clicking on the item.
- OK
- Post on Wall?
- Would you like to post on %1$s\'s wall
- Yes
- No
- Save
- Reset
- Get Fields
- Fields
- Connections
- Check-in
- Cancel
- User Data
- Friends Data
- Extended
- Upload from gallery or remote?
- Upload picture from phone\' gallery or remote server?
- Gallery
- Remote
- Get Location?
- Get current location or use Times Square as the location?
- Current Location
- Fetching current permissions...
- Also, checkout the web-version of the Graph API Explorer tool
- Fetching nearby places...
- Times Square
- Check-in?
- Permissions
- Back to parent
- Fields \u0026 Connections
- Select Permissions:
- Checkout permissions reference doc
- Fetching Location...
- Would you like to check-in at %1$s?
- \'read_stream\' permission is required to view and delete the post.\n\nUse SDK dialogs to publish stories or post on friends wall. More info \n\nLike and Comment on a post
- Photos are by default uploaded to the app\'s album. Specify album_id to upload to specific album. E.g. https://graph.facebook.com/{album_id}/photos.\n\nMore Info: https://developers.facebook.com/docs/reference/api/photo
- Enter FQL Query:
- Enable GPS
- Please enable GPS to get nearby places and check-in
- GPS Settings
- Refresh Token
- Refresh
- Refreshing…
- In most cases the access token should be refreshed silently when the application is running (for example see Hackbook onResume method).
- Binding to the Facebook Android Application failed (is it installed?).
- Current access token:
- Token expires at:
-
diff --git a/facebook/samples/Hackbook/src/com/facebook/android/BaseDialogListener.java b/facebook/samples/Hackbook/src/com/facebook/android/BaseDialogListener.java
deleted file mode 100644
index 62f039148..000000000
--- a/facebook/samples/Hackbook/src/com/facebook/android/BaseDialogListener.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/**
- * Copyright 2012 Facebook
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.facebook.android;
-
-import com.facebook.android.Facebook.DialogListener;
-
-/**
- * Skeleton base class for RequestListeners, providing default error handling.
- * Applications should handle these error conditions.
- */
-public abstract class BaseDialogListener implements DialogListener {
-
- @Override
- public void onFacebookError(FacebookError e) {
- e.printStackTrace();
- }
-
- @Override
- public void onError(DialogError e) {
- e.printStackTrace();
- }
-
- @Override
- public void onCancel() {
- }
-
-}
\ No newline at end of file
diff --git a/facebook/samples/Hackbook/src/com/facebook/android/BaseRequestListener.java b/facebook/samples/Hackbook/src/com/facebook/android/BaseRequestListener.java
deleted file mode 100644
index 474470e41..000000000
--- a/facebook/samples/Hackbook/src/com/facebook/android/BaseRequestListener.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/**
- * Copyright 2012 Facebook
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.facebook.android;
-
-import android.util.Log;
-import com.facebook.android.AsyncFacebookRunner.RequestListener;
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.net.MalformedURLException;
-
-/**
- * Skeleton base class for RequestListeners, providing default error handling.
- * Applications should handle these error conditions.
- */
-@SuppressWarnings("deprecation")
-public abstract class BaseRequestListener implements RequestListener {
-
- @Override
- public void onFacebookError(FacebookError e, final Object state) {
- Log.e("Facebook", e.getMessage());
- e.printStackTrace();
- }
-
- @Override
- public void onFileNotFoundException(FileNotFoundException e, final Object state) {
- Log.e("Facebook", e.getMessage());
- e.printStackTrace();
- }
-
- @Override
- public void onIOException(IOException e, final Object state) {
- Log.e("Facebook", e.getMessage());
- e.printStackTrace();
- }
-
- @Override
- public void onMalformedURLException(MalformedURLException e, final Object state) {
- Log.e("Facebook", e.getMessage());
- e.printStackTrace();
- }
-
-}
diff --git a/facebook/samples/Hackbook/src/com/facebook/android/FQLQuery.java b/facebook/samples/Hackbook/src/com/facebook/android/FQLQuery.java
deleted file mode 100644
index 33b469b87..000000000
--- a/facebook/samples/Hackbook/src/com/facebook/android/FQLQuery.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/**
- * Copyright 2012 Facebook
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.facebook.android;
-
-import android.app.Activity;
-import android.app.Dialog;
-import android.app.ProgressDialog;
-import android.content.Context;
-import android.os.Bundle;
-import android.os.Handler;
-import android.view.View;
-import android.view.ViewGroup.LayoutParams;
-import android.view.inputmethod.InputMethodManager;
-import android.widget.Button;
-import android.widget.EditText;
-import android.widget.TextView;
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-@SuppressWarnings("deprecation")
-public class FQLQuery extends Dialog {
-
- private EditText mFQLQuery;
- private TextView mFQLOutput;
- private Button mSubmitButton;
- private Activity activity;
- private Handler mHandler;
- private ProgressDialog dialog;
-
- public FQLQuery(Activity activity) {
- super(activity);
- this.activity = activity;
- setTitle(R.string.fqlquery);
- }
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- mHandler = new Handler();
-
- setContentView(R.layout.fql_query);
- LayoutParams params = getWindow().getAttributes();
- params.width = LayoutParams.FILL_PARENT;
- params.height = LayoutParams.FILL_PARENT;
- getWindow().setAttributes((android.view.WindowManager.LayoutParams) params);
-
- mFQLQuery = (EditText) findViewById(R.id.fqlquery);
- mFQLOutput = (TextView) findViewById(R.id.fqlOutput);
- mSubmitButton = (Button) findViewById(R.id.submit_button);
-
- mSubmitButton.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- ((InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE))
- .hideSoftInputFromWindow(mFQLQuery.getWindowToken(), 0);
- dialog = ProgressDialog.show(FQLQuery.this.activity, "",
- FQLQuery.this.activity.getString(R.string.please_wait), true, true);
- /*
- * Source tag: fql_query_tag
- */
- String query = mFQLQuery.getText().toString();
- Bundle params = new Bundle();
- params.putString("method", "fql.query");
- params.putString("query", query);
- Utility.mAsyncRunner.request(null, params, new FQLRequestListener());
- }
- });
- }
-
- public class FQLRequestListener extends BaseRequestListener {
-
- @Override
- public void onComplete(final String response, final Object state) {
- dialog.dismiss();
- /*
- * Output can be a JSONArray or a JSONObject.
- * Try JSONArray and if there's a JSONException, parse to JSONObject
- */
- try {
- JSONArray json = new JSONArray(response);
- setText(json.toString(2));
- } catch (JSONException e) {
- try {
- /*
- * JSONObject probably indicates there was some error
- * Display that error, but for end user you should parse the
- * error and show appropriate message
- */
- JSONObject json = new JSONObject(response);
- setText(json.toString(2));
- } catch (JSONException e1) {
- setText(activity.getString(R.string.exception) + e1.getMessage());
- }
- }
- }
-
- public void onFacebookError(FacebookError error) {
- dialog.dismiss();
- setText(activity.getString(R.string.facebook_error) + error.getMessage());
- }
- }
-
- public void setText(final String txt) {
- mHandler.post(new Runnable() {
- @Override
- public void run() {
- mFQLOutput.setText(txt);
- mFQLOutput.setVisibility(View.VISIBLE);
- }
- });
- }
-}
diff --git a/facebook/samples/Hackbook/src/com/facebook/android/FieldsConnectionsDialog.java b/facebook/samples/Hackbook/src/com/facebook/android/FieldsConnectionsDialog.java
deleted file mode 100644
index ad6b44880..000000000
--- a/facebook/samples/Hackbook/src/com/facebook/android/FieldsConnectionsDialog.java
+++ /dev/null
@@ -1,311 +0,0 @@
-/**
- * Copyright 2012 Facebook
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.facebook.android;
-
-import android.app.Dialog;
-import android.os.Bundle;
-import android.text.SpannableString;
-import android.text.style.UnderlineSpan;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.view.ViewGroup.LayoutParams;
-import android.widget.*;
-import android.widget.AdapterView.OnItemClickListener;
-import android.widget.CompoundButton.OnCheckedChangeListener;
-import android.widget.TabHost.TabSpec;
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Vector;
-
-public class FieldsConnectionsDialog extends Dialog {
-
- private final static int TAB_HEIGHT = 50;
-
- private Button mGetFieldsButton;
- private ListView fieldsList, connectionsList;
- private BaseAdapter fieldsAdapter, connectionsAdapter;
-
- private GraphExplorer explorerActivity;
-
- protected Vector fieldsVector;
- private ArrayList fieldsArray;
- private ArrayList connectionsArray;
-
- public FieldsConnectionsDialog(GraphExplorer explorerActivity, JSONObject metadata) {
- super(explorerActivity);
- this.explorerActivity = explorerActivity;
-
- /*
- * Sort the fields and connections
- */
- try {
- sortFields(metadata.getJSONArray("fields"));
- sortConnections(metadata.getJSONObject("connections").names());
- } catch (JSONException e) {
- Toast.makeText(explorerActivity.getBaseContext(),
- "Fields/Connections could not be fetched.", Toast.LENGTH_SHORT).show();
- }
-
- setTitle(explorerActivity.getString(R.string.fields_and_connections));
- fieldsVector = new Vector();
- }
-
- /*
- * Sort fields which are returned as JSONObject in the JSONArray
- */
- public void sortFields(JSONArray jsonFieldsArray) {
- this.fieldsArray = new ArrayList(jsonFieldsArray.length());
- for (int i = 0; i < jsonFieldsArray.length(); i++) {
- try {
- this.fieldsArray.add(jsonFieldsArray.getJSONObject(i));
- } catch (JSONException e) {
- e.printStackTrace();
- }
- }
-
- Collections.sort(this.fieldsArray, new Comparator() {
- @Override
- public int compare(JSONObject object1, JSONObject object2) {
- try {
- return object1.getString("name").compareToIgnoreCase(object2.getString("name"));
- } catch (JSONException e) {
- e.printStackTrace();
- }
- return 0;
- }
- });
- }
-
- /*
- * Sort the Connections returned in the JSONArray
- */
- public void sortConnections(JSONArray jsonConnectionsArray) {
- this.connectionsArray = new ArrayList(jsonConnectionsArray.length());
- for (int i = 0; i < jsonConnectionsArray.length(); i++) {
- try {
- this.connectionsArray.add(jsonConnectionsArray.get(i).toString());
- } catch (JSONException e) {
- e.printStackTrace();
- }
- }
- Collections.sort(this.connectionsArray);
- }
-
- /*
- * Layout the dialog
- */
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- setContentView(R.layout.fields_connections_list);
- LayoutParams params = getWindow().getAttributes();
- params.width = LayoutParams.FILL_PARENT;
- params.height = LayoutParams.FILL_PARENT;
- getWindow().setAttributes((android.view.WindowManager.LayoutParams) params);
-
- fieldsList = (ListView) findViewById(R.id.fields_list);
- connectionsList = (ListView) findViewById(R.id.connections_list);
-
- fieldsAdapter = new FieldsListAdapter();
- if (this.fieldsArray == null) {
- fieldsList.setAdapter(new ArrayAdapter(explorerActivity,
- android.R.layout.simple_list_item_1, new String[] { "No fields available" }));
- } else {
- fieldsList.setAdapter(fieldsAdapter);
- }
-
- connectionsAdapter = new ConnectionsListAdapter();
- if (this.connectionsArray == null) {
- connectionsList.setAdapter(new ArrayAdapter(explorerActivity,
- android.R.layout.simple_list_item_1,
- new String[] { "No connections available" }));
- } else {
- connectionsList.setAdapter(connectionsAdapter);
- }
-
- TabHost tabHost = (TabHost) findViewById(R.id.tabHost);
- tabHost.setup();
-
- TabSpec spec1 = tabHost.newTabSpec("Tab 1");
- spec1.setIndicator(explorerActivity.getString(R.string.fields));
- spec1.setContent(R.id.fields_layout);
-
- TabSpec spec2 = tabHost.newTabSpec("Tab 2");
- spec2.setIndicator(explorerActivity.getString(R.string.connections));
- spec2.setContent(R.id.connections_list);
-
- tabHost.addTab(spec1);
- tabHost.addTab(spec2);
- tabHost.setCurrentTab(0);
- tabHost.getTabWidget().getChildAt(0).getLayoutParams().height = TAB_HEIGHT;
- tabHost.getTabWidget().getChildAt(1).getLayoutParams().height = TAB_HEIGHT;
-
- mGetFieldsButton = (Button) findViewById(R.id.get_fields_button);
- mGetFieldsButton.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- /*
- * Source Tag:
- */
- FieldsConnectionsDialog.this.dismiss();
- if (!fieldsVector.isEmpty()) {
- explorerActivity.getFields(fieldsVector);
- } else {
- Toast.makeText(explorerActivity.getBaseContext(), "No Fields selected.",
- Toast.LENGTH_SHORT).show();
- }
- }
- });
-
- connectionsList.setOnItemClickListener(new OnItemClickListener() {
- @Override
- public void onItemClick(AdapterView> arg0, View v, int position, long arg3) {
- FieldsConnectionsDialog.this.dismiss();
- explorerActivity.getConnection(connectionsArray.get(position));
- }
- });
- }
-
- /**
- * Definition of the list adapter
- */
- public class FieldsListAdapter extends BaseAdapter {
- private LayoutInflater mInflater;
- boolean[] isChecked;
-
- public FieldsListAdapter() {
- mInflater = LayoutInflater.from(explorerActivity.getBaseContext());
- isChecked = new boolean[fieldsArray.size()];
- }
-
- @Override
- public int getCount() {
- return fieldsArray.size();
- }
-
- @Override
- public Object getItem(int position) {
- return null;
- }
-
- @Override
- public long getItemId(int position) {
- return 0;
- }
-
- @Override
- public View getView(final int position, View convertView, ViewGroup parent) {
-
- View hView = convertView;
- ViewHolder holder;
- JSONObject fieldObject = null;
- fieldObject = fieldsArray.get(position);
-
- if (hView == null) {
- hView = mInflater.inflate(R.layout.fields_item, null);
- holder = new ViewHolder();
- holder.checkbox = (CheckBox) hView.findViewById(R.id.fields_checkbox);
- holder.fieldsInfo = (TextView) hView.findViewById(R.id.fields_info);
- hView.setTag(holder);
- } else {
- holder = (ViewHolder) hView.getTag();
- }
- try {
- holder.checkbox.setText(fieldObject.getString("name"));
- } catch (JSONException e) {
- holder.checkbox.setText("");
- }
- try {
- holder.fieldsInfo.setText(fieldObject.getString("description"));
- } catch (JSONException e) {
- holder.fieldsInfo.setText("");
- }
- holder.checkbox.setId(position);
- holder.checkbox.setChecked(isChecked[position]);
- holder.checkbox.setOnCheckedChangeListener(new OnCheckedChangeListener() {
- @Override
- public void onCheckedChanged(CompoundButton button, boolean checked) {
- isChecked[button.getId()] = checked;
- String field = button.getText().toString();
- if (checked) {
- fieldsVector.add(field);
- } else if (fieldsVector.contains(field)) {
- fieldsVector.remove(field);
- }
- }
- });
-
- return hView;
- }
- }
-
- class ViewHolder {
- CheckBox checkbox;
- TextView fieldsInfo;
- }
-
- /**
- * Definition of the list adapter
- */
- public class ConnectionsListAdapter extends BaseAdapter {
- private LayoutInflater mInflater;
-
- public ConnectionsListAdapter() {
- mInflater = LayoutInflater.from(explorerActivity.getBaseContext());
- }
-
- @Override
- public int getCount() {
- return connectionsArray.size();
- }
-
- @Override
- public Object getItem(int position) {
- return null;
- }
-
- @Override
- public long getItemId(int position) {
- return 0;
- }
-
- @Override
- public View getView(int position, View convertView, ViewGroup parent) {
- View hView = convertView;
- TextView connection;
- if (hView == null) {
- hView = mInflater.inflate(R.layout.connection_item, null);
- connection = (TextView) hView.findViewById(R.id.connection_name);
- hView.setTag(connection);
- } else {
- connection = (TextView) hView.getTag();
- }
- SpannableString name;
- name = new SpannableString(connectionsArray.get(position));
- name.setSpan(new UnderlineSpan(), 0, name.length(), 0);
- connection.setText(name);
- return hView;
- }
- }
-}
diff --git a/facebook/samples/Hackbook/src/com/facebook/android/FriendsGetProfilePics.java b/facebook/samples/Hackbook/src/com/facebook/android/FriendsGetProfilePics.java
deleted file mode 100644
index 6e50a5191..000000000
--- a/facebook/samples/Hackbook/src/com/facebook/android/FriendsGetProfilePics.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/**
- * Copyright 2012 Facebook
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.facebook.android;
-
-import android.graphics.Bitmap;
-import android.os.AsyncTask;
-import android.widget.BaseAdapter;
-
-import java.util.Hashtable;
-import java.util.Stack;
-
-/*
- * Fetch friends profile pictures request via AsyncTask
- */
-public class FriendsGetProfilePics {
-
- Hashtable friendsImages;
- Hashtable positionRequested;
- BaseAdapter listener;
- int runningCount = 0;
- Stack queue;
-
- /*
- * 15 max async tasks at any given time.
- */
- final static int MAX_ALLOWED_TASKS = 15;
-
- public FriendsGetProfilePics() {
- friendsImages = new Hashtable();
- positionRequested = new Hashtable();
- queue = new Stack();
- }
-
- /*
- * Inform the listener when the image has been downloaded. listener is
- * FriendsList here.
- */
- public void setListener(BaseAdapter listener) {
- this.listener = listener;
- reset();
- }
-
- public void reset() {
- positionRequested.clear();
- runningCount = 0;
- queue.clear();
- }
-
- /*
- * If the profile picture has already been downloaded and cached, return it
- * else execute a new async task to fetch it - if total async tasks >15,
- * queue the request.
- */
- public Bitmap getImage(String uid, String url) {
- Bitmap image = friendsImages.get(uid);
- if (image != null) {
- return image;
- }
- if (!positionRequested.containsKey(uid)) {
- positionRequested.put(uid, "");
- if (runningCount >= MAX_ALLOWED_TASKS) {
- queue.push(new ItemPair(uid, url));
- } else {
- runningCount++;
- new GetProfilePicAsyncTask().execute(uid, url);
- }
- }
- return null;
- }
-
- public void getNextImage() {
- if (!queue.isEmpty()) {
- ItemPair item = queue.pop();
- new GetProfilePicAsyncTask().execute(item.uid, item.url);
- }
- }
-
- /*
- * Start a AsyncTask to fetch the request
- */
- private class GetProfilePicAsyncTask extends AsyncTask {
- String uid;
-
- @Override
- protected Bitmap doInBackground(Object... params) {
- this.uid = (String) params[0];
- String url = (String) params[1];
- return Utility.getBitmap(url);
- }
-
- @Override
- protected void onPostExecute(Bitmap result) {
- runningCount--;
- if (result != null) {
- friendsImages.put(uid, result);
- listener.notifyDataSetChanged();
- getNextImage();
- }
- }
- }
-
- class ItemPair {
- String uid;
- String url;
-
- public ItemPair(String uid, String url) {
- this.uid = uid;
- this.url = url;
- }
- }
-
-}
diff --git a/facebook/samples/Hackbook/src/com/facebook/android/FriendsList.java b/facebook/samples/Hackbook/src/com/facebook/android/FriendsList.java
deleted file mode 100644
index 9ad8db031..000000000
--- a/facebook/samples/Hackbook/src/com/facebook/android/FriendsList.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/**
- * Copyright 2012 Facebook
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.facebook.android;
-
-import android.app.Activity;
-import android.app.AlertDialog;
-import android.content.DialogInterface;
-import android.os.Bundle;
-import android.os.Handler;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.*;
-import android.widget.AdapterView.OnItemClickListener;
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-public class FriendsList extends Activity implements OnItemClickListener {
- private Handler mHandler;
-
- protected ListView friendsList;
- protected static JSONArray jsonArray;
- protected String graph_or_fql;
-
- /*
- * Layout the friends' list
- */
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- mHandler = new Handler();
- setContentView(R.layout.friends_list);
-
- Bundle extras = getIntent().getExtras();
- String apiResponse = extras.getString("API_RESPONSE");
- graph_or_fql = extras.getString("METHOD");
- try {
- if (graph_or_fql.equals("graph")) {
- jsonArray = new JSONObject(apiResponse).getJSONArray("data");
- } else {
- jsonArray = new JSONArray(apiResponse);
- }
- } catch (JSONException e) {
- showToast("Error: " + e.getMessage());
- return;
- }
- friendsList = (ListView) findViewById(R.id.friends_list);
- friendsList.setOnItemClickListener(this);
- friendsList.setAdapter(new FriendListAdapter(this));
-
- showToast(getString(R.string.can_post_on_wall));
- }
-
- /*
- * Clicking on a friend should popup a dialog for user to post on friend's
- * wall.
- */
- @Override
- @SuppressWarnings("deprecation")
- public void onItemClick(AdapterView> arg0, View v, int position, long arg3) {
- try {
- final long friendId;
- if (graph_or_fql.equals("graph")) {
- friendId = jsonArray.getJSONObject(position).getLong("id");
- } else {
- friendId = jsonArray.getJSONObject(position).getLong("uid");
- }
- String name = jsonArray.getJSONObject(position).getString("name");
-
- new AlertDialog.Builder(this).setTitle(R.string.post_on_wall_title)
- .setMessage(String.format(getString(R.string.post_on_wall), name))
- .setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- Bundle params = new Bundle();
- /*
- * Source Tag: friend_wall_tag To write on a friend's wall,
- * provide friend's UID in the 'to' parameter.
- * More info on feed dialog:
- * https://developers.facebook.com/docs/reference/dialogs/feed/
- */
- params.putString("to", String.valueOf(friendId));
- params.putString("caption", getString(R.string.app_name));
- params.putString("description", getString(R.string.app_desc));
- params.putString("picture", Utility.HACK_ICON_URL);
- params.putString("name", getString(R.string.app_action));
- Utility.mFacebook.dialog(FriendsList.this, "feed", params,
- new PostDialogListener());
- }
-
- }).setNegativeButton(R.string.no, null).show();
- } catch (JSONException e) {
- showToast("Error: " + e.getMessage());
- }
- }
-
- /*
- * Callback after the message has been posted on friend's wall.
- */
- public class PostDialogListener extends BaseDialogListener {
- @Override
- public void onComplete(Bundle values) {
- final String postId = values.getString("post_id");
- if (postId != null) {
- showToast("Message posted on the wall.");
- } else {
- showToast("No message posted on the wall.");
- }
- }
- }
-
- public void showToast(final String msg) {
- mHandler.post(new Runnable() {
- @Override
- public void run() {
- Toast toast = Toast.makeText(FriendsList.this, msg, Toast.LENGTH_LONG);
- toast.show();
- }
- });
- }
-
- /**
- * Definition of the list adapter
- */
- public class FriendListAdapter extends BaseAdapter {
- private LayoutInflater mInflater;
- FriendsList friendsList;
-
- public FriendListAdapter(FriendsList friendsList) {
- this.friendsList = friendsList;
- if (Utility.model == null) {
- Utility.model = new FriendsGetProfilePics();
- }
- Utility.model.setListener(this);
- mInflater = LayoutInflater.from(friendsList.getBaseContext());
- }
-
- @Override
- public int getCount() {
- return jsonArray.length();
- }
-
- @Override
- public Object getItem(int position) {
- return null;
- }
-
- @Override
- public long getItemId(int position) {
- return 0;
- }
-
- @Override
- public View getView(int position, View convertView, ViewGroup parent) {
- JSONObject jsonObject = null;
- try {
- jsonObject = jsonArray.getJSONObject(position);
- } catch (JSONException e1) {
- e1.printStackTrace();
- }
- View hView = convertView;
- if (convertView == null) {
- hView = mInflater.inflate(R.layout.friend_item, null);
- ViewHolder holder = new ViewHolder();
- holder.profile_pic = (ImageView) hView.findViewById(R.id.profile_pic);
- holder.name = (TextView) hView.findViewById(R.id.name);
- holder.info = (TextView) hView.findViewById(R.id.info);
- hView.setTag(holder);
- }
-
- ViewHolder holder = (ViewHolder) hView.getTag();
- try {
- if (graph_or_fql.equals("graph")) {
- holder.profile_pic.setImageBitmap(Utility.model.getImage(
- jsonObject.getString("id"), jsonObject.getString("picture")));
- } else {
- holder.profile_pic.setImageBitmap(Utility.model.getImage(
- jsonObject.getString("uid"), jsonObject.getString("pic_square")));
- }
- } catch (JSONException e) {
- holder.name.setText("");
- }
- try {
- holder.name.setText(jsonObject.getString("name"));
- } catch (JSONException e) {
- holder.name.setText("");
- }
- try {
- if (graph_or_fql.equals("graph")) {
- holder.info.setText(jsonObject.getJSONObject("location").getString("name"));
- } else {
- JSONObject location = jsonObject.getJSONObject("current_location");
- holder.info.setText(location.getString("city") + ", "
- + location.getString("state"));
- }
-
- } catch (JSONException e) {
- holder.info.setText("");
- }
- return hView;
- }
-
- }
-
- class ViewHolder {
- ImageView profile_pic;
- TextView name;
- TextView info;
- }
-}
diff --git a/facebook/samples/Hackbook/src/com/facebook/android/GraphExplorer.java b/facebook/samples/Hackbook/src/com/facebook/android/GraphExplorer.java
deleted file mode 100644
index 0ca605f5e..000000000
--- a/facebook/samples/Hackbook/src/com/facebook/android/GraphExplorer.java
+++ /dev/null
@@ -1,371 +0,0 @@
-/**
- * Copyright 2012 Facebook
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.facebook.android;
-
-/*
- * The me, delete and back_parent buttons are downloaded from http://icongal.com/
- */
-
-import android.app.Activity;
-import android.app.ProgressDialog;
-import android.content.Context;
-import android.content.Intent;
-import android.net.Uri;
-import android.os.Bundle;
-import android.os.Handler;
-import android.text.TextUtils;
-import android.text.util.Linkify;
-import android.text.util.Linkify.TransformFilter;
-import android.view.View;
-import android.view.View.OnClickListener;
-import android.view.inputmethod.InputMethodManager;
-import android.widget.*;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import java.util.Iterator;
-import java.util.Vector;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-@SuppressWarnings("deprecation")
-public class GraphExplorer extends Activity {
- private Button mSubmitButton, mViewURLButton;
- private Button mGetPermissionsButton;
- private Button mTextDeleteButton, mMeButton;
- private Button mFieldsConnectionsButton, mBackParentButton;
- private TextView mOutput;
- private EditText mInputId;
- private Bundle params;
- private String url, mParentObjectId;
- private ProgressDialog dialog;
- private String rootString;
- private ScrollView mScrollView;
- private Handler mHandler;
- private final static String BASE_GRAPH_URL = "https://graph.facebook.com";
-
- private JSONObject metadataObject;
-
- /*
- * Layout the Graph Explorer
- */
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- mHandler = new Handler();
-
- setContentView(R.layout.graph_explorer);
-
- url = BASE_GRAPH_URL; // Base URL
-
- mInputId = (EditText) findViewById(R.id.inputId);
- mOutput = (TextView) findViewById(R.id.output);
- mSubmitButton = (Button) findViewById(R.id.submitButton);
- mViewURLButton = (Button) findViewById(R.id.viewURLButton);
- mGetPermissionsButton = (Button) findViewById(R.id.accessTokenButton);
- mFieldsConnectionsButton = (Button) findViewById(R.id.fieldsAndConnectionsButton);
- mBackParentButton = (Button) findViewById(R.id.backParentButton);
-
- mScrollView = (ScrollView) findViewById(R.id.ScrollView01);
-
- mTextDeleteButton = (Button) findViewById(R.id.textDeleteButton);
- mMeButton = (Button) findViewById(R.id.meButton);
- if (Utility.mFacebook.isSessionValid()) {
- mMeButton.setVisibility(View.VISIBLE);
- }
-
- params = new Bundle();
- mSubmitButton.setOnClickListener(new OnClickListener() {
- @Override
- public void onClick(View v) {
-
- ((InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE))
- .hideSoftInputFromWindow(mInputId.getWindowToken(), 0);
-
- // Prepare the URL to be shown on 'View URL' click action. This
- // is not used by the SDK
- url = BASE_GRAPH_URL; // Base URL
-
- /*
- * Source Tag: graph_explorer
- */
- rootString = mInputId.getText().toString();
- if (!TextUtils.isEmpty(rootString)) {
- dialog = ProgressDialog.show(GraphExplorer.this, "",
- getString(R.string.please_wait), true, true);
- params.putString("metadata", "1");
- Utility.mAsyncRunner.request(rootString, params, new graphApiRequestListener());
- url += "/" + rootString; // Relative Path provided by you
- }
-
- }
- });
-
- mViewURLButton.setOnClickListener(new OnClickListener() {
- @Override
- public void onClick(View v) {
- setText(url);
- Linkify.addLinks(mOutput, Linkify.WEB_URLS);
- }
- });
-
- mGetPermissionsButton.setOnClickListener(new OnClickListener() {
- @Override
- public void onClick(View v) {
- if (Utility.mFacebook.isSessionValid()) {
- dialog = ProgressDialog.show(GraphExplorer.this, "",
- getString(R.string.fetching_current_permissions), true, true);
- Bundle params = new Bundle();
- params.putString("access_token", Utility.mFacebook.getAccessToken());
- Utility.mAsyncRunner.request("me/permissions", params,
- new permissionsRequestListener());
- } else {
- new PermissionsDialog(GraphExplorer.this).show();
- }
- }
- });
-
- mFieldsConnectionsButton.setOnClickListener(new OnClickListener() {
- @Override
- public void onClick(View v) {
- if (metadataObject == null) {
- makeToast("No fields, connections availalbe for this object.");
- } else {
- new FieldsConnectionsDialog(GraphExplorer.this, metadataObject).show();
- }
- }
- });
-
- mTextDeleteButton.setOnClickListener(new OnClickListener() {
- @Override
- public void onClick(View v) {
- url = BASE_GRAPH_URL; // Base URL
- mParentObjectId = "";
- mInputId.setText("");
- params.clear();
- metadataObject = null;
- setText("");
- mBackParentButton.setVisibility(View.INVISIBLE);
- }
- });
-
- mMeButton.setOnClickListener(new OnClickListener() {
- @Override
- public void onClick(View v) {
- mInputId.setText("me");
- mSubmitButton.performClick();
- }
- });
-
- mBackParentButton.setOnClickListener(new OnClickListener() {
- @Override
- public void onClick(View v) {
- mInputId.setText(mParentObjectId);
- mParentObjectId = "";
- mSubmitButton.performClick();
- }
- });
- }
-
- @Override
- public void onResume() {
- super.onResume();
- if (Utility.mFacebook.isSessionValid()) {
- mMeButton.setVisibility(View.VISIBLE);
- }
- if (Utility.objectID != null) {
- mInputId.setText(Utility.objectID);
- Utility.objectID = null;
- mSubmitButton.performClick();
- }
- }
-
- protected void processIntent(Intent incomingIntent) {
- Uri intentUri = incomingIntent.getData();
- if (intentUri == null) {
- return;
- }
- String objectID = intentUri.getHost();
- mInputId.setText(objectID);
- mSubmitButton.performClick();
- }
-
- public void getConnection(String connection) {
- mInputId.setText(rootString + "/" + connection);
- mParentObjectId = rootString;
- mSubmitButton.performClick();
- }
-
- public void getFields(Vector fieldsVector) {
- String fields = "";
- int count = 0;
- for (String field : fieldsVector) {
- fields += field;
- if (++count < fieldsVector.size()) {
- fields += ",";
- }
- }
- params.putString("fields", fields);
- mSubmitButton.performClick();
- }
-
- /*
- * Callback for the permission OAuth Dialog
- */
- public class permissionsRequestListener extends BaseRequestListener {
-
- @Override
- public void onComplete(final String response, final Object state) {
- dialog.dismiss();
- /*
- * Clear the current permission list and repopulate with new
- * permissions. This is used to mark assigned permission green and
- * unclickable.
- */
- Utility.currentPermissions.clear();
- try {
- JSONObject jsonObject = new JSONObject(response).getJSONArray("data")
- .getJSONObject(0);
- Iterator> iterator = jsonObject.keys();
- String permission;
- while (iterator.hasNext()) {
- permission = (String) iterator.next();
- Utility.currentPermissions.put(permission,
- String.valueOf(jsonObject.getInt(permission)));
- }
- } catch (JSONException e) {
- makeToast("Permissions could not be fetched, none will be selected by default.");
- }
- mHandler.post(new Runnable() {
- @Override
- public void run() {
- new PermissionsDialog(GraphExplorer.this).show();
- }
- });
- }
-
- public void onFacebookError(FacebookError error) {
- dialog.dismiss();
- makeToast("Permissions could not be fetched, none will be selected by default.");
- mHandler.post(new Runnable() {
- @Override
- public void run() {
- new PermissionsDialog(GraphExplorer.this).show();
- }
- });
- }
-
- }
-
- @Override
- protected void onActivityResult(int requestCode, int resultCode, Intent data) {
- Utility.mFacebook.authorizeCallback(requestCode, resultCode, data);
- }
-
- /*
- * Callback after a given Graph API request is executed Get the response and
- * show it.
- */
- public class graphApiRequestListener extends BaseRequestListener {
-
- @Override
- public void onComplete(final String response, final Object state) {
- dialog.dismiss();
- // access token is appended by Facebook object, hence params are
- // added here after request is complete
- if (!params.isEmpty()) {
- url += "?" + Util.encodeUrl(params); // Params
- }
- metadataObject = null;
- params.clear();
- try {
- JSONObject json = Util.parseJson(response);
- if (json.has("metadata")) {
- metadataObject = json.getJSONObject("metadata");
- json.remove("metadata");
- } else {
- metadataObject = null;
- }
- setText(json.toString(2));
- } catch (JSONException e) {
- setText(e.getMessage());
- e.printStackTrace();
- } catch (FacebookError e) {
- setText(e.getMessage());
- e.printStackTrace();
- }
- }
-
- public void onFacebookError(FacebookError error) {
- dialog.dismiss();
- setText(error.getMessage());
- params.clear();
- metadataObject = null;
- }
-
- }
-
- public void setText(final String txt) {
- mHandler.post(new Runnable() {
-
- /*
- * A transform filter that simply returns just the text captured by
- * the first regular expression group.
- */
- TransformFilter idFilter = new TransformFilter() {
- @Override
- public final String transformUrl(final Matcher match, String url) {
- return match.group(1);
- }
- };
-
- @Override
- public void run() {
- mViewURLButton.setVisibility(
- TextUtils.isEmpty(txt) ? View.INVISIBLE : View.VISIBLE);
- mFieldsConnectionsButton.setVisibility(TextUtils.isEmpty(txt) ? View.INVISIBLE
- : View.VISIBLE);
- mOutput.setVisibility(TextUtils.isEmpty(txt) ? View.INVISIBLE : View.VISIBLE);
- mBackParentButton.setVisibility(
- TextUtils.isEmpty(mParentObjectId) ? View.INVISIBLE : View.VISIBLE);
-
- String convertedTxt = txt.replace("\\/", "/");
- mOutput.setText(convertedTxt);
- mScrollView.scrollTo(0, 0);
-
- Linkify.addLinks(mOutput, Linkify.WEB_URLS);
- /*
- * Linkify the object ids so they can be clicked. match pattern:
- * "id" : "objectid" (objectid can be int or int_int)
- */
- Pattern pattern = Pattern.compile("\"id\": \"(\\d*_?\\d*)\"");
- String scheme = "fbGraphEx://";
- Linkify.addLinks(mOutput, pattern, scheme, null, idFilter);
- }
- });
- }
-
- private void makeToast(final String msg) {
- mHandler.post(new Runnable() {
- @Override
- public void run() {
- Toast.makeText(GraphExplorer.this, msg, Toast.LENGTH_SHORT).show();
- }
- });
- }
-}
diff --git a/facebook/samples/Hackbook/src/com/facebook/android/Hackbook.java b/facebook/samples/Hackbook/src/com/facebook/android/Hackbook.java
deleted file mode 100644
index 816a10aa7..000000000
--- a/facebook/samples/Hackbook/src/com/facebook/android/Hackbook.java
+++ /dev/null
@@ -1,620 +0,0 @@
-/**
- * Copyright 2010-present Facebook
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.facebook.android;
-
-import android.app.Activity;
-import android.app.AlertDialog;
-import android.app.ProgressDialog;
-import android.content.DialogInterface;
-import android.content.Intent;
-import android.net.Uri;
-import android.os.Bundle;
-import android.os.Handler;
-import android.provider.MediaStore;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.*;
-import android.widget.AdapterView.OnItemClickListener;
-import com.facebook.android.SessionEvents.AuthListener;
-import com.facebook.android.SessionEvents.LogoutListener;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import java.io.IOException;
-
-@SuppressWarnings("deprecation")
-public class Hackbook extends Activity implements OnItemClickListener {
-
- /*
- * Your Facebook Application ID must be set before running this example See
- * http://www.facebook.com/developers/createapp.php
- */
- public static final String APP_ID = "157111564357680";
-
- private LoginButton mLoginButton;
- private TextView mText;
- private ImageView mUserPic;
- private Handler mHandler;
- ProgressDialog dialog;
-
- final static int AUTHORIZE_ACTIVITY_RESULT_CODE = 0;
- final static int PICK_EXISTING_PHOTO_RESULT_CODE = 1;
-
- private String graph_or_fql;
-
- private ListView list;
- String[] main_items = { "Update Status", "App Requests", "Get Friends", "Upload Photo",
- "Place Check-in", "Run FQL Query", "Graph API Explorer", "Token Refresh" };
- String[] permissions = { "offline_access", "publish_stream", "user_photos", "publish_checkins",
- "photo_upload" };
-
- /** Called when the activity is first created. */
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- if (APP_ID == null) {
- Util.showAlert(this, "Warning", "Facebook Applicaton ID must be "
- + "specified before running this example: see FbAPIs.java");
- return;
- }
-
- setContentView(R.layout.main);
- mHandler = new Handler();
-
- mText = (TextView) Hackbook.this.findViewById(R.id.txt);
- mUserPic = (ImageView) Hackbook.this.findViewById(R.id.user_pic);
-
- // Create the Facebook Object using the app id.
- Utility.mFacebook = new Facebook(APP_ID);
- // Instantiate the asynrunner object for asynchronous api calls.
- Utility.mAsyncRunner = new AsyncFacebookRunner(Utility.mFacebook);
-
- mLoginButton = (LoginButton) findViewById(R.id.login);
-
- // restore session if one exists
- SessionStore.restore(Utility.mFacebook, this);
- SessionEvents.addAuthListener(new FbAPIsAuthListener());
- SessionEvents.addLogoutListener(new FbAPIsLogoutListener());
-
- /*
- * Source Tag: login_tag
- */
- mLoginButton.init(this, AUTHORIZE_ACTIVITY_RESULT_CODE, Utility.mFacebook, permissions);
-
- if (Utility.mFacebook.isSessionValid()) {
- requestUserData();
- }
-
- list = (ListView) findViewById(R.id.main_list);
-
- list.setOnItemClickListener(this);
- list.setAdapter(new ArrayAdapter(this, R.layout.main_list_item, main_items));
- }
-
- @Override
- public void onResume() {
- super.onResume();
- if(Utility.mFacebook != null) {
- if (!Utility.mFacebook.isSessionValid()) {
- mText.setText("You are logged out! ");
- mUserPic.setImageBitmap(null);
- } else {
- Utility.mFacebook.extendAccessTokenIfNeeded(this, null);
- }
- }
- }
-
- @Override
- protected void onActivityResult(int requestCode, int resultCode, Intent data) {
- switch (requestCode) {
- /*
- * if this is the activity result from authorization flow, do a call
- * back to authorizeCallback Source Tag: login_tag
- */
- case AUTHORIZE_ACTIVITY_RESULT_CODE: {
- Utility.mFacebook.authorizeCallback(requestCode, resultCode, data);
- break;
- }
- /*
- * if this is the result for a photo picker from the gallery, upload
- * the image after scaling it. You can use the Utility.scaleImage()
- * function for scaling
- */
- case PICK_EXISTING_PHOTO_RESULT_CODE: {
- if (resultCode == Activity.RESULT_OK) {
- Uri photoUri = data.getData();
- if (photoUri != null) {
- Bundle params = new Bundle();
- try {
- params.putByteArray("photo",
- Utility.scaleImage(getApplicationContext(), photoUri));
- } catch (IOException e) {
- e.printStackTrace();
- }
- params.putString("caption", "FbAPIs Sample App photo upload");
- Utility.mAsyncRunner.request("me/photos", params, "POST",
- new PhotoUploadListener(), null);
- } else {
- Toast.makeText(getApplicationContext(),
- "Error selecting image from the gallery.", Toast.LENGTH_SHORT)
- .show();
- }
- } else {
- Toast.makeText(getApplicationContext(), "No image selected for upload.",
- Toast.LENGTH_SHORT).show();
- }
- break;
- }
- }
- }
-
- @Override
- public void onItemClick(AdapterView> arg0, View v, int position, long arg3) {
- switch (position) {
- /*
- * Source Tag: update_status_tag Update user's status by invoking the
- * feed dialog To post to a friend's wall, provide his uid in the 'to'
- * parameter Refer to
- * https://developers.facebook.com/docs/reference/dialogs/feed/ for more
- * info.
- */
- case 0: {
- Bundle params = new Bundle();
- params.putString("caption", getString(R.string.app_name));
- params.putString("description", getString(R.string.app_desc));
- params.putString("picture", Utility.HACK_ICON_URL);
- params.putString("name", getString(R.string.app_action));
-
- Utility.mFacebook.dialog(Hackbook.this, "feed", params, new UpdateStatusListener());
- String access_token = Utility.mFacebook.getAccessToken();
- System.out.println(access_token);
- break;
- }
-
- /*
- * Source Tag: app_requests Send an app request to friends. If no
- * friend is specified, the user will see a friend selector and will
- * be able to select a maximum of 50 recipients. To send request to
- * specific friend, provide the uid in the 'to' parameter Refer to
- * https://developers.facebook.com/docs/reference/dialogs/requests/
- * for more info.
- */
- case 1: {
- Bundle params = new Bundle();
- params.putString("message", getString(R.string.request_message));
- Utility.mFacebook.dialog(Hackbook.this, "apprequests", params,
- new AppRequestsListener());
- break;
- }
-
- /*
- * Source Tag: friends_tag You can get friends using
- * graph.facebook.com/me/friends, this returns the list sorted by
- * UID OR using the friend table. With this you can sort the way you
- * want it.
- * Friend table - https://developers.facebook.com/docs/reference/fql/friend/
- * User table - https://developers.facebook.com/docs/reference/fql/user/
- */
- case 2: {
- if (!Utility.mFacebook.isSessionValid()) {
- Util.showAlert(this, "Warning", "You must first log in.");
- } else {
- dialog = ProgressDialog.show(Hackbook.this, "",
- getString(R.string.please_wait), true, true);
- new AlertDialog.Builder(this)
- .setTitle(R.string.Graph_FQL_title)
- .setMessage(R.string.Graph_FQL_msg)
- .setPositiveButton(R.string.graph_button,
- new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- graph_or_fql = "graph";
- Bundle params = new Bundle();
- params.putString("fields", "name, picture, location");
- Utility.mAsyncRunner.request("me/friends", params,
- new FriendsRequestListener());
- }
-
- })
- .setNegativeButton(R.string.fql_button,
- new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- graph_or_fql = "fql";
- String query = "select name, current_location, uid, pic_square from user where uid in (select uid2 from friend where uid1=me()) order by name";
- Bundle params = new Bundle();
- params.putString("method", "fql.query");
- params.putString("query", query);
- Utility.mAsyncRunner.request(null, params,
- new FriendsRequestListener());
- }
-
- }).setOnCancelListener(new DialogInterface.OnCancelListener() {
- @Override
- public void onCancel(DialogInterface d) {
- dialog.dismiss();
- }
- }).show();
- }
- break;
- }
-
- /*
- * Source Tag: upload_photo You can upload a photo from the media
- * gallery or from a remote server How to upload photo:
- * https://developers.facebook.com/blog/post/498/
- */
- case 3: {
- if (!Utility.mFacebook.isSessionValid()) {
- Util.showAlert(this, "Warning", "You must first log in.");
- } else {
- dialog = ProgressDialog.show(Hackbook.this, "",
- getString(R.string.please_wait), true, true);
- new AlertDialog.Builder(this)
- .setTitle(R.string.gallery_remote_title)
- .setMessage(R.string.gallery_remote_msg)
- .setPositiveButton(R.string.gallery_button,
- new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- Intent intent = new Intent(Intent.ACTION_PICK,
- (MediaStore.Images.Media.EXTERNAL_CONTENT_URI));
- startActivityForResult(intent,
- PICK_EXISTING_PHOTO_RESULT_CODE);
- }
-
- })
- .setNegativeButton(R.string.remote_button,
- new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- /*
- * Source tag: upload_photo_tag
- */
- Bundle params = new Bundle();
- params.putString("url",
- "http://www.facebook.com/images/devsite/iphone_connect_btn.jpg");
- params.putString("caption",
- "FbAPIs Sample App photo upload");
- Utility.mAsyncRunner.request("me/photos", params,
- "POST", new PhotoUploadListener(), null);
- }
-
- }).setOnCancelListener(new DialogInterface.OnCancelListener() {
- @Override
- public void onCancel(DialogInterface d) {
- dialog.dismiss();
- }
- }).show();
- }
- break;
- }
-
- /*
- * User can check-in to a place, you require publish_checkins
- * permission for that. You can use the default Times Square
- * location or fetch user's current location. Get user's checkins:
- * https://developers.facebook.com/docs/reference/api/checkin/
- */
- case 4: {
- final Intent myIntent = new Intent(getApplicationContext(), Places.class);
-
- new AlertDialog.Builder(this)
- .setTitle(R.string.get_location)
- .setMessage(R.string.get_default_or_new_location)
- .setPositiveButton(R.string.current_location_button,
- new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- myIntent.putExtra("LOCATION", "current");
- startActivity(myIntent);
- }
- })
- .setNegativeButton(R.string.times_square_button,
- new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- myIntent.putExtra("LOCATION", "times_square");
- startActivity(myIntent);
- }
-
- }).show();
- break;
- }
-
- case 5: {
- if (!Utility.mFacebook.isSessionValid()) {
- Util.showAlert(this, "Warning", "You must first log in.");
- } else {
- new FQLQuery(Hackbook.this).show();
- }
- break;
- }
- /*
- * This is advanced feature where you can request new permissions
- * Browser user's graph, his fields and connections. This is similar
- * to the www version:
- * http://developers.facebook.com/tools/explorer/
- */
- case 6: {
- Intent myIntent = new Intent(getApplicationContext(), GraphExplorer.class);
- if (Utility.mFacebook.isSessionValid()) {
- Utility.objectID = "me";
- }
- startActivity(myIntent);
- break;
- }
-
- case 7: {
- if(!Utility.mFacebook.isSessionValid()) {
- Util.showAlert(this, "Warning", "You must first log in.");
- } else {
- new TokenRefreshDialog(Hackbook.this).show();
- }
- }
- }
- }
-
- /*
- * callback for the feed dialog which updates the profile status
- */
- public class UpdateStatusListener extends BaseDialogListener {
- @Override
- public void onComplete(Bundle values) {
- final String postId = values.getString("post_id");
- if (postId != null) {
- new UpdateStatusResultDialog(Hackbook.this, "Update Status executed", values)
- .show();
- } else {
- Toast toast = Toast.makeText(getApplicationContext(), "No wall post made",
- Toast.LENGTH_SHORT);
- toast.show();
- }
- }
-
- @Override
- public void onFacebookError(FacebookError error) {
- Toast.makeText(getApplicationContext(), "Facebook Error: " + error.getMessage(),
- Toast.LENGTH_SHORT).show();
- }
-
- @Override
- public void onCancel() {
- Toast toast = Toast.makeText(getApplicationContext(), "Update status cancelled",
- Toast.LENGTH_SHORT);
- toast.show();
- }
- }
-
- /*
- * callback for the apprequests dialog which sends an app request to user's
- * friends.
- */
- public class AppRequestsListener extends BaseDialogListener {
- @Override
- public void onComplete(Bundle values) {
- Toast toast = Toast.makeText(getApplicationContext(), "App request sent",
- Toast.LENGTH_SHORT);
- toast.show();
- }
-
- @Override
- public void onFacebookError(FacebookError error) {
- Toast.makeText(getApplicationContext(), "Facebook Error: " + error.getMessage(),
- Toast.LENGTH_SHORT).show();
- }
-
- @Override
- public void onCancel() {
- Toast toast = Toast.makeText(getApplicationContext(), "App request cancelled",
- Toast.LENGTH_SHORT);
- toast.show();
- }
- }
-
- /*
- * callback after friends are fetched via me/friends or fql query.
- */
- public class FriendsRequestListener extends BaseRequestListener {
-
- @Override
- public void onComplete(final String response, final Object state) {
- dialog.dismiss();
- Intent myIntent = new Intent(getApplicationContext(), FriendsList.class);
- myIntent.putExtra("API_RESPONSE", response);
- myIntent.putExtra("METHOD", graph_or_fql);
- startActivity(myIntent);
- }
-
- public void onFacebookError(FacebookError error) {
- dialog.dismiss();
- Toast.makeText(getApplicationContext(), "Facebook Error: " + error.getMessage(),
- Toast.LENGTH_SHORT).show();
- }
- }
-
- /*
- * callback for the photo upload
- */
- public class PhotoUploadListener extends BaseRequestListener {
-
- @Override
- public void onComplete(final String response, final Object state) {
- dialog.dismiss();
- mHandler.post(new Runnable() {
- @Override
- public void run() {
- new UploadPhotoResultDialog(Hackbook.this, "Upload Photo executed", response)
- .show();
- }
- });
- }
-
- public void onFacebookError(FacebookError error) {
- dialog.dismiss();
- Toast.makeText(getApplicationContext(), "Facebook Error: " + error.getMessage(),
- Toast.LENGTH_LONG).show();
- }
- }
-
- public class FQLRequestListener extends BaseRequestListener {
-
- @Override
- public void onComplete(final String response, final Object state) {
- mHandler.post(new Runnable() {
- @Override
- public void run() {
- Toast.makeText(getApplicationContext(), "Response: " + response,
- Toast.LENGTH_LONG).show();
- }
- });
- }
-
- public void onFacebookError(FacebookError error) {
- Toast.makeText(getApplicationContext(), "Facebook Error: " + error.getMessage(),
- Toast.LENGTH_LONG).show();
- }
- }
-
- /*
- * Callback for fetching current user's name, picture, uid.
- */
- public class UserRequestListener extends BaseRequestListener {
-
- @Override
- public void onComplete(final String response, final Object state) {
- JSONObject jsonObject;
- try {
- jsonObject = new JSONObject(response);
-
- final String picURL = jsonObject.getJSONObject("picture")
- .getJSONObject("data").getString("url");
- final String name = jsonObject.getString("name");
- Utility.userUID = jsonObject.getString("id");
-
- mHandler.post(new Runnable() {
- @Override
- public void run() {
- mText.setText("Welcome " + name + "!");
- mUserPic.setImageBitmap(Utility.getBitmap(picURL));
- }
- });
-
- } catch (JSONException e) {
- e.printStackTrace();
- }
- }
-
- }
-
- /*
- * The Callback for notifying the application when authorization succeeds or
- * fails.
- */
-
- public class FbAPIsAuthListener implements AuthListener {
-
- @Override
- public void onAuthSucceed() {
- requestUserData();
- }
-
- @Override
- public void onAuthFail(String error) {
- mText.setText("Login Failed: " + error);
- }
- }
-
- /*
- * The Callback for notifying the application when log out starts and
- * finishes.
- */
- public class FbAPIsLogoutListener implements LogoutListener {
- @Override
- public void onLogoutBegin() {
- mText.setText("Logging out...");
- }
-
- @Override
- public void onLogoutFinish() {
- mText.setText("You have logged out! ");
- mUserPic.setImageBitmap(null);
- }
- }
-
- /*
- * Request user name, and picture to show on the main screen.
- */
- public void requestUserData() {
- mText.setText("Fetching user name, profile pic...");
- Bundle params = new Bundle();
- params.putString("fields", "name, picture");
- Utility.mAsyncRunner.request("me", params, new UserRequestListener());
- }
-
- /**
- * Definition of the list adapter
- */
- public class MainListAdapter extends BaseAdapter {
- private LayoutInflater mInflater;
-
- public MainListAdapter() {
- mInflater = LayoutInflater.from(Hackbook.this.getBaseContext());
- }
-
- @Override
- public int getCount() {
- return main_items.length;
- }
-
- @Override
- public Object getItem(int position) {
- return null;
- }
-
- @Override
- public long getItemId(int position) {
- return 0;
- }
-
- @Override
- public View getView(int position, View convertView, ViewGroup parent) {
-
- View hView = convertView;
- if (convertView == null) {
- hView = mInflater.inflate(R.layout.main_list_item, null);
- ViewHolder holder = new ViewHolder();
- holder.main_list_item = (TextView) hView.findViewById(R.id.main_api_item);
- hView.setTag(holder);
- }
-
- ViewHolder holder = (ViewHolder) hView.getTag();
-
- holder.main_list_item.setText(main_items[position]);
-
- return hView;
- }
-
- }
-
- class ViewHolder {
- TextView main_list_item;
- }
-
-}
diff --git a/facebook/samples/Hackbook/src/com/facebook/android/IntentUriHandler.java b/facebook/samples/Hackbook/src/com/facebook/android/IntentUriHandler.java
deleted file mode 100644
index 6b1601108..000000000
--- a/facebook/samples/Hackbook/src/com/facebook/android/IntentUriHandler.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- * Copyright 2012 Facebook
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.facebook.android;
-
-import android.app.Activity;
-import android.content.Intent;
-import android.net.Uri;
-import android.os.Bundle;
-
-/**
- * A transient activity which handles fbgraphex: URIs and passes those to the
- * GraphExplorer class This is used to linkify the Object IDs in the graph api
- * response
- */
-public class IntentUriHandler extends Activity {
-
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- Intent incomingIntent = getIntent();
- if (incomingIntent != null) {
- Uri intentUri = incomingIntent.getData();
- if (intentUri != null) {
- Utility.objectID = intentUri.getHost();
- Intent graphIntent = new Intent(getApplicationContext(), GraphExplorer.class);
- graphIntent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
- startActivity(graphIntent);
- }
- finish();
- }
- }
-}
diff --git a/facebook/samples/Hackbook/src/com/facebook/android/LoginButton.java b/facebook/samples/Hackbook/src/com/facebook/android/LoginButton.java
deleted file mode 100644
index 30189b88c..000000000
--- a/facebook/samples/Hackbook/src/com/facebook/android/LoginButton.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/**
- * Copyright 2010-present Facebook
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.facebook.android;
-
-import android.app.Activity;
-import android.content.Context;
-import android.graphics.Color;
-import android.os.Bundle;
-import android.os.Handler;
-import android.util.AttributeSet;
-import android.view.View;
-import android.widget.ImageButton;
-import com.facebook.android.Facebook.DialogListener;
-import com.facebook.android.SessionEvents.AuthListener;
-import com.facebook.android.SessionEvents.LogoutListener;
-
-@SuppressWarnings("deprecation")
-public class LoginButton extends ImageButton {
-
- private Facebook mFb;
- private Handler mHandler;
- private SessionListener mSessionListener = new SessionListener();
- private String[] mPermissions;
- private Activity mActivity;
- private int mActivityCode;
-
- public LoginButton(Context context) {
- super(context);
- }
-
- public LoginButton(Context context, AttributeSet attrs) {
- super(context, attrs);
- }
-
- public LoginButton(Context context, AttributeSet attrs, int defStyle) {
- super(context, attrs, defStyle);
- }
-
- public void init(final Activity activity, final int activityCode, final Facebook fb) {
- init(activity, activityCode, fb, new String[] {});
- }
-
- public void init(final Activity activity, final int activityCode, final Facebook fb,
- final String[] permissions) {
- mActivity = activity;
- mActivityCode = activityCode;
- mFb = fb;
- mPermissions = permissions;
- mHandler = new Handler();
-
- setBackgroundColor(Color.TRANSPARENT);
- setImageResource(fb.isSessionValid() ? R.drawable.logout_button : R.drawable.login_button);
- drawableStateChanged();
-
- SessionEvents.addAuthListener(mSessionListener);
- SessionEvents.addLogoutListener(mSessionListener);
- setOnClickListener(new ButtonOnClickListener());
- }
-
- private final class ButtonOnClickListener implements OnClickListener {
- /*
- * Source Tag: login_tag
- */
- @Override
- public void onClick(View arg0) {
- if (mFb.isSessionValid()) {
- SessionEvents.onLogoutBegin();
- AsyncFacebookRunner asyncRunner = new AsyncFacebookRunner(mFb);
- asyncRunner.logout(getContext(), new LogoutRequestListener());
- } else {
- mFb.authorize(mActivity, mPermissions, mActivityCode, new LoginDialogListener());
- }
- }
- }
-
- private final class LoginDialogListener implements DialogListener {
- @Override
- public void onComplete(Bundle values) {
- SessionEvents.onLoginSuccess();
- }
-
- @Override
- public void onFacebookError(FacebookError error) {
- SessionEvents.onLoginError(error.getMessage());
- }
-
- @Override
- public void onError(DialogError error) {
- SessionEvents.onLoginError(error.getMessage());
- }
-
- @Override
- public void onCancel() {
- SessionEvents.onLoginError("Action Canceled");
- }
- }
-
- private class LogoutRequestListener extends BaseRequestListener {
- @Override
- public void onComplete(String response, final Object state) {
- /*
- * callback should be run in the original thread, not the background
- * thread
- */
- mHandler.post(new Runnable() {
- @Override
- public void run() {
- SessionEvents.onLogoutFinish();
- }
- });
- }
- }
-
- private class SessionListener implements AuthListener, LogoutListener {
-
- @Override
- public void onAuthSucceed() {
- setImageResource(R.drawable.logout_button);
- SessionStore.save(mFb, getContext());
- }
-
- @Override
- public void onAuthFail(String error) {
- }
-
- @Override
- public void onLogoutBegin() {
- }
-
- @Override
- public void onLogoutFinish() {
- SessionStore.clear(getContext());
- setImageResource(R.drawable.login_button);
- }
- }
-
-}
diff --git a/facebook/samples/Hackbook/src/com/facebook/android/PermissionsDialog.java b/facebook/samples/Hackbook/src/com/facebook/android/PermissionsDialog.java
deleted file mode 100644
index 4e4d4dc3e..000000000
--- a/facebook/samples/Hackbook/src/com/facebook/android/PermissionsDialog.java
+++ /dev/null
@@ -1,260 +0,0 @@
-/**
- * Copyright 2012 Facebook
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.facebook.android;
-
-import android.app.Activity;
-import android.app.Dialog;
-import android.graphics.Color;
-import android.os.Bundle;
-import android.text.method.LinkMovementMethod;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.view.ViewGroup.LayoutParams;
-import android.widget.*;
-import android.widget.CompoundButton.OnCheckedChangeListener;
-import android.widget.TabHost.TabSpec;
-import com.facebook.android.Facebook.DialogListener;
-
-import java.util.Vector;
-
-@SuppressWarnings("deprecation")
-public class PermissionsDialog extends Dialog {
-
- private final static int TAB_HEIGHT = 50;
-
- private Button mGetPermissions;
- private TextView mPermissionDetails;
-
- private Activity activity;
-
- private ListView userPermissionsList, friendPermissionsList, extendedPermissionsList;
-
- private BaseAdapter userPermissionsAdapter, friendPermissionsAdapter,
- extendedPermissionAdapter;
-
- protected Vector reqPermVector;
-
- String[] user_permissions = { "user_about_me", "user_activities", "user_birthday",
- "user_checkins", "user_education_history", "user_events", "user_groups",
- "user_hometown", "user_interests", "user_likes", "user_location", "user_notes",
- "user_online_presence", "user_photos", "user_photo_video_tags", "user_relationships",
- "user_relationship_details", "user_religion_politics", "user_status", "user_videos",
- "user_website", "user_work_history" };
-
- String[] friend_permissions = { "friends_about_me", "friends_activities", "friends_birthday",
- "friends_checkins", "friends_education_history", "friends_events", "friends_groups",
- "friends_hometown", "friends_interests", "friends_likes", "friends_location",
- "friends_notes", "friends_online_presence", "friends_photos",
- "friends_photo_video_tags", "friends_relationships", "friends_relationship_details",
- "friends_religion_politics", "friends_status", "friends_videos", "friends_website",
- "friends_work_history" };
-
- String[] extended_permissions = { "ads_management", "create_event", "create_note", "email",
- "export_stream", "manage_friendlists", "manage_groups", "manage_pages",
- "offline_access", "publish_actions", "photo_upload", "publish_checkins",
- "publish_stream", "read_friendlists", "read_insights", "read_mailbox", "read_requests",
- "read_stream", "rsvp_event", "share_item", "status_update", "sms", "video_upload",
- "xmpp_login" };
-
- public PermissionsDialog(Activity activity) {
- super(activity);
- this.activity = activity;
- setTitle(activity.getString(R.string.permissions_request));
- reqPermVector = new Vector();
- }
-
- /*
- * Layout the permission dialog
- */
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- setContentView(R.layout.permissions_list);
- LayoutParams params = getWindow().getAttributes();
- params.width = LayoutParams.FILL_PARENT;
- params.height = LayoutParams.FILL_PARENT;
- getWindow().setAttributes((android.view.WindowManager.LayoutParams) params);
-
- mPermissionDetails = (TextView) findViewById(R.id.permission_detail);
- mPermissionDetails.setMovementMethod(LinkMovementMethod.getInstance());
-
- userPermissionsList = (ListView) findViewById(R.id.user_permissions_list);
- friendPermissionsList = (ListView) findViewById(R.id.friend_permissions_list);
- extendedPermissionsList = (ListView) findViewById(R.id.extended_permissions_list);
-
- userPermissionsAdapter = new PermissionsListAdapter(user_permissions);
- userPermissionsList.setAdapter(userPermissionsAdapter);
-
- friendPermissionsAdapter = new PermissionsListAdapter(friend_permissions);
- friendPermissionsList.setAdapter(friendPermissionsAdapter);
-
- extendedPermissionAdapter = new PermissionsListAdapter(extended_permissions);
- extendedPermissionsList.setAdapter(extendedPermissionAdapter);
-
- TabHost tabHost = (TabHost) findViewById(R.id.tabHost);
- tabHost.setup();
-
- TabSpec spec1 = tabHost.newTabSpec("Tab 1");
- spec1.setIndicator(activity.getString(R.string.user));
- spec1.setContent(R.id.user_permissions_list);
-
- TabSpec spec2 = tabHost.newTabSpec("Tab 2");
- spec2.setIndicator(activity.getString(R.string.friend));
- spec2.setContent(R.id.friend_permissions_list);
-
- TabSpec spec3 = tabHost.newTabSpec("Tab 3");
- spec3.setIndicator(activity.getString(R.string.extended));
- spec3.setContent(R.id.extended_permissions_list);
-
- tabHost.addTab(spec1);
- tabHost.addTab(spec2);
- tabHost.addTab(spec3);
- tabHost.setCurrentTab(0);
- tabHost.getTabWidget().getChildAt(0).getLayoutParams().height = TAB_HEIGHT;
- tabHost.getTabWidget().getChildAt(1).getLayoutParams().height = TAB_HEIGHT;
- tabHost.getTabWidget().getChildAt(2).getLayoutParams().height = TAB_HEIGHT;
-
- mGetPermissions = (Button) findViewById(R.id.get_permissions_button);
-
- mGetPermissions.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- /*
- * Source Tag: perms_tag Call authorize to get the new
- * permissions
- */
- if (reqPermVector.isEmpty() && Utility.mFacebook.isSessionValid()) {
- Toast.makeText(activity.getBaseContext(), "No Permissions selected.",
- Toast.LENGTH_SHORT).show();
- PermissionsDialog.this.dismiss();
- } else {
- String[] permissions = reqPermVector.toArray(new String[0]);
- Utility.mFacebook.authorize(activity, permissions, new LoginDialogListener());
- }
- }
- });
- }
-
- /*
- * Callback when user has authorized the app with the new permissions
- */
- private final class LoginDialogListener implements DialogListener {
- @Override
- public void onComplete(Bundle values) {
- // Inform the parent loginlistener so it can update the user's
- // profile pic and name on the home screen.
- SessionEvents.onLoginSuccess();
-
- Toast.makeText(activity.getBaseContext(), "New Permissions granted.",
- Toast.LENGTH_SHORT).show();
- PermissionsDialog.this.dismiss();
- }
-
- @Override
- public void onFacebookError(FacebookError error) {
- Toast.makeText(activity.getBaseContext(),
- "Facebook Error! No new permissions granted.", Toast.LENGTH_SHORT).show();
- PermissionsDialog.this.dismiss();
- }
-
- @Override
- public void onError(DialogError error) {
- Toast.makeText(activity.getBaseContext(), "Error! No new permissions granted.",
- Toast.LENGTH_SHORT).show();
- PermissionsDialog.this.dismiss();
- }
-
- @Override
- public void onCancel() {
- Toast.makeText(activity.getBaseContext(),
- "Action cancelled, No new permissions granted.", Toast.LENGTH_SHORT).show();
- PermissionsDialog.this.dismiss();
- }
- }
-
- /**
- * Definition of the list adapter
- */
- public class PermissionsListAdapter extends BaseAdapter {
- private LayoutInflater mInflater;
- String[] permissions;
- boolean[] isChecked;
-
- public PermissionsListAdapter(String[] permissions) {
- this.permissions = permissions;
- this.isChecked = new boolean[permissions.length];
- mInflater = LayoutInflater.from(activity.getBaseContext());
- }
-
- @Override
- public int getCount() {
- return permissions.length;
- }
-
- @Override
- public Object getItem(int position) {
- return null;
- }
-
- @Override
- public long getItemId(int position) {
- return 0;
- }
-
- @Override
- public View getView(final int position, View convertView, ViewGroup parent) {
-
- View hView = convertView;
- CheckBox checkbox;
-
- if (hView == null) {
- hView = mInflater.inflate(R.layout.permission_item, null);
- checkbox = (CheckBox) hView.findViewById(R.id.permission_checkbox);
- hView.setTag(checkbox);
- } else {
- checkbox = (CheckBox) hView.getTag();
- }
- checkbox.setText(this.permissions[position]);
- checkbox.setId(position);
- if (Utility.currentPermissions.containsKey(this.permissions[position])
- && Utility.currentPermissions.get(this.permissions[position]).equals("1")) {
- checkbox.setTextColor(Color.GREEN);
- checkbox.setChecked(true);
- checkbox.setEnabled(false);
- checkbox.setOnCheckedChangeListener(null);
- } else {
- checkbox.setTextColor(Color.WHITE);
- checkbox.setChecked(this.isChecked[position]);
- checkbox.setEnabled(true);
- checkbox.setOnCheckedChangeListener(new OnCheckedChangeListener() {
- @Override
- public void onCheckedChanged(CompoundButton button, boolean checked) {
- isChecked[button.getId()] = checked;
- if (checked) {
- reqPermVector.add(button.getText().toString());
- } else if (reqPermVector.contains(button.getText())) {
- reqPermVector.remove(button.getText());
- }
- }
- });
- }
- return hView;
- }
- }
-}
diff --git a/facebook/samples/Hackbook/src/com/facebook/android/Places.java b/facebook/samples/Hackbook/src/com/facebook/android/Places.java
deleted file mode 100644
index 43dbca4bd..000000000
--- a/facebook/samples/Hackbook/src/com/facebook/android/Places.java
+++ /dev/null
@@ -1,374 +0,0 @@
-/**
- * Copyright 2012 Facebook
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.facebook.android;
-
-import android.app.Activity;
-import android.app.AlertDialog;
-import android.app.ProgressDialog;
-import android.content.Context;
-import android.content.DialogInterface;
-import android.content.Intent;
-import android.location.Criteria;
-import android.location.Location;
-import android.location.LocationListener;
-import android.location.LocationManager;
-import android.os.Bundle;
-import android.os.Handler;
-import android.os.Looper;
-import android.util.Log;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.*;
-import android.widget.AdapterView.OnItemClickListener;
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-@SuppressWarnings("deprecation")
-public class Places extends Activity implements OnItemClickListener {
- private Handler mHandler;
- private JSONObject location;
-
- protected ListView placesList;
- protected LocationManager lm;
- protected MyLocationListener locationListener;
-
- protected static JSONArray jsonArray;
- final static double TIMES_SQUARE_LAT = 40.756;
- final static double TIMES_SQUARE_LON = -73.987;
-
- protected ProgressDialog dialog;
-
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- mHandler = new Handler();
- location = new JSONObject();
-
- setContentView(R.layout.places_list);
-
- Bundle extras = getIntent().getExtras();
- String default_or_new = extras.getString("LOCATION");
- if (default_or_new.equals("times_square")) {
- try {
- location.put("latitude", new Double(TIMES_SQUARE_LAT));
- location.put("longitude", new Double(TIMES_SQUARE_LON));
- } catch (JSONException e) {
- }
- fetchPlaces();
- } else {
- getLocation();
- }
- }
-
- public void getLocation() {
- /*
- * launch a new Thread to get new location
- */
- new Thread() {
- @Override
- public void run() {
- Looper.prepare();
- dialog = ProgressDialog.show(Places.this, "",
- getString(R.string.fetching_location), false, true,
- new DialogInterface.OnCancelListener() {
- @Override
- public void onCancel(DialogInterface dialog) {
- showToast("No location fetched.");
- }
- });
-
- if (lm == null) {
- lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
- }
-
- if (locationListener == null) {
- locationListener = new MyLocationListener();
- }
-
- Criteria criteria = new Criteria();
- criteria.setAccuracy(Criteria.ACCURACY_COARSE);
- String provider = lm.getBestProvider(criteria, true);
- if (provider != null && lm.isProviderEnabled(provider)) {
- lm.requestLocationUpdates(provider, 1, 0, locationListener,
- Looper.getMainLooper());
- } else {
- /*
- * GPS not enabled, prompt user to enable GPS in the
- * Location menu
- */
- new AlertDialog.Builder(Places.this)
- .setTitle(R.string.enable_gps_title)
- .setMessage(getString(R.string.enable_gps))
- .setPositiveButton(R.string.gps_settings,
- new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- startActivityForResult(
- new Intent(
- android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS),
- 0);
- }
- })
- .setNegativeButton(R.string.cancel,
- new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- dialog.dismiss();
- Places.this.finish();
- }
- }).show();
- }
- Looper.loop();
- }
- }.start();
- }
-
- @Override
- protected void onActivityResult(int requestCode, int resultCode, Intent data) {
- /*
- * User returning from the Location settings menu. try to fetch location
- * again.
- */
- dialog.dismiss();
- getLocation();
- }
-
- /*
- * Fetch nearby places by providing the search type as 'place' within 1000
- * mtrs of the provided lat & lon
- */
- private void fetchPlaces() {
- if (!isFinishing()) {
- dialog = ProgressDialog.show(Places.this, "", getString(R.string.nearby_places), true,
- true, new DialogInterface.OnCancelListener() {
- @Override
- public void onCancel(DialogInterface dialog) {
- showToast("No places fetched.");
- }
- });
- }
- /*
- * Source tag: fetch_places_tag
- */
- Bundle params = new Bundle();
- params.putString("type", "place");
- try {
- params.putString("center",
- location.getString("latitude") + "," + location.getString("longitude"));
- } catch (JSONException e) {
- showToast("No places fetched.");
- return;
- }
- params.putString("distance", "1000");
- Utility.mAsyncRunner.request("search", params, new placesRequestListener());
- }
-
- /*
- * Callback after places are fetched.
- */
- public class placesRequestListener extends BaseRequestListener {
-
- @Override
- public void onComplete(final String response, final Object state) {
- Log.d("Facebook-FbAPIs", "Got response: " + response);
- dialog.dismiss();
-
- try {
- jsonArray = new JSONObject(response).getJSONArray("data");
- if (jsonArray == null) {
- showToast("Error: nearby places could not be fetched");
- return;
- }
- } catch (JSONException e) {
- showToast("Error: " + e.getMessage());
- return;
- }
- mHandler.post(new Runnable() {
- @Override
- public void run() {
- placesList = (ListView) findViewById(R.id.places_list);
- placesList.setOnItemClickListener(Places.this);
- placesList.setAdapter(new PlacesListAdapter(Places.this));
- }
- });
-
- }
-
- public void onFacebookError(FacebookError error) {
- dialog.dismiss();
- showToast("Fetch Places Error: " + error.getMessage());
- }
- }
-
- @Override
- public void onItemClick(AdapterView> arg0, View v, int position, long arg3) {
- if (!Utility.mFacebook.isSessionValid()) {
- Util.showAlert(this, "Warning", "You must first log in.");
- } else {
- try {
- final String message = "Check-in from the " + getString(R.string.app_name);
- final String name = jsonArray.getJSONObject(position).getString("name");
- final String placeID = jsonArray.getJSONObject(position).getString("id");
- new AlertDialog.Builder(this).setTitle(R.string.check_in_title)
- .setMessage(String.format(getString(R.string.check_in_at), name))
- .setPositiveButton(R.string.checkin, new DialogInterface.OnClickListener() {
- /*
- * Source tag: check_in_tag Check-in user at the
- * selected location posting to the me/checkins
- * endpoint. More info here:
- * https://developers.facebook
- * .com/docs/reference/api/user/ - checkins
- */
- @Override
- public void onClick(DialogInterface dialog, int which) {
- Bundle params = new Bundle();
- params.putString("place", placeID);
- params.putString("message", message);
- params.putString("coordinates", location.toString());
- Utility.mAsyncRunner.request("me/checkins", params, "POST",
- new placesCheckInListener(), null);
- }
- }).setNegativeButton(R.string.cancel, null).show();
- } catch (JSONException e) {
- showToast("Error: " + e.getMessage());
- }
- }
- }
-
- public class placesCheckInListener extends BaseRequestListener {
- @Override
- public void onComplete(final String response, final Object state) {
- showToast("API Response: " + response);
- }
-
- public void onFacebookError(FacebookError error) {
- dialog.dismiss();
- showToast("Check-in Error: " + error.getMessage());
- }
- }
-
- public void showToast(final String msg) {
- mHandler.post(new Runnable() {
- @Override
- public void run() {
- Toast toast = Toast.makeText(Places.this, msg, Toast.LENGTH_LONG);
- toast.show();
- }
- });
- }
-
- /**
- * Definition of the list adapter
- */
- public class PlacesListAdapter extends BaseAdapter {
- private LayoutInflater mInflater;
- Places placesList;
-
- public PlacesListAdapter(Context context) {
- mInflater = LayoutInflater.from(context);
- }
-
- @Override
- public int getCount() {
- return jsonArray.length();
- }
-
- @Override
- public Object getItem(int position) {
- return null;
- }
-
- @Override
- public long getItemId(int position) {
- return 0;
- }
-
- @Override
- public View getView(int position, View convertView, ViewGroup parent) {
- JSONObject jsonObject = null;
- try {
- jsonObject = jsonArray.getJSONObject(position);
- } catch (JSONException e1) {
- e1.printStackTrace();
- }
- View hView = convertView;
- if (convertView == null) {
- hView = mInflater.inflate(R.layout.place_item, null);
- ViewHolder holder = new ViewHolder();
- holder.name = (TextView) hView.findViewById(R.id.place_name);
- holder.location = (TextView) hView.findViewById(R.id.place_location);
- hView.setTag(holder);
- }
-
- ViewHolder holder = (ViewHolder) hView.getTag();
- try {
- holder.name.setText(jsonObject.getString("name"));
- } catch (JSONException e) {
- holder.name.setText("");
- }
- try {
- String location = jsonObject.getJSONObject("location").getString("street") + ", "
- + jsonObject.getJSONObject("location").getString("city") + ", "
- + jsonObject.getJSONObject("location").getString("state");
- holder.location.setText(location);
- } catch (JSONException e) {
- holder.location.setText("");
- }
- return hView;
- }
-
- }
-
- class ViewHolder {
- TextView name;
- TextView location;
- }
-
- class MyLocationListener implements LocationListener {
-
- @Override
- public void onLocationChanged(Location loc) {
- dialog.dismiss();
- if (loc != null) {
- try {
- location.put("latitude", new Double(loc.getLatitude()));
- location.put("longitude", new Double(loc.getLongitude()));
- } catch (JSONException e) {
- }
- showToast("Location acquired: " + String.valueOf(loc.getLatitude()) + " "
- + String.valueOf(loc.getLongitude()));
- lm.removeUpdates(this);
- fetchPlaces();
- }
- }
-
- @Override
- public void onProviderDisabled(String provider) {
- }
-
- @Override
- public void onProviderEnabled(String provider) {
- }
-
- @Override
- public void onStatusChanged(String provider, int status, Bundle extras) {
- }
- }
-}
diff --git a/facebook/samples/Hackbook/src/com/facebook/android/SessionEvents.java b/facebook/samples/Hackbook/src/com/facebook/android/SessionEvents.java
deleted file mode 100644
index 55295f174..000000000
--- a/facebook/samples/Hackbook/src/com/facebook/android/SessionEvents.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Copyright 2010-present Facebook
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.facebook.android;
-
-import java.util.LinkedList;
-
-public class SessionEvents {
-
- private static LinkedList mAuthListeners = new LinkedList();
- private static LinkedList mLogoutListeners = new LinkedList();
-
- /**
- * Associate the given listener with this Facebook object. The listener's
- * callback interface will be invoked when authentication events occur.
- *
- * @param listener
- * The callback object for notifying the application when auth
- * events happen.
- */
- public static void addAuthListener(AuthListener listener) {
- mAuthListeners.add(listener);
- }
-
- /**
- * Remove the given listener from the list of those that will be notified
- * when authentication events occur.
- *
- * @param listener
- * The callback object for notifying the application when auth
- * events happen.
- */
- public static void removeAuthListener(AuthListener listener) {
- mAuthListeners.remove(listener);
- }
-
- /**
- * Associate the given listener with this Facebook object. The listener's
- * callback interface will be invoked when logout occurs.
- *
- * @param listener
- * The callback object for notifying the application when log out
- * starts and finishes.
- */
- public static void addLogoutListener(LogoutListener listener) {
- mLogoutListeners.add(listener);
- }
-
- /**
- * Remove the given listener from the list of those that will be notified
- * when logout occurs.
- *
- * @param listener
- * The callback object for notifying the application when log out
- * starts and finishes.
- */
- public static void removeLogoutListener(LogoutListener listener) {
- mLogoutListeners.remove(listener);
- }
-
- public static void onLoginSuccess() {
- for (AuthListener listener : mAuthListeners) {
- listener.onAuthSucceed();
- }
- }
-
- public static void onLoginError(String error) {
- for (AuthListener listener : mAuthListeners) {
- listener.onAuthFail(error);
- }
- }
-
- public static void onLogoutBegin() {
- for (LogoutListener l : mLogoutListeners) {
- l.onLogoutBegin();
- }
- }
-
- public static void onLogoutFinish() {
- for (LogoutListener l : mLogoutListeners) {
- l.onLogoutFinish();
- }
- }
-
- /**
- * Callback interface for authorization events.
- */
- public static interface AuthListener {
-
- /**
- * Called when a auth flow completes successfully and a valid OAuth
- * Token was received. Executed by the thread that initiated the
- * authentication. API requests can now be made.
- */
- public void onAuthSucceed();
-
- /**
- * Called when a login completes unsuccessfully with an error.
- *
- * Executed by the thread that initiated the authentication.
- */
- public void onAuthFail(String error);
- }
-
- /**
- * Callback interface for logout events.
- */
- public static interface LogoutListener {
- /**
- * Called when logout begins, before session is invalidated. Last chance
- * to make an API call. Executed by the thread that initiated the
- * logout.
- */
- public void onLogoutBegin();
-
- /**
- * Called when the session information has been cleared. UI should be
- * updated to reflect logged-out state.
- *
- * Executed by the thread that initiated the logout.
- */
- public void onLogoutFinish();
- }
-
-}
diff --git a/facebook/samples/Hackbook/src/com/facebook/android/SessionStore.java b/facebook/samples/Hackbook/src/com/facebook/android/SessionStore.java
deleted file mode 100644
index 8e4dcda58..000000000
--- a/facebook/samples/Hackbook/src/com/facebook/android/SessionStore.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/**
- * Copyright 2010-present Facebook
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.facebook.android;
-
-import android.content.Context;
-import android.content.SharedPreferences;
-import android.content.SharedPreferences.Editor;
-
-@SuppressWarnings("deprecation")
-public class SessionStore {
-
- private static final String TOKEN = "access_token";
- private static final String EXPIRES = "expires_in";
- private static final String LAST_UPDATE = "last_update";
- private static final String KEY = "facebook-session";
-
- /*
- * Save the access token and expiry date so you don't have to fetch it each
- * time
- */
- public static boolean save(Facebook session, Context context) {
- Editor editor = context.getSharedPreferences(KEY, Context.MODE_PRIVATE).edit();
- editor.putString(TOKEN, session.getAccessToken());
- editor.putLong(EXPIRES, session.getAccessExpires());
- editor.putLong(LAST_UPDATE, session.getLastAccessUpdate());
- return editor.commit();
- }
-
- /*
- * Restore the access token and the expiry date from the shared preferences.
- */
- public static boolean restore(Facebook session, Context context) {
- SharedPreferences savedSession = context.getSharedPreferences(KEY, Context.MODE_PRIVATE);
- session.setTokenFromCache(
- savedSession.getString(TOKEN, null),
- savedSession.getLong(EXPIRES, 0),
- savedSession.getLong(LAST_UPDATE, 0));
- return session.isSessionValid();
- }
-
- public static void clear(Context context) {
- Editor editor = context.getSharedPreferences(KEY, Context.MODE_PRIVATE).edit();
- editor.clear();
- editor.commit();
- }
-
-}
diff --git a/facebook/samples/Hackbook/src/com/facebook/android/SplashActivity.java b/facebook/samples/Hackbook/src/com/facebook/android/SplashActivity.java
deleted file mode 100644
index 7255c0fce..000000000
--- a/facebook/samples/Hackbook/src/com/facebook/android/SplashActivity.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * Copyright 2012 Facebook
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.facebook.android;
-
-import android.app.Activity;
-import android.content.Intent;
-import android.os.Bundle;
-
-import java.util.Timer;
-import java.util.TimerTask;
-
-public class SplashActivity extends Activity {
- private long splashDelay = 1500;
-
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.splash);
- TimerTask task = new TimerTask() {
- @Override
- public void run() {
- finish();
- Intent hackbookIntent = new Intent().setClass(SplashActivity.this, Hackbook.class);
- startActivity(hackbookIntent);
- }
- };
-
- Timer timer = new Timer();
- timer.schedule(task, splashDelay);
- }
-}
diff --git a/facebook/samples/Hackbook/src/com/facebook/android/TokenRefreshDialog.java b/facebook/samples/Hackbook/src/com/facebook/android/TokenRefreshDialog.java
deleted file mode 100644
index 5a46dec71..000000000
--- a/facebook/samples/Hackbook/src/com/facebook/android/TokenRefreshDialog.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/**
- * Copyright 2012 Facebook
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.facebook.android;
-
-import android.app.Activity;
-import android.app.Dialog;
-import android.os.Bundle;
-import android.text.method.LinkMovementMethod;
-import android.view.View;
-import android.widget.Button;
-import android.widget.EditText;
-import android.widget.TextView;
-
-import java.text.DateFormat;
-import java.util.Date;
-
-@SuppressWarnings("deprecation")
-public class TokenRefreshDialog extends Dialog {
-
- private EditText tokenEdit, tokenExpiresEdit;
- private TextView mUsefulTip;
- private Button mRefreshButton;
- private Activity activity;
-
- public TokenRefreshDialog(Activity activity) {
- super(activity);
- this.activity = activity;
- setTitle(R.string.refresh_token_title);
- }
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- setContentView(R.layout.token_refresh);
-
- tokenEdit = (EditText) findViewById(R.id.tokenEdit);
- tokenEdit.setText(Utility.mFacebook.getAccessToken());
-
- tokenExpiresEdit = (EditText) findViewById(R.id.tokenExpiresEdit);
- setExpiresAt(Utility.mFacebook.getAccessExpires());
-
- mUsefulTip = (TextView) findViewById(R.id.usefulTip);
- mUsefulTip.setMovementMethod(LinkMovementMethod.getInstance());
- mRefreshButton = (Button) findViewById(R.id.refresh_button);
-
- mRefreshButton.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- changeButtonState(false);
- RefreshTokenListener listener = new RefreshTokenListener();
- if (!Utility.mFacebook.extendAccessToken(activity, listener)) {
- listener.onError(new Error(
- activity.getString(R.string.refresh_token_binding_error)));
- }
- }
- });
- }
-
- private class RefreshTokenListener implements Facebook.ServiceListener {
-
- @Override
- public void onFacebookError(FacebookError e) {
- changeButtonState(true);
- String title = String.format(activity.getString(R.string.facebook_error) + "%d",
- e.getErrorCode());
- Util.showAlert(activity, title, e.getMessage());
- }
-
- @Override
- public void onError(Error e) {
- changeButtonState(true);
- Util.showAlert(activity, activity.getString(R.string.error), e.getMessage());
- }
-
- @Override
- public void onComplete(Bundle values) {
- changeButtonState(true);
-
- // The access_token and expires_at values are automatically updated,
- // so they can be obtained by using:
- // - Facebook.getAccessToken()
- // - Facebook.getAccessExpires()
- // methods, but we can also get them from the 'values' bundle.
- tokenEdit.setText(values.getString(Facebook.TOKEN));
- setExpiresAt(values.getLong(Facebook.EXPIRES));
- }
- }
-
- private void changeButtonState(boolean enabled) {
- mRefreshButton.setEnabled(enabled);
- mRefreshButton.setText(enabled ? R.string.refresh_button : R.string.refresh_button_pending);
- }
-
- private void setExpiresAt(long time) {
- DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT);
- tokenExpiresEdit.setText(dateFormat.format(new Date(time)));
- }
-}
diff --git a/facebook/samples/Hackbook/src/com/facebook/android/UpdateStatusResultDialog.java b/facebook/samples/Hackbook/src/com/facebook/android/UpdateStatusResultDialog.java
deleted file mode 100644
index 1bb9e6137..000000000
--- a/facebook/samples/Hackbook/src/com/facebook/android/UpdateStatusResultDialog.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/**
- * Copyright 2012 Facebook
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.facebook.android;
-
-import android.app.Activity;
-import android.app.Dialog;
-import android.os.Bundle;
-import android.os.Handler;
-import android.text.method.LinkMovementMethod;
-import android.view.View;
-import android.view.ViewGroup.LayoutParams;
-import android.widget.Button;
-import android.widget.TextView;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-@SuppressWarnings("deprecation")
-public class UpdateStatusResultDialog extends Dialog {
-
- private Bundle values;
- private TextView mOutput, mUsefulTip;
- private Button mViewPostButton, mDeletePostButton;
- private Activity activity;
- private Handler mHandler;
-
- public UpdateStatusResultDialog(Activity activity, String title, Bundle values) {
- super(activity);
- this.activity = activity;
- this.values = values;
- setTitle(title);
- }
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- mHandler = new Handler();
-
- setContentView(R.layout.update_post_response);
- LayoutParams params = getWindow().getAttributes();
- params.width = LayoutParams.FILL_PARENT;
- params.height = LayoutParams.FILL_PARENT;
- getWindow().setAttributes((android.view.WindowManager.LayoutParams) params);
-
- mOutput = (TextView) findViewById(R.id.apiOutput);
- mOutput.setText(values.toString());
-
- mUsefulTip = (TextView) findViewById(R.id.usefulTip);
- mUsefulTip.setMovementMethod(LinkMovementMethod.getInstance());
- mViewPostButton = (Button) findViewById(R.id.view_post_button);
- mDeletePostButton = (Button) findViewById(R.id.delete_post_button);
- final String postId = values.getString("post_id");
-
- mViewPostButton.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- /*
- * Source tag: view_post_tag
- */
- Utility.mAsyncRunner.request(postId, new WallPostRequestListener());
- }
- });
- mDeletePostButton.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- /*
- * Source tag: delete_post_tag
- */
- Utility.mAsyncRunner.request(postId, new Bundle(), "DELETE",
- new WallPostDeleteListener(), null);
- }
- });
- }
-
- public class WallPostRequestListener extends BaseRequestListener {
-
- @Override
- public void onComplete(final String response, final Object state) {
- try {
- JSONObject json = new JSONObject(response);
- setText(json.toString(2));
- } catch (JSONException e) {
- setText(activity.getString(R.string.exception) + e.getMessage());
- }
- }
-
- public void onFacebookError(FacebookError error) {
- setText(activity.getString(R.string.facebook_error) + error.getMessage());
- }
- }
-
- public class WallPostDeleteListener extends BaseRequestListener {
-
- @Override
- public void onComplete(final String response, final Object state) {
- if (response.equals("true")) {
- String message = "Wall Post deleted" + "\n";
- message += "Api Response: " + response;
- setText(message);
- } else {
- setText("wall post could not be deleted");
- }
- }
-
- public void onFacebookError(FacebookError error) {
- setText(activity.getString(R.string.facebook_error) + error.getMessage());
- }
- }
-
- public void setText(final String txt) {
- mHandler.post(new Runnable() {
- @Override
- public void run() {
- mOutput.setText(txt);
- }
- });
- }
-}
diff --git a/facebook/samples/Hackbook/src/com/facebook/android/UploadPhotoResultDialog.java b/facebook/samples/Hackbook/src/com/facebook/android/UploadPhotoResultDialog.java
deleted file mode 100644
index 7ec3c5e21..000000000
--- a/facebook/samples/Hackbook/src/com/facebook/android/UploadPhotoResultDialog.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/**
- * Copyright 2012 Facebook
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.facebook.android;
-
-import android.app.Activity;
-import android.app.Dialog;
-import android.app.ProgressDialog;
-import android.graphics.Bitmap;
-import android.os.AsyncTask;
-import android.os.Bundle;
-import android.os.Handler;
-import android.text.TextUtils;
-import android.text.util.Linkify;
-import android.view.View;
-import android.view.ViewGroup.LayoutParams;
-import android.widget.Button;
-import android.widget.ImageView;
-import android.widget.TextView;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-@SuppressWarnings("deprecation")
-public class UploadPhotoResultDialog extends Dialog {
-
- private String response, photo_id;
- private TextView mOutput, mUsefulTip;
- private Button mViewPhotoButton, mTagPhotoButton;
- private ImageView mUploadedPhoto;
- private Activity activity;
- private ProgressDialog dialog;
- private boolean hidePhoto = false;
- private Handler mHandler;
-
- public UploadPhotoResultDialog(Activity activity, String title, String response) {
- super(activity);
- this.activity = activity;
- this.response = response;
- setTitle(title);
- }
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- mHandler = new Handler();
-
- setContentView(R.layout.upload_photo_response);
- LayoutParams params = getWindow().getAttributes();
- params.width = LayoutParams.FILL_PARENT;
- params.height = LayoutParams.FILL_PARENT;
- getWindow().setAttributes((android.view.WindowManager.LayoutParams) params);
-
- mOutput = (TextView) findViewById(R.id.apiOutput);
- mUsefulTip = (TextView) findViewById(R.id.usefulTip);
- mViewPhotoButton = (Button) findViewById(R.id.view_photo_button);
- mTagPhotoButton = (Button) findViewById(R.id.tag_photo_button);
- mUploadedPhoto = (ImageView) findViewById(R.id.uploadedPhoto);
-
- JSONObject json;
- try {
- json = Util.parseJson(response);
- final String photo_id = json.getString("id");
- this.photo_id = photo_id;
-
- mOutput.setText(json.toString(2));
- mUsefulTip.setText(activity.getString(R.string.photo_tip));
- Linkify.addLinks(mUsefulTip, Linkify.WEB_URLS);
-
- mViewPhotoButton.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- if (hidePhoto) {
- mViewPhotoButton.setText(R.string.view_photo);
- hidePhoto = false;
- mUploadedPhoto.setImageBitmap(null);
- } else {
- hidePhoto = true;
- mViewPhotoButton.setText(R.string.hide_photo);
- /*
- * Source tag: view_photo_tag
- */
- Bundle params = new Bundle();
- params.putString("fields", "picture");
- dialog = ProgressDialog.show(activity, "",
- activity.getString(R.string.please_wait), true, true);
- dialog.show();
- Utility.mAsyncRunner.request(photo_id, params,
- new ViewPhotoRequestListener());
- }
- }
- });
- mTagPhotoButton.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- /*
- * Source tag: tag_photo_tag
- */
- setTag();
- }
- });
- } catch (JSONException e) {
- setText(activity.getString(R.string.exception) + e.getMessage());
- } catch (FacebookError e) {
- setText(activity.getString(R.string.facebook_error) + e.getMessage());
- }
- }
-
- public void setTag() {
- String relativePath = photo_id + "/tags/" + Utility.userUID;
- Bundle params = new Bundle();
- params.putString("x", "5");
- params.putString("y", "5");
- Utility.mAsyncRunner.request(relativePath, params, "POST", new TagPhotoRequestListener(),
- null);
- }
-
- public class ViewPhotoRequestListener extends BaseRequestListener {
-
- @Override
- public void onComplete(final String response, final Object state) {
- try {
- JSONObject json = Util.parseJson(response);
- final String pictureURL = json.getString("picture");
- if (TextUtils.isEmpty(pictureURL)) {
- setText("Error getting \'picture\' field of the photo");
- } else {
- mHandler.post(new Runnable() {
- @Override
- public void run() {
- new FetchImage().execute(pictureURL);
- }
- });
- }
- } catch (JSONException e) {
- dialog.dismiss();
- setText(activity.getString(R.string.exception) + e.getMessage());
- } catch (FacebookError e) {
- dialog.dismiss();
- setText(activity.getString(R.string.facebook_error) + e.getMessage());
- }
- }
-
- public void onFacebookError(FacebookError error) {
- dialog.dismiss();
- setText(activity.getString(R.string.facebook_error) + error.getMessage());
- }
- }
-
- public class TagPhotoRequestListener extends BaseRequestListener {
-
- @Override
- public void onComplete(final String response, final Object state) {
- if (response.equals("true")) {
- String message = "User tagged in photo at (5, 5)" + "\n";
- message += "Api Response: " + response;
- setText(message);
- } else {
- setText("User could not be tagged.");
- }
- }
-
- public void onFacebookError(FacebookError error) {
- setText(activity.getString(R.string.facebook_error) + error.getMessage());
- }
- }
-
- public void setText(final String txt) {
- mHandler.post(new Runnable() {
- @Override
- public void run() {
- mOutput.setText(txt);
- }
- });
- }
-
- private class FetchImage extends AsyncTask {
- @Override
- protected Bitmap doInBackground(String... urls) {
- return Utility.getBitmap(urls[0]);
- }
-
- @Override
- protected void onPostExecute(Bitmap result) {
- dialog.dismiss();
- mUploadedPhoto.setImageBitmap(result);
- }
- }
-}
diff --git a/facebook/samples/Hackbook/src/com/facebook/android/Utility.java b/facebook/samples/Hackbook/src/com/facebook/android/Utility.java
deleted file mode 100644
index 251a77419..000000000
--- a/facebook/samples/Hackbook/src/com/facebook/android/Utility.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/**
- * Copyright 2012 Facebook
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.facebook.android;
-
-import android.app.Application;
-import android.content.Context;
-import android.database.Cursor;
-import android.graphics.Bitmap;
-import android.graphics.BitmapFactory;
-import android.graphics.Matrix;
-import android.net.Uri;
-import android.net.http.AndroidHttpClient;
-import android.provider.MediaStore;
-import org.json.JSONObject;
-
-import java.io.*;
-import java.net.URL;
-import java.net.URLConnection;
-import java.util.Hashtable;
-
-public class Utility extends Application {
-
- public static Facebook mFacebook;
- @SuppressWarnings("deprecation")
- public static AsyncFacebookRunner mAsyncRunner;
- public static JSONObject mFriendsList;
- public static String userUID = null;
- public static String objectID = null;
- public static FriendsGetProfilePics model;
- public static AndroidHttpClient httpclient = null;
- public static Hashtable currentPermissions = new Hashtable();
-
- private static int MAX_IMAGE_DIMENSION = 720;
- public static final String HACK_ICON_URL = "http://www.facebookmobileweb.com/hackbook/img/facebook_icon_large.png";
-
- public static Bitmap getBitmap(String url) {
- Bitmap bm = null;
- try {
- URL aURL = new URL(url);
- URLConnection conn = aURL.openConnection();
- conn.connect();
- InputStream is = conn.getInputStream();
- BufferedInputStream bis = new BufferedInputStream(is);
- bm = BitmapFactory.decodeStream(new FlushedInputStream(is));
- bis.close();
- is.close();
- } catch (Exception e) {
- e.printStackTrace();
- } finally {
- if (httpclient != null) {
- httpclient.close();
- }
- }
- return bm;
- }
-
- static class FlushedInputStream extends FilterInputStream {
- public FlushedInputStream(InputStream inputStream) {
- super(inputStream);
- }
-
- @Override
- public long skip(long n) throws IOException {
- long totalBytesSkipped = 0L;
- while (totalBytesSkipped < n) {
- long bytesSkipped = in.skip(n - totalBytesSkipped);
- if (bytesSkipped == 0L) {
- int b = read();
- if (b < 0) {
- break; // we reached EOF
- } else {
- bytesSkipped = 1; // we read one byte
- }
- }
- totalBytesSkipped += bytesSkipped;
- }
- return totalBytesSkipped;
- }
- }
-
- public static byte[] scaleImage(Context context, Uri photoUri) throws IOException {
- InputStream is = context.getContentResolver().openInputStream(photoUri);
- BitmapFactory.Options dbo = new BitmapFactory.Options();
- dbo.inJustDecodeBounds = true;
- BitmapFactory.decodeStream(is, null, dbo);
- is.close();
-
- int rotatedWidth, rotatedHeight;
- int orientation = getOrientation(context, photoUri);
-
- if (orientation == 90 || orientation == 270) {
- rotatedWidth = dbo.outHeight;
- rotatedHeight = dbo.outWidth;
- } else {
- rotatedWidth = dbo.outWidth;
- rotatedHeight = dbo.outHeight;
- }
-
- Bitmap srcBitmap;
- is = context.getContentResolver().openInputStream(photoUri);
- if (rotatedWidth > MAX_IMAGE_DIMENSION || rotatedHeight > MAX_IMAGE_DIMENSION) {
- float widthRatio = ((float) rotatedWidth) / ((float) MAX_IMAGE_DIMENSION);
- float heightRatio = ((float) rotatedHeight) / ((float) MAX_IMAGE_DIMENSION);
- float maxRatio = Math.max(widthRatio, heightRatio);
-
- // Create the bitmap from file
- BitmapFactory.Options options = new BitmapFactory.Options();
- options.inSampleSize = (int) maxRatio;
- srcBitmap = BitmapFactory.decodeStream(is, null, options);
- } else {
- srcBitmap = BitmapFactory.decodeStream(is);
- }
- is.close();
-
- /*
- * if the orientation is not 0 (or -1, which means we don't know), we
- * have to do a rotation.
- */
- if (orientation > 0) {
- Matrix matrix = new Matrix();
- matrix.postRotate(orientation);
-
- srcBitmap = Bitmap.createBitmap(srcBitmap, 0, 0, srcBitmap.getWidth(),
- srcBitmap.getHeight(), matrix, true);
- }
-
- String type = context.getContentResolver().getType(photoUri);
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- if (type.equals("image/png")) {
- srcBitmap.compress(Bitmap.CompressFormat.PNG, 100, baos);
- } else if (type.equals("image/jpg") || type.equals("image/jpeg")) {
- srcBitmap.compress(Bitmap.CompressFormat.JPEG, 100, baos);
- }
- byte[] bMapArray = baos.toByteArray();
- baos.close();
- return bMapArray;
- }
-
- public static int getOrientation(Context context, Uri photoUri) {
- /* it's on the external media. */
- Cursor cursor = context.getContentResolver().query(photoUri,
- new String[] { MediaStore.Images.ImageColumns.ORIENTATION }, null, null, null);
-
- if (cursor.getCount() != 1) {
- return -1;
- }
-
- cursor.moveToFirst();
- int orientation = cursor.getInt(0);
- cursor.close();
-
- return orientation;
- }
-}
diff --git a/facebook/samples/HelloFacebookSample/.classpath b/facebook/samples/HelloFacebookSample/.classpath
deleted file mode 100644
index 655a4a827..000000000
--- a/facebook/samples/HelloFacebookSample/.classpath
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/HelloFacebookSample/.project b/facebook/samples/HelloFacebookSample/.project
deleted file mode 100644
index cb52d544b..000000000
--- a/facebook/samples/HelloFacebookSample/.project
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
- HelloFacebookSample
-
-
-
-
-
- com.android.ide.eclipse.adt.ResourceManagerBuilder
-
-
-
-
- com.android.ide.eclipse.adt.PreCompilerBuilder
-
-
-
-
- org.eclipse.jdt.core.javabuilder
-
-
-
-
- com.android.ide.eclipse.adt.ApkBuilder
-
-
-
-
-
- com.android.ide.eclipse.adt.AndroidNature
- org.eclipse.jdt.core.javanature
-
-
diff --git a/facebook/samples/HelloFacebookSample/AndroidManifest.xml b/facebook/samples/HelloFacebookSample/AndroidManifest.xml
deleted file mode 100644
index 246d0de24..000000000
--- a/facebook/samples/HelloFacebookSample/AndroidManifest.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/HelloFacebookSample/ant.properties b/facebook/samples/HelloFacebookSample/ant.properties
deleted file mode 100644
index 939105d52..000000000
--- a/facebook/samples/HelloFacebookSample/ant.properties
+++ /dev/null
@@ -1,18 +0,0 @@
-# This file is used to override default values used by the Ant build system.
-#
-# This file must be checked into Version Control Systems, as it is
-# integral to the build system of your project.
-
-# This file is only used by the Ant script.
-
-# You can use this to override default values such as
-# 'source.dir' for the location of your java source folder and
-# 'out.dir' for the location of your output folder.
-
-# You can also use it define how the release builds are signed by declaring
-# the following properties:
-# 'key.store' for the location of your keystore and
-# 'key.alias' for the name of the key to use.
-# The password will be asked during the build when you use the 'release' target.
-
-java.compilerargs=-Xlint -Werror
diff --git a/facebook/samples/HelloFacebookSample/build.xml b/facebook/samples/HelloFacebookSample/build.xml
deleted file mode 100644
index 3c65e4a79..000000000
--- a/facebook/samples/HelloFacebookSample/build.xml
+++ /dev/null
@@ -1,92 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/HelloFacebookSample/proguard-project.txt b/facebook/samples/HelloFacebookSample/proguard-project.txt
deleted file mode 100644
index f2fe1559a..000000000
--- a/facebook/samples/HelloFacebookSample/proguard-project.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-# To enable ProGuard in your project, edit project.properties
-# to define the proguard.config property as described in that file.
-#
-# Add project specific ProGuard rules here.
-# By default, the flags in this file are appended to flags specified
-# in ${sdk.dir}/tools/proguard/proguard-android.txt
-# You can edit the include path and order by changing the ProGuard
-# include property in project.properties.
-#
-# For more details, see
-# http://developer.android.com/guide/developing/tools/proguard.html
-
-# Add any project specific keep options here:
-
-# If your project uses WebView with JS, uncomment the following
-# and specify the fully qualified class name to the JavaScript interface
-# class:
-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
-# public *;
-#}
diff --git a/facebook/samples/HelloFacebookSample/project.properties b/facebook/samples/HelloFacebookSample/project.properties
deleted file mode 100644
index cee0509c6..000000000
--- a/facebook/samples/HelloFacebookSample/project.properties
+++ /dev/null
@@ -1,15 +0,0 @@
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-#
-# This file must be checked in Version Control Systems.
-#
-# To customize properties used by the Ant build system edit
-# "ant.properties", and override values to adapt the script to your
-# project structure.
-#
-# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
-#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
-
-# Project target.
-target=android-8
-android.library.reference.1=../../facebook
diff --git a/facebook/samples/HelloFacebookSample/res/drawable-hdpi/icon.png b/facebook/samples/HelloFacebookSample/res/drawable-hdpi/icon.png
deleted file mode 100644
index e603120e1..000000000
Binary files a/facebook/samples/HelloFacebookSample/res/drawable-hdpi/icon.png and /dev/null differ
diff --git a/facebook/samples/HelloFacebookSample/res/drawable-mdpi/icon.png b/facebook/samples/HelloFacebookSample/res/drawable-mdpi/icon.png
deleted file mode 100644
index f2fc84fb6..000000000
Binary files a/facebook/samples/HelloFacebookSample/res/drawable-mdpi/icon.png and /dev/null differ
diff --git a/facebook/samples/HelloFacebookSample/res/drawable-xhdpi/icon.png b/facebook/samples/HelloFacebookSample/res/drawable-xhdpi/icon.png
deleted file mode 100644
index 143a69f21..000000000
Binary files a/facebook/samples/HelloFacebookSample/res/drawable-xhdpi/icon.png and /dev/null differ
diff --git a/facebook/samples/HelloFacebookSample/res/drawable/icon.png b/facebook/samples/HelloFacebookSample/res/drawable/icon.png
deleted file mode 100644
index f2fc84fb6..000000000
Binary files a/facebook/samples/HelloFacebookSample/res/drawable/icon.png and /dev/null differ
diff --git a/facebook/samples/HelloFacebookSample/res/layout/main.xml b/facebook/samples/HelloFacebookSample/res/layout/main.xml
deleted file mode 100644
index f326848b2..000000000
--- a/facebook/samples/HelloFacebookSample/res/layout/main.xml
+++ /dev/null
@@ -1,91 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/HelloFacebookSample/res/values/strings.xml b/facebook/samples/HelloFacebookSample/res/values/strings.xml
deleted file mode 100644
index c55cdb9d1..000000000
--- a/facebook/samples/HelloFacebookSample/res/values/strings.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
- HelloFacebookSample
- Cancelled
- Unable to perform selected action because permissions were not granted.
- OK
- Hello %1$s!
- Success
- Successfully posted \'%1$s\'.\nPost ID: %2$s
- Error
- Updating status for %1$s at %2$s
- Photo Post
- You picked:
- <No friends selected>
- <No place selected>
- Pick a Seattle Place
- 355198514515820
-
diff --git a/facebook/samples/HelloFacebookSample/src/com/facebook/samples/hellofacebook/HelloFacebookSampleActivity.java b/facebook/samples/HelloFacebookSample/src/com/facebook/samples/hellofacebook/HelloFacebookSampleActivity.java
deleted file mode 100644
index 52be10092..000000000
--- a/facebook/samples/HelloFacebookSample/src/com/facebook/samples/hellofacebook/HelloFacebookSampleActivity.java
+++ /dev/null
@@ -1,437 +0,0 @@
-/**
- * Copyright 2012 Facebook
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.facebook.samples.hellofacebook;
-
-import android.app.AlertDialog;
-import android.content.Intent;
-import android.graphics.Bitmap;
-import android.graphics.BitmapFactory;
-import android.location.Location;
-import android.os.Bundle;
-import android.support.v4.app.Fragment;
-import android.support.v4.app.FragmentActivity;
-import android.support.v4.app.FragmentManager;
-import android.text.TextUtils;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.Button;
-import android.widget.TextView;
-import com.facebook.*;
-import com.facebook.model.GraphObject;
-import com.facebook.model.GraphPlace;
-import com.facebook.model.GraphUser;
-import com.facebook.widget.*;
-
-import java.util.*;
-
-public class HelloFacebookSampleActivity extends FragmentActivity {
-
- private static final List PERMISSIONS = Arrays.asList("publish_actions");
- private static final Location SEATTLE_LOCATION = new Location("") {
- {
- setLatitude(47.6097);
- setLongitude(-122.3331);
- }
- };
-
- private final String PENDING_ACTION_BUNDLE_KEY = "com.facebook.samples.hellofacebook:PendingAction";
-
- private Button postStatusUpdateButton;
- private Button postPhotoButton;
- private Button pickFriendsButton;
- private Button pickPlaceButton;
- private LoginButton loginButton;
- private ProfilePictureView profilePictureView;
- private TextView greeting;
- private PendingAction pendingAction = PendingAction.NONE;
- private ViewGroup controlsContainer;
- private GraphUser user;
-
- private enum PendingAction {
- NONE,
- POST_PHOTO,
- POST_STATUS_UPDATE
- }
- private UiLifecycleHelper uiHelper;
-
- private Session.StatusCallback callback = new Session.StatusCallback() {
- @Override
- public void call(Session session, SessionState state, Exception exception) {
- onSessionStateChange(session, state, exception);
- }
- };
-
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- uiHelper = new UiLifecycleHelper(this, callback);
- uiHelper.onCreate(savedInstanceState);
-
- if (savedInstanceState != null) {
- String name = savedInstanceState.getString(PENDING_ACTION_BUNDLE_KEY);
- pendingAction = PendingAction.valueOf(name);
- }
-
- setContentView(R.layout.main);
-
- loginButton = (LoginButton) findViewById(R.id.login_button);
- loginButton.setUserInfoChangedCallback(new LoginButton.UserInfoChangedCallback() {
- @Override
- public void onUserInfoFetched(GraphUser user) {
- HelloFacebookSampleActivity.this.user = user;
- updateUI();
- // It's possible that we were waiting for this.user to be populated in order to post a
- // status update.
- handlePendingAction();
- }
- });
-
- profilePictureView = (ProfilePictureView) findViewById(R.id.profilePicture);
- greeting = (TextView) findViewById(R.id.greeting);
-
- postStatusUpdateButton = (Button) findViewById(R.id.postStatusUpdateButton);
- postStatusUpdateButton.setOnClickListener(new View.OnClickListener() {
- public void onClick(View view) {
- onClickPostStatusUpdate();
- }
- });
-
- postPhotoButton = (Button) findViewById(R.id.postPhotoButton);
- postPhotoButton.setOnClickListener(new View.OnClickListener() {
- public void onClick(View view) {
- onClickPostPhoto();
- }
- });
-
- pickFriendsButton = (Button) findViewById(R.id.pickFriendsButton);
- pickFriendsButton.setOnClickListener(new View.OnClickListener() {
- public void onClick(View view) {
- onClickPickFriends();
- }
- });
-
- pickPlaceButton = (Button) findViewById(R.id.pickPlaceButton);
- pickPlaceButton.setOnClickListener(new View.OnClickListener() {
- public void onClick(View view) {
- onClickPickPlace();
- }
- });
-
- controlsContainer = (ViewGroup) findViewById(R.id.main_ui_container);
-
- final FragmentManager fm = getSupportFragmentManager();
- Fragment fragment = fm.findFragmentById(R.id.fragment_container);
- if (fragment != null) {
- // If we're being re-created and have a fragment, we need to a) hide the main UI controls and
- // b) hook up its listeners again.
- controlsContainer.setVisibility(View.GONE);
- if (fragment instanceof FriendPickerFragment) {
- setFriendPickerListeners((FriendPickerFragment) fragment);
- } else if (fragment instanceof PlacePickerFragment) {
- setPlacePickerListeners((PlacePickerFragment) fragment);
- }
- }
-
- // Listen for changes in the back stack so we know if a fragment got popped off because the user
- // clicked the back button.
- fm.addOnBackStackChangedListener(new FragmentManager.OnBackStackChangedListener() {
- @Override
- public void onBackStackChanged() {
- if (fm.getBackStackEntryCount() == 0) {
- // We need to re-show our UI.
- controlsContainer.setVisibility(View.VISIBLE);
- }
- }
- });
- }
-
- @Override
- protected void onResume() {
- super.onResume();
- uiHelper.onResume();
-
- updateUI();
- }
-
- @Override
- protected void onSaveInstanceState(Bundle outState) {
- super.onSaveInstanceState(outState);
- uiHelper.onSaveInstanceState(outState);
-
- outState.putString(PENDING_ACTION_BUNDLE_KEY, pendingAction.name());
- }
-
- @Override
- protected void onActivityResult(int requestCode, int resultCode, Intent data) {
- super.onActivityResult(requestCode, resultCode, data);
- uiHelper.onActivityResult(requestCode, resultCode, data);
- }
-
- @Override
- public void onPause() {
- super.onPause();
- uiHelper.onPause();
- }
-
- @Override
- public void onDestroy() {
- super.onDestroy();
- uiHelper.onDestroy();
- }
-
- private void onSessionStateChange(Session session, SessionState state, Exception exception) {
- if (pendingAction != PendingAction.NONE &&
- (exception instanceof FacebookOperationCanceledException ||
- exception instanceof FacebookAuthorizationException)) {
- new AlertDialog.Builder(HelloFacebookSampleActivity.this)
- .setTitle(R.string.cancelled)
- .setMessage(R.string.permission_not_granted)
- .setPositiveButton(R.string.ok, null)
- .show();
- pendingAction = PendingAction.NONE;
- } else if (state == SessionState.OPENED_TOKEN_UPDATED) {
- handlePendingAction();
- }
- updateUI();
- }
-
- private void updateUI() {
- Session session = Session.getActiveSession();
- boolean enableButtons = (session != null && session.isOpened());
-
- postStatusUpdateButton.setEnabled(enableButtons);
- postPhotoButton.setEnabled(enableButtons);
- pickFriendsButton.setEnabled(enableButtons);
- pickPlaceButton.setEnabled(enableButtons);
-
- if (enableButtons && user != null) {
- profilePictureView.setProfileId(user.getId());
- greeting.setText(getString(R.string.hello_user, user.getFirstName()));
- } else {
- profilePictureView.setProfileId(null);
- greeting.setText(null);
- }
- }
-
- @SuppressWarnings("incomplete-switch")
- private void handlePendingAction() {
- PendingAction previouslyPendingAction = pendingAction;
- // These actions may re-set pendingAction if they are still pending, but we assume they
- // will succeed.
- pendingAction = PendingAction.NONE;
-
- switch (previouslyPendingAction) {
- case POST_PHOTO:
- postPhoto();
- break;
- case POST_STATUS_UPDATE:
- postStatusUpdate();
- break;
- }
- }
-
- private interface GraphObjectWithId extends GraphObject {
- String getId();
- }
-
- private void showPublishResult(String message, GraphObject result, FacebookRequestError error) {
- String title = null;
- String alertMessage = null;
- if (error == null) {
- title = getString(R.string.success);
- String id = result.cast(GraphObjectWithId.class).getId();
- alertMessage = getString(R.string.successfully_posted_post, message, id);
- } else {
- title = getString(R.string.error);
- alertMessage = error.getErrorMessage();
- }
-
- new AlertDialog.Builder(this)
- .setTitle(title)
- .setMessage(alertMessage)
- .setPositiveButton(R.string.ok, null)
- .show();
- }
-
- private void onClickPostStatusUpdate() {
- performPublish(PendingAction.POST_STATUS_UPDATE);
- }
-
- private void postStatusUpdate() {
- if (user != null && hasPublishPermission()) {
- final String message = getString(R.string.status_update, user.getFirstName(), (new Date().toString()));
- Request request = Request
- .newStatusUpdateRequest(Session.getActiveSession(), message, new Request.Callback() {
- @Override
- public void onCompleted(Response response) {
- showPublishResult(message, response.getGraphObject(), response.getError());
- }
- });
- request.executeAsync();
- } else {
- pendingAction = PendingAction.POST_STATUS_UPDATE;
- }
- }
-
- private void onClickPostPhoto() {
- performPublish(PendingAction.POST_PHOTO);
- }
-
- private void postPhoto() {
- if (hasPublishPermission()) {
- Bitmap image = BitmapFactory.decodeResource(this.getResources(), R.drawable.icon);
- Request request = Request.newUploadPhotoRequest(Session.getActiveSession(), image, new Request.Callback() {
- @Override
- public void onCompleted(Response response) {
- showPublishResult(getString(R.string.photo_post), response.getGraphObject(), response.getError());
- }
- });
- request.executeAsync();
- } else {
- pendingAction = PendingAction.POST_PHOTO;
- }
- }
-
- private void showPickerFragment(PickerFragment> fragment) {
- fragment.setOnErrorListener(new PickerFragment.OnErrorListener() {
- @Override
- public void onError(PickerFragment> pickerFragment, FacebookException error) {
- showAlert(getString(R.string.error), error.getMessage());
- }
- });
-
- FragmentManager fm = getSupportFragmentManager();
- fm.beginTransaction()
- .replace(R.id.fragment_container, fragment)
- .addToBackStack(null)
- .commit();
-
- controlsContainer.setVisibility(View.GONE);
-
- // We want the fragment fully created so we can use it immediately.
- fm.executePendingTransactions();
-
- fragment.loadData(false);
- }
-
- private void onClickPickFriends() {
- final FriendPickerFragment fragment = new FriendPickerFragment();
-
- setFriendPickerListeners(fragment);
-
- showPickerFragment(fragment);
- }
-
- private void setFriendPickerListeners(final FriendPickerFragment fragment) {
- fragment.setOnDoneButtonClickedListener(new FriendPickerFragment.OnDoneButtonClickedListener() {
- @Override
- public void onDoneButtonClicked(PickerFragment> pickerFragment) {
- onFriendPickerDone(fragment);
- }
- });
- }
-
- private void onFriendPickerDone(FriendPickerFragment fragment) {
- FragmentManager fm = getSupportFragmentManager();
- fm.popBackStack();
-
- String results = "";
-
- Collection selection = fragment.getSelection();
- if (selection != null && selection.size() > 0) {
- ArrayList names = new ArrayList();
- for (GraphUser user : selection) {
- names.add(user.getName());
- }
- results = TextUtils.join(", ", names);
- } else {
- results = getString(R.string.no_friends_selected);
- }
-
- showAlert(getString(R.string.you_picked), results);
- }
-
- private void onPlacePickerDone(PlacePickerFragment fragment) {
- FragmentManager fm = getSupportFragmentManager();
- fm.popBackStack();
-
- String result = "";
-
- GraphPlace selection = fragment.getSelection();
- if (selection != null) {
- result = selection.getName();
- } else {
- result = getString(R.string.no_place_selected);
- }
-
- showAlert(getString(R.string.you_picked), result);
- }
-
- private void onClickPickPlace() {
- final PlacePickerFragment fragment = new PlacePickerFragment();
- fragment.setLocation(SEATTLE_LOCATION);
- fragment.setTitleText(getString(R.string.pick_seattle_place));
-
- setPlacePickerListeners(fragment);
-
- showPickerFragment(fragment);
- }
-
- private void setPlacePickerListeners(final PlacePickerFragment fragment) {
- fragment.setOnDoneButtonClickedListener(new PlacePickerFragment.OnDoneButtonClickedListener() {
- @Override
- public void onDoneButtonClicked(PickerFragment> pickerFragment) {
- onPlacePickerDone(fragment);
- }
- });
- fragment.setOnSelectionChangedListener(new PlacePickerFragment.OnSelectionChangedListener() {
- @Override
- public void onSelectionChanged(PickerFragment> pickerFragment) {
- if (fragment.getSelection() != null) {
- onPlacePickerDone(fragment);
- }
- }
- });
- }
-
- private void showAlert(String title, String message) {
- new AlertDialog.Builder(this)
- .setTitle(title)
- .setMessage(message)
- .setPositiveButton(R.string.ok, null)
- .show();
- }
-
- private boolean hasPublishPermission() {
- Session session = Session.getActiveSession();
- return session != null && session.getPermissions().contains("publish_actions");
- }
-
- private void performPublish(PendingAction action) {
- Session session = Session.getActiveSession();
- if (session != null) {
- pendingAction = action;
- if (hasPublishPermission()) {
- // We can do the action right away.
- handlePendingAction();
- } else {
- // We need to get new permissions, then complete the action when we get called back.
- session.requestNewPublishPermissions(new Session.NewPermissionsRequest(this, PERMISSIONS));
- }
- }
- }
-}
diff --git a/facebook/samples/PlacePickerSample/.classpath b/facebook/samples/PlacePickerSample/.classpath
deleted file mode 100644
index 655a4a827..000000000
--- a/facebook/samples/PlacePickerSample/.classpath
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/PlacePickerSample/.project b/facebook/samples/PlacePickerSample/.project
deleted file mode 100644
index 73ec9015a..000000000
--- a/facebook/samples/PlacePickerSample/.project
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
- PlacePickerSample
-
-
-
-
-
- com.android.ide.eclipse.adt.ResourceManagerBuilder
-
-
-
-
- com.android.ide.eclipse.adt.PreCompilerBuilder
-
-
-
-
- org.eclipse.jdt.core.javabuilder
-
-
-
-
- com.android.ide.eclipse.adt.ApkBuilder
-
-
-
-
-
- com.android.ide.eclipse.adt.AndroidNature
- org.eclipse.jdt.core.javanature
-
-
diff --git a/facebook/samples/PlacePickerSample/AndroidManifest.xml b/facebook/samples/PlacePickerSample/AndroidManifest.xml
deleted file mode 100644
index b0697ff65..000000000
--- a/facebook/samples/PlacePickerSample/AndroidManifest.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/PlacePickerSample/ant.properties b/facebook/samples/PlacePickerSample/ant.properties
deleted file mode 100644
index 939105d52..000000000
--- a/facebook/samples/PlacePickerSample/ant.properties
+++ /dev/null
@@ -1,18 +0,0 @@
-# This file is used to override default values used by the Ant build system.
-#
-# This file must be checked into Version Control Systems, as it is
-# integral to the build system of your project.
-
-# This file is only used by the Ant script.
-
-# You can use this to override default values such as
-# 'source.dir' for the location of your java source folder and
-# 'out.dir' for the location of your output folder.
-
-# You can also use it define how the release builds are signed by declaring
-# the following properties:
-# 'key.store' for the location of your keystore and
-# 'key.alias' for the name of the key to use.
-# The password will be asked during the build when you use the 'release' target.
-
-java.compilerargs=-Xlint -Werror
diff --git a/facebook/samples/PlacePickerSample/build.xml b/facebook/samples/PlacePickerSample/build.xml
deleted file mode 100644
index a80f395cd..000000000
--- a/facebook/samples/PlacePickerSample/build.xml
+++ /dev/null
@@ -1,92 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/PlacePickerSample/proguard-project.txt b/facebook/samples/PlacePickerSample/proguard-project.txt
deleted file mode 100644
index f2fe1559a..000000000
--- a/facebook/samples/PlacePickerSample/proguard-project.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-# To enable ProGuard in your project, edit project.properties
-# to define the proguard.config property as described in that file.
-#
-# Add project specific ProGuard rules here.
-# By default, the flags in this file are appended to flags specified
-# in ${sdk.dir}/tools/proguard/proguard-android.txt
-# You can edit the include path and order by changing the ProGuard
-# include property in project.properties.
-#
-# For more details, see
-# http://developer.android.com/guide/developing/tools/proguard.html
-
-# Add any project specific keep options here:
-
-# If your project uses WebView with JS, uncomment the following
-# and specify the fully qualified class name to the JavaScript interface
-# class:
-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
-# public *;
-#}
diff --git a/facebook/samples/PlacePickerSample/project.properties b/facebook/samples/PlacePickerSample/project.properties
deleted file mode 100644
index cee0509c6..000000000
--- a/facebook/samples/PlacePickerSample/project.properties
+++ /dev/null
@@ -1,15 +0,0 @@
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-#
-# This file must be checked in Version Control Systems.
-#
-# To customize properties used by the Ant build system edit
-# "ant.properties", and override values to adapt the script to your
-# project structure.
-#
-# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
-#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
-
-# Project target.
-target=android-8
-android.library.reference.1=../../facebook
diff --git a/facebook/samples/PlacePickerSample/res/drawable-hdpi/icon.png b/facebook/samples/PlacePickerSample/res/drawable-hdpi/icon.png
deleted file mode 100644
index 4059334b5..000000000
Binary files a/facebook/samples/PlacePickerSample/res/drawable-hdpi/icon.png and /dev/null differ
diff --git a/facebook/samples/PlacePickerSample/res/drawable-mdpi/icon.png b/facebook/samples/PlacePickerSample/res/drawable-mdpi/icon.png
deleted file mode 100644
index 1fa3834d0..000000000
Binary files a/facebook/samples/PlacePickerSample/res/drawable-mdpi/icon.png and /dev/null differ
diff --git a/facebook/samples/PlacePickerSample/res/drawable-xhdpi/icon.png b/facebook/samples/PlacePickerSample/res/drawable-xhdpi/icon.png
deleted file mode 100644
index 2b3083d44..000000000
Binary files a/facebook/samples/PlacePickerSample/res/drawable-xhdpi/icon.png and /dev/null differ
diff --git a/facebook/samples/PlacePickerSample/res/drawable/icon.png b/facebook/samples/PlacePickerSample/res/drawable/icon.png
deleted file mode 100644
index 1fa3834d0..000000000
Binary files a/facebook/samples/PlacePickerSample/res/drawable/icon.png and /dev/null differ
diff --git a/facebook/samples/PlacePickerSample/res/layout/main.xml b/facebook/samples/PlacePickerSample/res/layout/main.xml
deleted file mode 100644
index 7c4c7f1d0..000000000
--- a/facebook/samples/PlacePickerSample/res/layout/main.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/PlacePickerSample/res/layout/pick_place_activity.xml b/facebook/samples/PlacePickerSample/res/layout/pick_place_activity.xml
deleted file mode 100644
index 8601f57e4..000000000
--- a/facebook/samples/PlacePickerSample/res/layout/pick_place_activity.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
-
-
-
diff --git a/facebook/samples/PlacePickerSample/res/values/strings.xml b/facebook/samples/PlacePickerSample/res/values/strings.xml
deleted file mode 100644
index 2248b47dd..000000000
--- a/facebook/samples/PlacePickerSample/res/values/strings.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
- PlacePickerSample
- 378281678861098
- Error
- OK
- Could not obtain your current location.
-
diff --git a/facebook/samples/PlacePickerSample/src/com/facebook/samples/placepicker/PickPlaceActivity.java b/facebook/samples/PlacePickerSample/src/com/facebook/samples/placepicker/PickPlaceActivity.java
deleted file mode 100644
index c02da9bdc..000000000
--- a/facebook/samples/PlacePickerSample/src/com/facebook/samples/placepicker/PickPlaceActivity.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/**
- * Copyright 2012 Facebook
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.facebook.samples.placepicker;
-
-import android.app.AlertDialog;
-import android.content.Intent;
-import android.location.Location;
-import android.os.Bundle;
-import android.support.v4.app.FragmentActivity;
-import android.support.v4.app.FragmentManager;
-import com.facebook.FacebookException;
-import com.facebook.widget.PickerFragment;
-import com.facebook.widget.PlacePickerFragment;
-
-// This class provides an example of an Activity that uses PlacePickerFragment to display a list of
-// the places. It takes a layout-based approach to creating the PlacePickerFragment with the
-// desired parameters -- see PickFriendActivity in the FriendPickerSample project for an example of an
-// Activity creating a fragment (in this case a FriendPickerFragment) programmatically rather than
-// via XML layout.
-public class PickPlaceActivity extends FragmentActivity {
- PlacePickerFragment placePickerFragment;
-
- // A helper to simplify life for callers who want to populate a Bundle with the necessary
- // parameters. A more sophisticated Activity might define its own set of parameters; our needs
- // are simple, so we just populate what we want to pass to the PlacePickerFragment.
- public static void populateParameters(Intent intent, Location location, String searchText) {
- intent.putExtra(PlacePickerFragment.LOCATION_BUNDLE_KEY, location);
- intent.putExtra(PlacePickerFragment.SEARCH_TEXT_BUNDLE_KEY, searchText);
- }
-
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.pick_place_activity);
-
- FragmentManager fm = getSupportFragmentManager();
- placePickerFragment = (PlacePickerFragment) fm.findFragmentById(R.id.place_picker_fragment);
- if (savedInstanceState == null) {
- // If this is the first time we have created the fragment, update its properties based on
- // any parameters we received via our Intent.
- placePickerFragment.setSettingsFromBundle(getIntent().getExtras());
- }
-
- placePickerFragment.setOnErrorListener(new PickerFragment.OnErrorListener() {
- @Override
- public void onError(PickerFragment> fragment, FacebookException error) {
- PickPlaceActivity.this.onError(error);
- }
- });
-
- // We finish the activity when either the Done button is pressed or when a place is
- // selected (since only a single place can be selected).
- placePickerFragment.setOnSelectionChangedListener(new PickerFragment.OnSelectionChangedListener() {
- @Override
- public void onSelectionChanged(PickerFragment> fragment) {
- if (placePickerFragment.getSelection() != null) {
- finishActivity();
- }
- }
- });
- placePickerFragment.setOnDoneButtonClickedListener(new PickerFragment.OnDoneButtonClickedListener() {
- @Override
- public void onDoneButtonClicked(PickerFragment> fragment) {
- finishActivity();
- }
- });
- }
-
- private void finishActivity() {
- // We just store our selection in the Application for other activities to look at.
- PlacePickerApplication application = (PlacePickerApplication) getApplication();
- application.setSelectedPlace(placePickerFragment.getSelection());
-
- setResult(RESULT_OK, null);
- finish();
- }
-
- private void onError(Exception error) {
- new AlertDialog.Builder(this)
- .setTitle(R.string.error_dialog_title)
- .setMessage(error.getMessage())
- .setPositiveButton(R.string.ok_button, null)
- .show();
- }
-
- @Override
- protected void onStart() {
- super.onStart();
- try {
- // Load data, unless a query has already taken place.
- placePickerFragment.loadData(false);
- } catch (Exception ex) {
- onError(ex);
- }
- }
-}
diff --git a/facebook/samples/PlacePickerSample/src/com/facebook/samples/placepicker/PlacePickerApplication.java b/facebook/samples/PlacePickerSample/src/com/facebook/samples/placepicker/PlacePickerApplication.java
deleted file mode 100644
index 344c38732..000000000
--- a/facebook/samples/PlacePickerSample/src/com/facebook/samples/placepicker/PlacePickerApplication.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/**
- * Copyright 2012 Facebook
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.facebook.samples.placepicker;
-
-import android.app.Application;
-import com.facebook.model.GraphPlace;
-
-// We use a custom Application class to store our minimal state data (which users have been selected).
-// A real-world application will likely require a more robust data model.
-public class PlacePickerApplication extends Application {
- public GraphPlace getSelectedPlace() {
- return selectedPlace;
- }
-
- public void setSelectedPlace(GraphPlace selectedPlace) {
- this.selectedPlace = selectedPlace;
- }
-
- private GraphPlace selectedPlace;
-
-}
diff --git a/facebook/samples/PlacePickerSample/src/com/facebook/samples/placepicker/PlacePickerSampleActivity.java b/facebook/samples/PlacePickerSample/src/com/facebook/samples/placepicker/PlacePickerSampleActivity.java
deleted file mode 100644
index 2be700ed4..000000000
--- a/facebook/samples/PlacePickerSample/src/com/facebook/samples/placepicker/PlacePickerSampleActivity.java
+++ /dev/null
@@ -1,213 +0,0 @@
-/**
- * Copyright 2012 Facebook
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.facebook.samples.placepicker;
-
-import android.app.AlertDialog;
-import android.content.Context;
-import android.content.Intent;
-import android.location.Criteria;
-import android.location.Location;
-import android.location.LocationListener;
-import android.location.LocationManager;
-import android.os.Bundle;
-import android.support.v4.app.FragmentActivity;
-import android.view.View;
-import android.widget.Button;
-import android.widget.TextView;
-import com.facebook.model.GraphLocation;
-import com.facebook.model.GraphPlace;
-import com.facebook.Session;
-
-public class PlacePickerSampleActivity extends FragmentActivity implements LocationListener {
- private static final int PLACE_ACTIVITY = 1;
- private static final Location SEATTLE_LOCATION = new Location("") {
- {
- setLatitude(47.6097);
- setLongitude(-122.3331);
- }
- };
- private static final Location SAN_FRANCISCO_LOCATION = new Location("") {
- {
- setLatitude(37.7750);
- setLongitude(-122.4183);
- }
- };
- private static final Location PARIS_LOCATION = new Location("") {
- {
- setLatitude(48.857875);
- setLongitude(2.294635);
- }
- };
-
- private TextView resultsTextView;
- private LocationManager locationManager;
- private Location lastKnownLocation;
-
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
-
- resultsTextView = (TextView) findViewById(R.id.resultsTextView);
- Button button = (Button) findViewById(R.id.seattleButton);
- button.setOnClickListener(new View.OnClickListener() {
- public void onClick(View view) {
- onClickSeattle();
- }
- });
-
- button = (Button) findViewById(R.id.sanFranciscoButton);
- button.setOnClickListener(new View.OnClickListener() {
- public void onClick(View view) {
- onClickSanFrancisco();
- }
- });
-
- button = (Button) findViewById(R.id.gpsButton);
- button.setOnClickListener(new View.OnClickListener() {
- public void onClick(View view) {
- onClickGPS();
- }
- });
-
- if (Session.getActiveSession() == null ||
- Session.getActiveSession().isClosed()) {
- Session.openActiveSession(this, true, null);
- }
-
- locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
- }
-
- @Override
- protected void onStart() {
- super.onStart();
-
- // Update the display every time we are started (this will be "no place selected" on first
- // run, or possibly details of a place if the activity is being re-created).
- displaySelectedPlace(RESULT_OK);
- }
-
- private void onError(Exception exception) {
- AlertDialog.Builder builder = new AlertDialog.Builder(this);
- builder.setTitle("Error").setMessage(exception.getMessage()).setPositiveButton("OK", null);
- builder.show();
- }
-
- public void onActivityResult(int requestCode, int resultCode, Intent data) {
- switch (requestCode) {
- case PLACE_ACTIVITY:
- displaySelectedPlace(resultCode);
- break;
- default:
- Session.getActiveSession().onActivityResult(this, requestCode, resultCode, data);
- break;
- }
- }
-
- private void displaySelectedPlace(int resultCode) {
- String results = "";
- PlacePickerApplication application = (PlacePickerApplication) getApplication();
-
- GraphPlace selection = application.getSelectedPlace();
- if (selection != null) {
- GraphLocation location = selection.getLocation();
-
- results = String.format("Name: %s\nCategory: %s\nLocation: (%f,%f)\nStreet: %s, %s, %s, %s, %s",
- selection.getName(), selection.getCategory(),
- location.getLatitude(), location.getLongitude(),
- location.getStreet(), location.getCity(), location.getState(), location.getZip(),
- location.getCountry());
- } else {
- results = "";
- }
-
- resultsTextView.setText(results);
- }
-
- public void onLocationChanged(Location location) {
- lastKnownLocation = location;
- }
-
- @Override
- public void onStatusChanged(String provider, int status, Bundle extras) {
- }
-
- @Override
- public void onProviderEnabled(String provider) {
- }
-
- @Override
- public void onProviderDisabled(String provider) {
- }
-
- private void startPickPlaceActivity(Location location) {
- PlacePickerApplication application = (PlacePickerApplication) getApplication();
- application.setSelectedPlace(null);
-
- Intent intent = new Intent(this, PickPlaceActivity.class);
- PickPlaceActivity.populateParameters(intent, location, null);
-
- startActivityForResult(intent, PLACE_ACTIVITY);
- }
-
- private void onClickSeattle() {
- try {
- startPickPlaceActivity(SEATTLE_LOCATION);
- } catch (Exception ex) {
- onError(ex);
- }
- }
-
- private void onClickSanFrancisco() {
- try {
- startPickPlaceActivity(SAN_FRANCISCO_LOCATION);
- } catch (Exception ex) {
- onError(ex);
- }
- }
-
- private void onClickGPS() {
- try {
- if (lastKnownLocation == null) {
- Criteria criteria = new Criteria();
- String bestProvider = locationManager.getBestProvider(criteria, false);
- if (bestProvider != null) {
- lastKnownLocation = locationManager.getLastKnownLocation(bestProvider);
- }
- }
- if (lastKnownLocation == null) {
- String model = android.os.Build.MODEL;
- if (model.equals("sdk") || model.equals("google_sdk") || model.contains("x86")) {
- // Looks like they are on an emulator, pretend we're in Paris if we don't have a
- // location set.
- lastKnownLocation = PARIS_LOCATION;
- } else {
- new AlertDialog.Builder(this)
- .setTitle(R.string.error_dialog_title)
- .setMessage(R.string.no_location)
- .setPositiveButton(R.string.ok_button, null)
- .show();
- return;
- }
- }
- startPickPlaceActivity(lastKnownLocation);
- } catch (Exception ex) {
- onError(ex);
- }
- }
-
-}
diff --git a/facebook/samples/ProfilePictureSample/.classpath b/facebook/samples/ProfilePictureSample/.classpath
deleted file mode 100644
index 655a4a827..000000000
--- a/facebook/samples/ProfilePictureSample/.classpath
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/ProfilePictureSample/.project b/facebook/samples/ProfilePictureSample/.project
deleted file mode 100644
index 44914352a..000000000
--- a/facebook/samples/ProfilePictureSample/.project
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
- ProfilePictureSample
-
-
-
-
-
- com.android.ide.eclipse.adt.ResourceManagerBuilder
-
-
-
-
- com.android.ide.eclipse.adt.PreCompilerBuilder
-
-
-
-
- org.eclipse.jdt.core.javabuilder
-
-
-
-
- com.android.ide.eclipse.adt.ApkBuilder
-
-
-
-
-
- com.android.ide.eclipse.adt.AndroidNature
- org.eclipse.jdt.core.javanature
-
-
diff --git a/facebook/samples/ProfilePictureSample/AndroidManifest.xml b/facebook/samples/ProfilePictureSample/AndroidManifest.xml
deleted file mode 100644
index 907d05754..000000000
--- a/facebook/samples/ProfilePictureSample/AndroidManifest.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/ProfilePictureSample/ant.properties b/facebook/samples/ProfilePictureSample/ant.properties
deleted file mode 100644
index 939105d52..000000000
--- a/facebook/samples/ProfilePictureSample/ant.properties
+++ /dev/null
@@ -1,18 +0,0 @@
-# This file is used to override default values used by the Ant build system.
-#
-# This file must be checked into Version Control Systems, as it is
-# integral to the build system of your project.
-
-# This file is only used by the Ant script.
-
-# You can use this to override default values such as
-# 'source.dir' for the location of your java source folder and
-# 'out.dir' for the location of your output folder.
-
-# You can also use it define how the release builds are signed by declaring
-# the following properties:
-# 'key.store' for the location of your keystore and
-# 'key.alias' for the name of the key to use.
-# The password will be asked during the build when you use the 'release' target.
-
-java.compilerargs=-Xlint -Werror
diff --git a/facebook/samples/ProfilePictureSample/build.xml b/facebook/samples/ProfilePictureSample/build.xml
deleted file mode 100644
index 3454adc93..000000000
--- a/facebook/samples/ProfilePictureSample/build.xml
+++ /dev/null
@@ -1,92 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/ProfilePictureSample/proguard-project.txt b/facebook/samples/ProfilePictureSample/proguard-project.txt
deleted file mode 100644
index f2fe1559a..000000000
--- a/facebook/samples/ProfilePictureSample/proguard-project.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-# To enable ProGuard in your project, edit project.properties
-# to define the proguard.config property as described in that file.
-#
-# Add project specific ProGuard rules here.
-# By default, the flags in this file are appended to flags specified
-# in ${sdk.dir}/tools/proguard/proguard-android.txt
-# You can edit the include path and order by changing the ProGuard
-# include property in project.properties.
-#
-# For more details, see
-# http://developer.android.com/guide/developing/tools/proguard.html
-
-# Add any project specific keep options here:
-
-# If your project uses WebView with JS, uncomment the following
-# and specify the fully qualified class name to the JavaScript interface
-# class:
-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
-# public *;
-#}
diff --git a/facebook/samples/ProfilePictureSample/project.properties b/facebook/samples/ProfilePictureSample/project.properties
deleted file mode 100644
index cee0509c6..000000000
--- a/facebook/samples/ProfilePictureSample/project.properties
+++ /dev/null
@@ -1,15 +0,0 @@
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-#
-# This file must be checked in Version Control Systems.
-#
-# To customize properties used by the Ant build system edit
-# "ant.properties", and override values to adapt the script to your
-# project structure.
-#
-# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
-#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
-
-# Project target.
-target=android-8
-android.library.reference.1=../../facebook
diff --git a/facebook/samples/ProfilePictureSample/res/drawable-hdpi/icon.png b/facebook/samples/ProfilePictureSample/res/drawable-hdpi/icon.png
deleted file mode 100644
index 1bc72b1bf..000000000
Binary files a/facebook/samples/ProfilePictureSample/res/drawable-hdpi/icon.png and /dev/null differ
diff --git a/facebook/samples/ProfilePictureSample/res/drawable-mdpi/icon.png b/facebook/samples/ProfilePictureSample/res/drawable-mdpi/icon.png
deleted file mode 100644
index e0de1a4ba..000000000
Binary files a/facebook/samples/ProfilePictureSample/res/drawable-mdpi/icon.png and /dev/null differ
diff --git a/facebook/samples/ProfilePictureSample/res/drawable-xhdpi/icon.png b/facebook/samples/ProfilePictureSample/res/drawable-xhdpi/icon.png
deleted file mode 100644
index 1bc4b231d..000000000
Binary files a/facebook/samples/ProfilePictureSample/res/drawable-xhdpi/icon.png and /dev/null differ
diff --git a/facebook/samples/ProfilePictureSample/res/drawable/icon.png b/facebook/samples/ProfilePictureSample/res/drawable/icon.png
deleted file mode 100644
index e0de1a4ba..000000000
Binary files a/facebook/samples/ProfilePictureSample/res/drawable/icon.png and /dev/null differ
diff --git a/facebook/samples/ProfilePictureSample/res/layout/activity_profile_picture_sample.xml b/facebook/samples/ProfilePictureSample/res/layout/activity_profile_picture_sample.xml
deleted file mode 100644
index 87877789a..000000000
--- a/facebook/samples/ProfilePictureSample/res/layout/activity_profile_picture_sample.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
diff --git a/facebook/samples/ProfilePictureSample/res/layout/fragment_profile_picture_sample.xml b/facebook/samples/ProfilePictureSample/res/layout/fragment_profile_picture_sample.xml
deleted file mode 100644
index 8735c788a..000000000
--- a/facebook/samples/ProfilePictureSample/res/layout/fragment_profile_picture_sample.xml
+++ /dev/null
@@ -1,152 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/ProfilePictureSample/res/values/strings.xml b/facebook/samples/ProfilePictureSample/res/values/strings.xml
deleted file mode 100644
index a9b3c10d5..000000000
--- a/facebook/samples/ProfilePictureSample/res/values/strings.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
- ProfilePictureSample
- Sample app demonstrating the use of ProfilePictureView
- Show cropped version
- Original
- Square
- Chris
- Michael
- Karthik
- Random
- None
- -
- +
- Large
- Normal
- Small
- Use preset size
- Use custom size
-
diff --git a/facebook/samples/ProfilePictureSample/src/com/facebook/samples/profilepicture/ProfilePictureSampleActivity.java b/facebook/samples/ProfilePictureSample/src/com/facebook/samples/profilepicture/ProfilePictureSampleActivity.java
deleted file mode 100644
index 9b35d3e21..000000000
--- a/facebook/samples/ProfilePictureSample/src/com/facebook/samples/profilepicture/ProfilePictureSampleActivity.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- * Copyright 2012 Facebook
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.facebook.samples.profilepicture;
-
-import android.os.Bundle;
-import android.support.v4.app.FragmentActivity;
-
-public class ProfilePictureSampleActivity extends FragmentActivity {
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_profile_picture_sample);
- }
-}
diff --git a/facebook/samples/ProfilePictureSample/src/com/facebook/samples/profilepicture/ProfilePictureSampleFragment.java b/facebook/samples/ProfilePictureSample/src/com/facebook/samples/profilepicture/ProfilePictureSampleFragment.java
deleted file mode 100644
index 1efec3fb5..000000000
--- a/facebook/samples/ProfilePictureSample/src/com/facebook/samples/profilepicture/ProfilePictureSampleFragment.java
+++ /dev/null
@@ -1,314 +0,0 @@
-/**
- * Copyright 2012 Facebook
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.facebook.samples.profilepicture;
-
-import android.os.Bundle;
-import android.support.v4.app.Fragment;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.*;
-import com.facebook.widget.ProfilePictureView;
-
-import java.util.Date;
-import java.util.Random;
-
-public class ProfilePictureSampleFragment extends Fragment {
-
- // Keeping the number of custom sizes low to prevent excessive network chatter.
- private static final int MAX_CUSTOM_SIZES = 6;
- private static final int DEFAULT_SIZE_INCREMENT = MAX_CUSTOM_SIZES / 2;
- private static final String PICTURE_SIZE_TYPE_KEY = "PictureSizeType";
-
- private static final String[] INTERESTING_IDS = {
- "zuck",
- // Recent Presidents and nominees
- "barackobama",
- "mittromney",
- "johnmccain",
- "johnkerry",
- "georgewbush",
- "algore",
- // Places too!
- "Disneyland",
- "SpaceNeedle",
- "TourEiffel",
- "sydneyoperahouse",
- // A selection of 1986 Mets
- "166020963458360",
- "108084865880237",
- "140447466087679",
- "111825495501392",
- // The cast of Saved by the Bell
- "108168249210849",
- "TiffaniThiessen",
- "108126672542534",
- "112886105391693",
- "MarioLopezExtra",
- "108504145837165",
- "dennishaskins",
- // Eighties bands that have been to Moscow
- "7220821999",
- "31938132882",
- "108023262558391",
- "209263392372",
- "104132506290482",
- "9721897972",
- "5461947317",
- "57084011597",
- // Three people that have never been in my kitchen
- "24408579964",
- "111980872152571",
- "112427772106500",
- // Trusted anchormen
- "113415525338717",
- "105628452803615",
- "105533779480538",
- };
-
- private int pictureSizeType = ProfilePictureView.CUSTOM;
- private String firstUserId;
- private Random randomGenerator;
-
- private ProfilePictureView profilePic;
- private Button smallerButton;
- private Button largerButton;
- private TextView sizeLabel;
- private View presetSizeView;
- private SeekBar customSizeView;
- private CheckBox cropToggle;
-
- @Override
- public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {
- View fragmentView = inflater.inflate(R.layout.fragment_profile_picture_sample, parent, false);
-
- randomGenerator = new Random((new Date()).getTime());
-
- profilePic = (ProfilePictureView) fragmentView.findViewById(R.id.profilepic);
- smallerButton = (Button) fragmentView.findViewById(R.id.smallerButton);
- largerButton = (Button) fragmentView.findViewById(R.id.largerButton);
- sizeLabel = (TextView) fragmentView.findViewById(R.id.sizeLabel);
- presetSizeView = fragmentView.findViewById(R.id.presetSizeView);
- customSizeView = (SeekBar) fragmentView.findViewById(R.id.customSizeView);
- cropToggle = (CheckBox) fragmentView.findViewById(R.id.squareCropToggle);
-
- LinearLayout container = (LinearLayout) fragmentView.findViewById(R.id.userbuttoncontainer);
- int numChildren = container.getChildCount();
- for (int i = 0; i < numChildren; i++) {
- View childView = container.getChildAt(i);
- Object tag = childView.getTag();
- if (childView instanceof Button) {
- setupUserButton((Button)childView);
- if (i == 0) {
- // Initialize the image to the first user
- firstUserId = tag.toString();
- }
- }
- }
-
- cropToggle.setOnCheckedChangeListener(new CheckBox.OnCheckedChangeListener() {
- @Override
- public void onCheckedChanged(CompoundButton checkbox, boolean checked) {
- profilePic.setCropped(checked);
- }
- });
-
- final Button sizeToggle = (Button) fragmentView.findViewById(R.id.sizeToggle);
- sizeToggle.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- if (pictureSizeType != ProfilePictureView.CUSTOM) {
- sizeToggle.setText(R.string.preset_size_button_text);
- switchToCustomSize();
- } else {
- sizeToggle.setText(R.string.custom_size_button_text);
- switchToPresetSize(ProfilePictureView.LARGE);
- }
- }
- });
-
- smallerButton.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- switch(profilePic.getPresetSize()) {
- case ProfilePictureView.LARGE:
- switchToPresetSize(ProfilePictureView.NORMAL);
- break;
- case ProfilePictureView.NORMAL:
- switchToPresetSize(ProfilePictureView.SMALL);
- break;
- }
- }
- });
-
- largerButton.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- switch(profilePic.getPresetSize()) {
- case ProfilePictureView.NORMAL:
- switchToPresetSize(ProfilePictureView.LARGE);
- break;
- case ProfilePictureView.SMALL:
- switchToPresetSize(ProfilePictureView.NORMAL);
- break;
- }
- }
- });
-
- // We will fetch a new image for each change in the SeekBar. So keeping the count low
- // to prevent too much network chatter. SeekBar reports 0-max, so we will get max+1
- // notifications of change.
- customSizeView.setMax(MAX_CUSTOM_SIZES);
- customSizeView.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
- @Override
- public void onProgressChanged(SeekBar seekBar, int i, boolean b) {
- updateProfilePicForCustomSizeIncrement(i);
- }
-
- @Override
- public void onStartTrackingTouch(SeekBar seekBar) {
- // NO-OP
- }
-
- @Override
- public void onStopTrackingTouch(SeekBar seekBar) {
- // NO-OP
- }
- });
-
- restoreState(savedInstanceState);
-
- return fragmentView;
- }
-
- @Override
- public void onSaveInstanceState(Bundle outState) {
- super.onSaveInstanceState(outState);
-
- // Store the size type since we will use that to switch the Fragment's UI
- // between CUSTOM & PRESET modes
- // Other state (userId & isCropped) will be saved/restored directly by
- // ProfilePictureView
- outState.putInt(PICTURE_SIZE_TYPE_KEY, pictureSizeType);
- }
-
- private void restoreState(Bundle savedInstanceState) {
- if (savedInstanceState != null) {
- // Is we have saved state, restore the Fragment to it.
- // UserId & isCropped will be restored directly by ProfilePictureView
- pictureSizeType = savedInstanceState.getInt(
- PICTURE_SIZE_TYPE_KEY, ProfilePictureView.LARGE);
-
- if (pictureSizeType == ProfilePictureView.CUSTOM) {
- switchToCustomSize();
- } else {
- switchToPresetSize(pictureSizeType);
- }
- } else {
- // No saved state. Let's go to a default state
- switchToPresetSize(ProfilePictureView.LARGE);
- profilePic.setCropped(cropToggle.isChecked());
-
- // Setting userId last so that only one network request is sent
- profilePic.setProfileId(firstUserId);
- }
- }
-
- private void setupUserButton(Button b) {
- b.setOnClickListener(new Button.OnClickListener() {
- @Override
- public void onClick(View v) {
- Object tag = v.getTag();
- String userId = null;
- if (tag != null) {
- userId = tag.toString();
- } else {
- // Random id.
- userId = INTERESTING_IDS[randomGenerator.nextInt(INTERESTING_IDS.length)];
- }
- profilePic.setProfileId(userId);
- }
- });
- }
-
- private void switchToCustomSize() {
- pictureSizeType = ProfilePictureView.CUSTOM;
- presetSizeView.setVisibility(View.GONE);
- customSizeView.setVisibility(View.VISIBLE);
-
- profilePic.setPresetSize(pictureSizeType);
-
- customSizeView.setProgress(DEFAULT_SIZE_INCREMENT);
- updateProfilePicForCustomSizeIncrement(DEFAULT_SIZE_INCREMENT);
- }
-
- private void switchToPresetSize(int sizeType) {
- customSizeView.setVisibility(View.GONE);
- presetSizeView.setVisibility(View.VISIBLE);
-
- switch(sizeType) {
- case ProfilePictureView.SMALL:
- largerButton.setEnabled(true);
- smallerButton.setEnabled(false);
- sizeLabel.setText(R.string.small_image_size);
- pictureSizeType = sizeType;
- break;
- case ProfilePictureView.NORMAL:
- largerButton.setEnabled(true);
- smallerButton.setEnabled(true);
- sizeLabel.setText(R.string.normal_image_size);
- pictureSizeType = sizeType;
- break;
- case ProfilePictureView.LARGE:
- default:
- largerButton.setEnabled(false);
- smallerButton.setEnabled(true);
- sizeLabel.setText(R.string.large_image_size);
- pictureSizeType = ProfilePictureView.LARGE;
- break;
- }
-
- LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
- 0,
- ViewGroup.LayoutParams.WRAP_CONTENT,
- 1
- );
-
- profilePic.setLayoutParams(params);
- profilePic.setPresetSize(pictureSizeType);
- }
-
- private void updateProfilePicForCustomSizeIncrement(int i) {
- if (pictureSizeType != ProfilePictureView.CUSTOM) {
- return;
- }
-
- // This will ensure a minimum size of 51x68 and will scale the image at
- // a ratio of 3:4 (w:h) as the SeekBar is moved.
- //
- // Completely arbitrary
- //
- // NOTE: The numbers are in dips.
- float width = (i * 21) + 51;
- float height = (i * 28) + 68;
-
- LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
- (int)(width * getResources().getDisplayMetrics().density),
- (int)(height * getResources().getDisplayMetrics().density));
- profilePic.setLayoutParams(params);
- }
-}
diff --git a/facebook/samples/Scrumptious/.classpath b/facebook/samples/Scrumptious/.classpath
deleted file mode 100644
index 655a4a827..000000000
--- a/facebook/samples/Scrumptious/.classpath
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/Scrumptious/.project b/facebook/samples/Scrumptious/.project
deleted file mode 100644
index dfb9212a3..000000000
--- a/facebook/samples/Scrumptious/.project
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
- Scrumptious
-
-
-
-
-
- com.android.ide.eclipse.adt.ResourceManagerBuilder
-
-
-
-
- com.android.ide.eclipse.adt.PreCompilerBuilder
-
-
-
-
- org.eclipse.jdt.core.javabuilder
-
-
-
-
- com.android.ide.eclipse.adt.ApkBuilder
-
-
-
-
-
- com.android.ide.eclipse.adt.AndroidNature
- org.eclipse.jdt.core.javanature
-
-
diff --git a/facebook/samples/Scrumptious/AndroidManifest.xml b/facebook/samples/Scrumptious/AndroidManifest.xml
deleted file mode 100644
index ac9de56bc..000000000
--- a/facebook/samples/Scrumptious/AndroidManifest.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/Scrumptious/ant.properties b/facebook/samples/Scrumptious/ant.properties
deleted file mode 100644
index 939105d52..000000000
--- a/facebook/samples/Scrumptious/ant.properties
+++ /dev/null
@@ -1,18 +0,0 @@
-# This file is used to override default values used by the Ant build system.
-#
-# This file must be checked into Version Control Systems, as it is
-# integral to the build system of your project.
-
-# This file is only used by the Ant script.
-
-# You can use this to override default values such as
-# 'source.dir' for the location of your java source folder and
-# 'out.dir' for the location of your output folder.
-
-# You can also use it define how the release builds are signed by declaring
-# the following properties:
-# 'key.store' for the location of your keystore and
-# 'key.alias' for the name of the key to use.
-# The password will be asked during the build when you use the 'release' target.
-
-java.compilerargs=-Xlint -Werror
diff --git a/facebook/samples/Scrumptious/build.xml b/facebook/samples/Scrumptious/build.xml
deleted file mode 100644
index 7f943468f..000000000
--- a/facebook/samples/Scrumptious/build.xml
+++ /dev/null
@@ -1,92 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/Scrumptious/proguard-project.txt b/facebook/samples/Scrumptious/proguard-project.txt
deleted file mode 100644
index f2fe1559a..000000000
--- a/facebook/samples/Scrumptious/proguard-project.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-# To enable ProGuard in your project, edit project.properties
-# to define the proguard.config property as described in that file.
-#
-# Add project specific ProGuard rules here.
-# By default, the flags in this file are appended to flags specified
-# in ${sdk.dir}/tools/proguard/proguard-android.txt
-# You can edit the include path and order by changing the ProGuard
-# include property in project.properties.
-#
-# For more details, see
-# http://developer.android.com/guide/developing/tools/proguard.html
-
-# Add any project specific keep options here:
-
-# If your project uses WebView with JS, uncomment the following
-# and specify the fully qualified class name to the JavaScript interface
-# class:
-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
-# public *;
-#}
diff --git a/facebook/samples/Scrumptious/project.properties b/facebook/samples/Scrumptious/project.properties
deleted file mode 100644
index cee0509c6..000000000
--- a/facebook/samples/Scrumptious/project.properties
+++ /dev/null
@@ -1,15 +0,0 @@
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-#
-# This file must be checked in Version Control Systems.
-#
-# To customize properties used by the Ant build system edit
-# "ant.properties", and override values to adapt the script to your
-# project structure.
-#
-# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
-#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
-
-# Project target.
-target=android-8
-android.library.reference.1=../../facebook
diff --git a/facebook/samples/Scrumptious/res/drawable-hdpi/icon.png b/facebook/samples/Scrumptious/res/drawable-hdpi/icon.png
deleted file mode 100644
index 0320aeb54..000000000
Binary files a/facebook/samples/Scrumptious/res/drawable-hdpi/icon.png and /dev/null differ
diff --git a/facebook/samples/Scrumptious/res/drawable-mdpi/icon.png b/facebook/samples/Scrumptious/res/drawable-mdpi/icon.png
deleted file mode 100644
index 5c4b0095f..000000000
Binary files a/facebook/samples/Scrumptious/res/drawable-mdpi/icon.png and /dev/null differ
diff --git a/facebook/samples/Scrumptious/res/drawable-xhdpi/icon.png b/facebook/samples/Scrumptious/res/drawable-xhdpi/icon.png
deleted file mode 100644
index 796e14ec2..000000000
Binary files a/facebook/samples/Scrumptious/res/drawable-xhdpi/icon.png and /dev/null differ
diff --git a/facebook/samples/Scrumptious/res/drawable/action_eating.png b/facebook/samples/Scrumptious/res/drawable/action_eating.png
deleted file mode 100644
index 7b951edf0..000000000
Binary files a/facebook/samples/Scrumptious/res/drawable/action_eating.png and /dev/null differ
diff --git a/facebook/samples/Scrumptious/res/drawable/action_location.png b/facebook/samples/Scrumptious/res/drawable/action_location.png
deleted file mode 100644
index 13dfe86ff..000000000
Binary files a/facebook/samples/Scrumptious/res/drawable/action_location.png and /dev/null differ
diff --git a/facebook/samples/Scrumptious/res/drawable/action_people.png b/facebook/samples/Scrumptious/res/drawable/action_people.png
deleted file mode 100644
index 19546267c..000000000
Binary files a/facebook/samples/Scrumptious/res/drawable/action_people.png and /dev/null differ
diff --git a/facebook/samples/Scrumptious/res/drawable/button_border.xml b/facebook/samples/Scrumptious/res/drawable/button_border.xml
deleted file mode 100644
index 96c32725f..000000000
--- a/facebook/samples/Scrumptious/res/drawable/button_border.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/Scrumptious/res/drawable/facebook.png b/facebook/samples/Scrumptious/res/drawable/facebook.png
deleted file mode 100755
index daf8097b1..000000000
Binary files a/facebook/samples/Scrumptious/res/drawable/facebook.png and /dev/null differ
diff --git a/facebook/samples/Scrumptious/res/drawable/icon.png b/facebook/samples/Scrumptious/res/drawable/icon.png
deleted file mode 100644
index 5c4b0095f..000000000
Binary files a/facebook/samples/Scrumptious/res/drawable/icon.png and /dev/null differ
diff --git a/facebook/samples/Scrumptious/res/layout/listitem.xml b/facebook/samples/Scrumptious/res/layout/listitem.xml
deleted file mode 100644
index 2aa461efe..000000000
--- a/facebook/samples/Scrumptious/res/layout/listitem.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/Scrumptious/res/layout/main.xml b/facebook/samples/Scrumptious/res/layout/main.xml
deleted file mode 100644
index 9c93f3521..000000000
--- a/facebook/samples/Scrumptious/res/layout/main.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/Scrumptious/res/layout/pickers.xml b/facebook/samples/Scrumptious/res/layout/pickers.xml
deleted file mode 100644
index 137b5cbbe..000000000
--- a/facebook/samples/Scrumptious/res/layout/pickers.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-
-
-
-
diff --git a/facebook/samples/Scrumptious/res/layout/selection.xml b/facebook/samples/Scrumptious/res/layout/selection.xml
deleted file mode 100644
index 2d849837e..000000000
--- a/facebook/samples/Scrumptious/res/layout/selection.xml
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/Scrumptious/res/layout/splash.xml b/facebook/samples/Scrumptious/res/layout/splash.xml
deleted file mode 100644
index a9d43f639..000000000
--- a/facebook/samples/Scrumptious/res/layout/splash.xml
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/Scrumptious/res/values/strings.xml b/facebook/samples/Scrumptious/res/values/strings.xml
deleted file mode 100644
index bd35bc311..000000000
--- a/facebook/samples/Scrumptious/res/values/strings.xml
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-
-
- Scrumptious
- 233936543368280
- To get started, login using Facebook
- What are you eating?
- Where are you?
- With whom?
- Select a meal
- Select a place
- Select friends
- Announce
- Login
- Settings
- Select a meal
- Result
- Thanks!
- Posted Open Graph action, id: %1$s
- Announcing, please wait...
- %1$s
- %1$s and %2$s
- %1$s and %2$s others
- Error
- OK
- No response from server.
- Could not obtain your current location
- Select Picture
- An error occurred that requires your attention. %1$s
- An error occurred, please re-login.
- Please allow us to post on your behalf.
- The server is busy, please retry later.
- An error occurred, please contact the developer with the following message: %1$s
- An unknown error occurred, please contact the developer with the following message: %1$s
-
-
- - Cheeseburger
- - Pizza
- - Hotdog
- - Italian
- - French
- - Chinese
- - Thai
- - Indian
-
-
-
- - http://samples.ogp.me/314483151980285
- - http://samples.ogp.me/314483221980278
- - http://samples.ogp.me/314483265313607
- - http://samples.ogp.me/314483348646932
- - http://samples.ogp.me/314483375313596
- - http://samples.ogp.me/314483421980258
- - http://samples.ogp.me/314483451980255
- - http://samples.ogp.me/314483491980251
-
-
diff --git a/facebook/samples/Scrumptious/src/com/facebook/scrumptious/BaseListElement.java b/facebook/samples/Scrumptious/src/com/facebook/scrumptious/BaseListElement.java
deleted file mode 100644
index 13de99f44..000000000
--- a/facebook/samples/Scrumptious/src/com/facebook/scrumptious/BaseListElement.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/**
- * Copyright 2012 Facebook
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.facebook.scrumptious;
-
-import android.content.Intent;
-import android.graphics.drawable.Drawable;
-import android.os.Bundle;
-import android.view.View;
-import android.widget.BaseAdapter;
-import com.facebook.model.OpenGraphAction;
-
-/**
- * Base class for a list element in the Scrumptious main display, consisting of an
- * icon to the left, and a two line display to the right.
- */
-public abstract class BaseListElement {
-
- private Drawable icon;
- private String text1;
- private String text2;
- private BaseAdapter adapter;
- private int requestCode;
-
- /**
- * Constructs a new list element.
- *
- * @param icon the drawable for the icon
- * @param text1 the first row of text
- * @param text2 the second row of text
- * @param requestCode the requestCode to start new Activities with
- */
- public BaseListElement(Drawable icon, String text1, String text2, int requestCode) {
- this.icon = icon;
- this.text1 = text1;
- this.text2 = text2;
- this.requestCode = requestCode;
- }
-
- /**
- * The Adapter associated with this list element (used for notifying that the
- * underlying dataset has changed).
- * @param adapter the adapter associated with this element
- */
- public void setAdapter(BaseAdapter adapter) {
- this.adapter = adapter;
- }
-
- /**
- * Returns the icon.
- *
- * @return the icon
- */
- public Drawable getIcon() {
- return icon;
- }
-
- /**
- * Returns the first row of text.
- *
- * @return the first row of text
- */
- public String getText1() {
- return text1;
- }
-
- /**
- * Returns the second row of text.
- *
- * @return the second row of text
- */
- public String getText2() {
- return text2;
- }
-
- /**
- * Returns the requestCode for starting new Activities.
- *
- * @return the requestCode
- */
- public int getRequestCode() {
- return requestCode;
- }
-
- /**
- * Sets the first row of text.
- *
- * @param text1 text to set on the first row
- */
- public void setText1(String text1) {
- this.text1 = text1;
- if (adapter != null) {
- adapter.notifyDataSetChanged();
- }
- }
-
- /**
- * Sets the second row of text.
- *
- * @param text2 text to set on the second row
- */
- public void setText2(String text2) {
- this.text2 = text2;
- if (adapter != null) {
- adapter.notifyDataSetChanged();
- }
- }
-
- /**
- * Returns the OnClickListener associated with this list element. To be
- * overridden by the subclasses.
- *
- * @return the OnClickListener associated with this list element
- */
- protected abstract View.OnClickListener getOnClickListener();
-
- /**
- * Populate an OpenGraphAction with the results of this list element.
- *
- * @param action the action to populate with data
- */
- protected abstract void populateOGAction(OpenGraphAction action);
-
- /**
- * Callback if the OnClickListener happens to launch a new Activity.
- *
- * @param data the data associated with the result
- */
- protected void onActivityResult(Intent data) {}
-
- /**
- * Save the state of the current element.
- *
- * @param bundle the bundle to save to
- */
- protected void onSaveInstanceState(Bundle bundle) {}
-
- /**
- * Restore the state from the saved bundle. Returns true if the
- * state was restored.
- *
- * @param savedState the bundle to restore from
- * @return true if state was restored
- */
- protected boolean restoreState(Bundle savedState) {
- return false;
- }
-
- /**
- * Notifies the associated Adapter that the underlying data has changed,
- * and to re-layout the view.
- */
- protected void notifyDataChanged() {
- adapter.notifyDataSetChanged();
- }
-
-}
diff --git a/facebook/samples/Scrumptious/src/com/facebook/scrumptious/FullListView.java b/facebook/samples/Scrumptious/src/com/facebook/scrumptious/FullListView.java
deleted file mode 100644
index a210f09fb..000000000
--- a/facebook/samples/Scrumptious/src/com/facebook/scrumptious/FullListView.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/**
- * Copyright 2012 Facebook
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.facebook.scrumptious;
-
-import android.content.Context;
-import android.graphics.Rect;
-import android.util.AttributeSet;
-import android.view.View;
-import android.widget.ListAdapter;
-import android.widget.ListView;
-
-/**
- * A subclass of ListView that will always show the full list of elements.
- * This allows a ListView to be embedded inside a ScrollView.
- */
-public class FullListView extends ListView {
-
- public FullListView(Context context) {
- super(context);
- }
-
- public FullListView(Context context, AttributeSet attributeSet) {
- super(context, attributeSet);
- }
-
- public FullListView(Context context, AttributeSet attributeSet, int defStyle) {
- super(context, attributeSet, defStyle);
- }
-
- @Override
- protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
- super.onMeasure(widthMeasureSpec, heightMeasureSpec);
- int width = getMeasuredWidth();
- int height = 0;
- ListAdapter adapter = getAdapter();
- int count = adapter.getCount();
- for (int i = 0; i < count; i++) {
- View childView = adapter.getView(i, null, this);
- childView.measure(MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED),
- MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));
- height += childView.getMeasuredHeight();
- }
- Rect bgPadding = new Rect();
- getBackground().getPadding(bgPadding);
- height += (count - 1) * getDividerHeight() + bgPadding.top + bgPadding.bottom;
- setMeasuredDimension(width, height);
- }
-}
diff --git a/facebook/samples/Scrumptious/src/com/facebook/scrumptious/MainActivity.java b/facebook/samples/Scrumptious/src/com/facebook/scrumptious/MainActivity.java
deleted file mode 100644
index a9934df92..000000000
--- a/facebook/samples/Scrumptious/src/com/facebook/scrumptious/MainActivity.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/**
- * Copyright 2012 Facebook
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.facebook.scrumptious;
-
-import android.content.Intent;
-import android.os.Bundle;
-import android.support.v4.app.Fragment;
-import android.support.v4.app.FragmentActivity;
-import android.support.v4.app.FragmentManager;
-import android.support.v4.app.FragmentTransaction;
-import android.view.Menu;
-import android.view.MenuItem;
-import com.facebook.Session;
-import com.facebook.SessionState;
-import com.facebook.UiLifecycleHelper;
-
-public class MainActivity extends FragmentActivity {
-
- private static final int SPLASH = 0;
- private static final int SELECTION = 1;
- private static final int SETTINGS = 2;
- private static final int FRAGMENT_COUNT = SETTINGS +1;
-
- private Fragment[] fragments = new Fragment[FRAGMENT_COUNT];
- private MenuItem settings;
- private boolean isResumed = false;
- private UiLifecycleHelper uiHelper;
- private Session.StatusCallback callback = new Session.StatusCallback() {
- @Override
- public void call(Session session, SessionState state, Exception exception) {
- onSessionStateChange(session, state, exception);
- }
- };
-
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- uiHelper = new UiLifecycleHelper(this, callback);
- uiHelper.onCreate(savedInstanceState);
-
- setContentView(R.layout.main);
-
- FragmentManager fm = getSupportFragmentManager();
- fragments[SPLASH] = fm.findFragmentById(R.id.splashFragment);
- fragments[SELECTION] = fm.findFragmentById(R.id.selectionFragment);
- fragments[SETTINGS] = fm.findFragmentById(R.id.userSettingsFragment);
-
- FragmentTransaction transaction = fm.beginTransaction();
- for(int i = 0; i < fragments.length; i++) {
- transaction.hide(fragments[i]);
- }
- transaction.commit();
- }
-
- @Override
- public void onResume() {
- super.onResume();
- uiHelper.onResume();
- isResumed = true;
- }
-
- @Override
- public void onPause() {
- super.onPause();
- uiHelper.onPause();
- isResumed = false;
- }
-
- @Override
- public void onActivityResult(int requestCode, int resultCode, Intent data) {
- super.onActivityResult(requestCode, resultCode, data);
- uiHelper.onActivityResult(requestCode, resultCode, data);
- }
-
- @Override
- public void onDestroy() {
- super.onDestroy();
- uiHelper.onDestroy();
- }
-
- @Override
- protected void onSaveInstanceState(Bundle outState) {
- super.onSaveInstanceState(outState);
- uiHelper.onSaveInstanceState(outState);
- }
-
- @Override
- protected void onResumeFragments() {
- super.onResumeFragments();
- Session session = Session.getActiveSession();
-
- if (session != null && session.isOpened()) {
- // if the session is already open, try to show the selection fragment
- showFragment(SELECTION, false);
- } else {
- // otherwise present the splash screen and ask the user to login.
- showFragment(SPLASH, false);
- }
- }
-
- @Override
- public boolean onPrepareOptionsMenu(Menu menu) {
- // only add the menu when the selection fragment is showing
- if (fragments[SELECTION].isVisible()) {
- if (menu.size() == 0) {
- settings = menu.add(R.string.settings);
- }
- return true;
- } else {
- menu.clear();
- settings = null;
- }
- return false;
- }
-
- @Override
- public boolean onOptionsItemSelected(MenuItem item) {
- if (item.equals(settings)) {
- showFragment(SETTINGS, true);
- return true;
- }
- return false;
- }
-
- private void onSessionStateChange(Session session, SessionState state, Exception exception) {
- if (isResumed) {
- FragmentManager manager = getSupportFragmentManager();
- int backStackSize = manager.getBackStackEntryCount();
- for (int i = 0; i < backStackSize; i++) {
- manager.popBackStack();
- }
- // check for the OPENED state instead of session.isOpened() since for the
- // OPENED_TOKEN_UPDATED state, the selection fragment should already be showing.
- if (state.equals(SessionState.OPENED)) {
- showFragment(SELECTION, false);
- } else if (state.isClosed()) {
- showFragment(SPLASH, false);
- }
- }
- }
-
- private void showFragment(int fragmentIndex, boolean addToBackStack) {
- FragmentManager fm = getSupportFragmentManager();
- FragmentTransaction transaction = fm.beginTransaction();
- for (int i = 0; i < fragments.length; i++) {
- if (i == fragmentIndex) {
- transaction.show(fragments[i]);
- } else {
- transaction.hide(fragments[i]);
- }
- }
- if (addToBackStack) {
- transaction.addToBackStack(null);
- }
- transaction.commit();
- }
-}
diff --git a/facebook/samples/Scrumptious/src/com/facebook/scrumptious/PickerActivity.java b/facebook/samples/Scrumptious/src/com/facebook/scrumptious/PickerActivity.java
deleted file mode 100644
index 41a81894e..000000000
--- a/facebook/samples/Scrumptious/src/com/facebook/scrumptious/PickerActivity.java
+++ /dev/null
@@ -1,233 +0,0 @@
-/**
- * Copyright 2012 Facebook
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.facebook.scrumptious;
-
-import android.app.AlertDialog;
-import android.content.Context;
-import android.content.DialogInterface;
-import android.location.Criteria;
-import android.location.Location;
-import android.location.LocationListener;
-import android.location.LocationManager;
-import android.net.Uri;
-import android.os.Build;
-import android.os.Bundle;
-import android.os.Looper;
-import android.support.v4.app.Fragment;
-import android.support.v4.app.FragmentActivity;
-import android.support.v4.app.FragmentManager;
-import com.facebook.FacebookException;
-import com.facebook.widget.FriendPickerFragment;
-import com.facebook.widget.PickerFragment;
-import com.facebook.widget.PlacePickerFragment;
-
-/**
- * The PickerActivity enhances the Friend or Place Picker by adding a title
- * and a Done button. The selection results are saved in the ScrumptiousApplication
- * instance.
- */
-public class PickerActivity extends FragmentActivity {
- public static final Uri FRIEND_PICKER = Uri.parse("picker://friend");
- public static final Uri PLACE_PICKER = Uri.parse("picker://place");
-
- private static final int SEARCH_RADIUS_METERS = 1000;
- private static final int SEARCH_RESULT_LIMIT = 50;
- private static final String SEARCH_TEXT = "Restaurant";
- private static final int LOCATION_CHANGE_THRESHOLD = 50; // meters
-
- private static final Location SAN_FRANCISCO_LOCATION = new Location("") {{
- setLatitude(37.7750);
- setLongitude(-122.4183);
- }};
-
- private FriendPickerFragment friendPickerFragment;
- private PlacePickerFragment placePickerFragment;
- private LocationListener locationListener;
-
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.pickers);
-
- Bundle args = getIntent().getExtras();
- FragmentManager manager = getSupportFragmentManager();
- Fragment fragmentToShow = null;
- Uri intentUri = getIntent().getData();
-
- if (FRIEND_PICKER.equals(intentUri)) {
- if (savedInstanceState == null) {
- friendPickerFragment = new FriendPickerFragment(args);
- } else {
- friendPickerFragment = (FriendPickerFragment) manager.findFragmentById(R.id.picker_fragment);;
- }
-
- friendPickerFragment.setOnErrorListener(new PickerFragment.OnErrorListener() {
- @Override
- public void onError(PickerFragment> fragment, FacebookException error) {
- PickerActivity.this.onError(error);
- }
- });
- friendPickerFragment.setOnDoneButtonClickedListener(new PickerFragment.OnDoneButtonClickedListener() {
- @Override
- public void onDoneButtonClicked(PickerFragment> fragment) {
- finishActivity();
- }
- });
- fragmentToShow = friendPickerFragment;
-
- } else if (PLACE_PICKER.equals(intentUri)) {
- if (savedInstanceState == null) {
- placePickerFragment = new PlacePickerFragment(args);
- } else {
- placePickerFragment = (PlacePickerFragment) manager.findFragmentById(R.id.picker_fragment);
- }
- placePickerFragment.setOnSelectionChangedListener(new PickerFragment.OnSelectionChangedListener() {
- @Override
- public void onSelectionChanged(PickerFragment> fragment) {
- finishActivity(); // call finish since you can only pick one place
- }
- });
- placePickerFragment.setOnErrorListener(new PickerFragment.OnErrorListener() {
- @Override
- public void onError(PickerFragment> fragment, FacebookException error) {
- PickerActivity.this.onError(error);
- }
- });
- placePickerFragment.setOnDoneButtonClickedListener(new PickerFragment.OnDoneButtonClickedListener() {
- @Override
- public void onDoneButtonClicked(PickerFragment> fragment) {
- finishActivity();
- }
- });
- fragmentToShow = placePickerFragment;
- } else {
- // Nothing to do, finish
- setResult(RESULT_CANCELED);
- finish();
- return;
- }
-
- manager.beginTransaction().replace(R.id.picker_fragment, fragmentToShow).commit();
- }
-
- @Override
- protected void onStart() {
- super.onStart();
- if (FRIEND_PICKER.equals(getIntent().getData())) {
- try {
- friendPickerFragment.loadData(false);
- } catch (Exception ex) {
- onError(ex);
- }
- } else if (PLACE_PICKER.equals(getIntent().getData())) {
- try {
- Location location = null;
- Criteria criteria = new Criteria();
- LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
- String bestProvider = locationManager.getBestProvider(criteria, false);
- if (bestProvider != null) {
- location = locationManager.getLastKnownLocation(bestProvider);
- if (locationManager.isProviderEnabled(bestProvider) && locationListener == null) {
- locationListener = new LocationListener() {
- @Override
- public void onLocationChanged(Location location) {
- float distance = location.distanceTo(placePickerFragment.getLocation());
- if (distance >= LOCATION_CHANGE_THRESHOLD) {
- placePickerFragment.setLocation(location);
- placePickerFragment.loadData(true);
- }
- }
- @Override
- public void onStatusChanged(String s, int i, Bundle bundle) {
- }
- @Override
- public void onProviderEnabled(String s) {
- }
- @Override
- public void onProviderDisabled(String s) {
- }
- };
- locationManager.requestLocationUpdates(bestProvider, 1, LOCATION_CHANGE_THRESHOLD,
- locationListener, Looper.getMainLooper());
- }
- }
- if (location == null) {
- String model = Build.MODEL;
- if (model.equals("sdk") || model.equals("google_sdk") || model.contains("x86")) {
- // this may be the emulator, pretend we're in an exotic place
- location = SAN_FRANCISCO_LOCATION;
- }
- }
- if (location != null) {
- placePickerFragment.setLocation(location);
- placePickerFragment.setRadiusInMeters(SEARCH_RADIUS_METERS);
- placePickerFragment.setSearchText(SEARCH_TEXT);
- placePickerFragment.setResultsLimit(SEARCH_RESULT_LIMIT);
- placePickerFragment.loadData(false);
- } else {
- onError(getResources().getString(R.string.no_location_error), true);
- }
- } catch (Exception ex) {
- onError(ex);
- }
- }
- }
-
- @Override
- protected void onStop() {
- super.onStop();
- if (locationListener != null) {
- LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
- locationManager.removeUpdates(locationListener);
- locationListener = null;
- }
- }
-
- private void onError(Exception error) {
- onError(error.getLocalizedMessage(), false);
- }
-
- private void onError(String error, final boolean finishActivity) {
- AlertDialog.Builder builder = new AlertDialog.Builder(this);
- builder.setTitle(R.string.error_dialog_title).
- setMessage(error).
- setPositiveButton(R.string.error_dialog_button_text, new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialogInterface, int i) {
- if (finishActivity) {
- finishActivity();
- }
- }
- });
- builder.show();
- }
-
- private void finishActivity() {
- ScrumptiousApplication app = (ScrumptiousApplication) getApplication();
- if (FRIEND_PICKER.equals(getIntent().getData())) {
- if (friendPickerFragment != null) {
- app.setSelectedUsers(friendPickerFragment.getSelection());
- }
- } else if (PLACE_PICKER.equals(getIntent().getData())) {
- if (placePickerFragment != null) {
- app.setSelectedPlace(placePickerFragment.getSelection());
- }
- }
- setResult(RESULT_OK, null);
- finish();
- }
-}
diff --git a/facebook/samples/Scrumptious/src/com/facebook/scrumptious/ScrumptiousApplication.java b/facebook/samples/Scrumptious/src/com/facebook/scrumptious/ScrumptiousApplication.java
deleted file mode 100644
index 79e5857b0..000000000
--- a/facebook/samples/Scrumptious/src/com/facebook/scrumptious/ScrumptiousApplication.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * Copyright 2012 Facebook
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.facebook.scrumptious;
-
-import android.app.Application;
-import com.facebook.model.GraphPlace;
-import com.facebook.model.GraphUser;
-
-import java.util.List;
-
-/**
- * Use a custom Application class to pass state data between Activities.
- */
-public class ScrumptiousApplication extends Application {
-
- private List selectedUsers;
- private GraphPlace selectedPlace;
-
- public List getSelectedUsers() {
- return selectedUsers;
- }
-
- public void setSelectedUsers(List users) {
- selectedUsers = users;
- }
-
- public GraphPlace getSelectedPlace() {
- return selectedPlace;
- }
-
- public void setSelectedPlace(GraphPlace place) {
- this.selectedPlace = place;
- }
-}
diff --git a/facebook/samples/Scrumptious/src/com/facebook/scrumptious/SelectionFragment.java b/facebook/samples/Scrumptious/src/com/facebook/scrumptious/SelectionFragment.java
deleted file mode 100644
index 2a9b43672..000000000
--- a/facebook/samples/Scrumptious/src/com/facebook/scrumptious/SelectionFragment.java
+++ /dev/null
@@ -1,721 +0,0 @@
-/**
- * Copyright 2012 Facebook
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.facebook.scrumptious;
-
-import android.app.Activity;
-import android.app.AlertDialog;
-import android.app.ProgressDialog;
-import android.content.Context;
-import android.content.DialogInterface;
-import android.content.Intent;
-import android.net.Uri;
-import android.os.AsyncTask;
-import android.os.Bundle;
-import android.support.v4.app.Fragment;
-import android.util.Log;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.*;
-import com.facebook.*;
-import com.facebook.model.*;
-import com.facebook.widget.ProfilePictureView;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import java.io.*;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-/**
- * Fragment that represents the main selection screen for Scrumptious.
- */
-public class SelectionFragment extends Fragment {
-
- private static final String TAG = "SelectionFragment";
- private static final String POST_ACTION_PATH = "me/fb_sample_scrumps:eat";
- private static final String PENDING_ANNOUNCE_KEY = "pendingAnnounce";
- private static final Uri M_FACEBOOK_URL = Uri.parse("http://m.facebook.com");
-
- private static final int REAUTH_ACTIVITY_CODE = 100;
- private static final List PERMISSIONS = Arrays.asList("publish_actions");
-
- private Button announceButton;
- private ListView listView;
- private ProgressDialog progressDialog;
- private List listElements;
- private ProfilePictureView profilePictureView;
- private TextView userNameView;
- private boolean pendingAnnounce;
-
- private UiLifecycleHelper uiHelper;
- private Session.StatusCallback callback = new Session.StatusCallback() {
- @Override
- public void call(final Session session, final SessionState state, final Exception exception) {
- onSessionStateChange(session, state, exception);
- }
- };
-
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- uiHelper = new UiLifecycleHelper(getActivity(), callback);
- uiHelper.onCreate(savedInstanceState);
- }
-
- @Override
- public void onResume() {
- super.onResume();
- uiHelper.onResume();
- }
-
- @Override
- public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
- super.onCreateView(inflater, container, savedInstanceState);
- View view = inflater.inflate(R.layout.selection, container, false);
-
- profilePictureView = (ProfilePictureView) view.findViewById(R.id.selection_profile_pic);
- profilePictureView.setCropped(true);
- userNameView = (TextView) view.findViewById(R.id.selection_user_name);
- announceButton = (Button) view.findViewById(R.id.announce_button);
- listView = (ListView) view.findViewById(R.id.selection_list);
-
- announceButton.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- handleAnnounce();
- }
- });
- init(savedInstanceState);
-
- return view;
- }
-
- @Override
- public void onActivityResult(int requestCode, int resultCode, Intent data) {
- super.onActivityResult(requestCode, resultCode, data);
- if (requestCode == REAUTH_ACTIVITY_CODE) {
- uiHelper.onActivityResult(requestCode, resultCode, data);
- } else if (resultCode == Activity.RESULT_OK && requestCode >= 0 && requestCode < listElements.size()) {
- listElements.get(requestCode).onActivityResult(data);
- }
- }
-
- @Override
- public void onSaveInstanceState(Bundle bundle) {
- super.onSaveInstanceState(bundle);
- for (BaseListElement listElement : listElements) {
- listElement.onSaveInstanceState(bundle);
- }
- bundle.putBoolean(PENDING_ANNOUNCE_KEY, pendingAnnounce);
- uiHelper.onSaveInstanceState(bundle);
- }
-
- @Override
- public void onPause() {
- super.onPause();
- uiHelper.onPause();
- }
-
- @Override
- public void onDestroy() {
- super.onDestroy();
- uiHelper.onDestroy();
- }
-
- /**
- * Notifies that the session token has been updated.
- */
- private void tokenUpdated() {
- if (pendingAnnounce) {
- handleAnnounce();
- }
- }
-
- private void onSessionStateChange(final Session session, SessionState state, Exception exception) {
- if (session != null && session.isOpened()) {
- if (state.equals(SessionState.OPENED_TOKEN_UPDATED)) {
- tokenUpdated();
- } else {
- makeMeRequest(session);
- }
- }
- }
-
- private void makeMeRequest(final Session session) {
- Request request = Request.newMeRequest(session, new Request.GraphUserCallback() {
- @Override
- public void onCompleted(GraphUser user, Response response) {
- if (session == Session.getActiveSession()) {
- if (user != null) {
- profilePictureView.setProfileId(user.getId());
- userNameView.setText(user.getName());
- }
- }
- if (response.getError() != null) {
- handleError(response.getError());
- }
- }
- });
- request.executeAsync();
-
- }
-
- /**
- * Resets the view to the initial defaults.
- */
- private void init(Bundle savedInstanceState) {
- announceButton.setEnabled(false);
-
- listElements = new ArrayList();
-
- listElements.add(new EatListElement(0));
- listElements.add(new LocationListElement(1));
- listElements.add(new PeopleListElement(2));
-
- if (savedInstanceState != null) {
- for (BaseListElement listElement : listElements) {
- listElement.restoreState(savedInstanceState);
- }
- pendingAnnounce = savedInstanceState.getBoolean(PENDING_ANNOUNCE_KEY, false);
- }
-
- listView.setAdapter(new ActionListAdapter(getActivity(), R.id.selection_list, listElements));
-
- Session session = Session.getActiveSession();
- if (session != null && session.isOpened()) {
- makeMeRequest(session);
- }
- }
-
- private void handleAnnounce() {
- pendingAnnounce = false;
- Session session = Session.getActiveSession();
-
- if (session == null || !session.isOpened()) {
- return;
- }
-
- List permissions = session.getPermissions();
- if (!permissions.containsAll(PERMISSIONS)) {
- pendingAnnounce = true;
- requestPublishPermissions(session);
- return;
- }
-
- // Show a progress dialog because sometimes the requests can take a while.
- progressDialog = ProgressDialog.show(getActivity(), "",
- getActivity().getResources().getString(R.string.progress_dialog_text), true);
-
- // Run this in a background thread since some of the populate methods may take
- // a non-trivial amount of time.
- AsyncTask task = new AsyncTask() {
-
- @Override
- protected Response doInBackground(Void... voids) {
- EatAction eatAction = GraphObject.Factory.create(EatAction.class);
- for (BaseListElement element : listElements) {
- element.populateOGAction(eatAction);
- }
- Request request = new Request(Session.getActiveSession(),
- POST_ACTION_PATH, null, HttpMethod.POST);
- request.setGraphObject(eatAction);
- return request.executeAndWait();
- }
-
- @Override
- protected void onPostExecute(Response response) {
- onPostActionResponse(response);
- }
- };
-
- task.execute();
- }
-
- private void requestPublishPermissions(Session session) {
- if (session != null) {
- Session.NewPermissionsRequest newPermissionsRequest = new Session.NewPermissionsRequest(this, PERMISSIONS)
- // demonstrate how to set an audience for the publish permissions,
- // if none are set, this defaults to FRIENDS
- .setDefaultAudience(SessionDefaultAudience.FRIENDS)
- .setRequestCode(REAUTH_ACTIVITY_CODE);
- session.requestNewPublishPermissions(newPermissionsRequest);
- }
- }
-
- private void onPostActionResponse(Response response) {
- if (progressDialog != null) {
- progressDialog.dismiss();
- progressDialog = null;
- }
- if (getActivity() == null) {
- // if the user removes the app from the website, then a request will
- // have caused the session to close (since the token is no longer valid),
- // which means the splash fragment will be shown rather than this one,
- // causing activity to be null. If the activity is null, then we cannot
- // show any dialogs, so we return.
- return;
- }
-
- PostResponse postResponse = response.getGraphObjectAs(PostResponse.class);
-
- if (postResponse != null && postResponse.getId() != null) {
- String dialogBody = String.format(getString(R.string.result_dialog_text), postResponse.getId());
- new AlertDialog.Builder(getActivity())
- .setPositiveButton(R.string.result_dialog_button_text, null)
- .setTitle(R.string.result_dialog_title)
- .setMessage(dialogBody)
- .show();
- init(null);
- } else {
- handleError(response.getError());
- }
- }
-
- private void handleError(FacebookRequestError error) {
- DialogInterface.OnClickListener listener = null;
- String dialogBody = null;
-
- if (error == null) {
- dialogBody = getString(R.string.error_dialog_default_text);
- } else {
- switch (error.getCategory()) {
- case AUTHENTICATION_RETRY:
- // tell the user what happened by getting the message id, and
- // retry the operation later
- String userAction = (error.shouldNotifyUser()) ? "" :
- getString(error.getUserActionMessageId());
- dialogBody = getString(R.string.error_authentication_retry, userAction);
- listener = new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialogInterface, int i) {
- Intent intent = new Intent(Intent.ACTION_VIEW, M_FACEBOOK_URL);
- startActivity(intent);
- }
- };
- break;
-
- case AUTHENTICATION_REOPEN_SESSION:
- // close the session and reopen it.
- dialogBody = getString(R.string.error_authentication_reopen);
- listener = new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialogInterface, int i) {
- Session session = Session.getActiveSession();
- if (session != null && !session.isClosed()) {
- session.closeAndClearTokenInformation();
- }
- }
- };
- break;
-
- case PERMISSION:
- // request the publish permission
- dialogBody = getString(R.string.error_permission);
- listener = new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialogInterface, int i) {
- pendingAnnounce = true;
- requestPublishPermissions(Session.getActiveSession());
- }
- };
- break;
-
- case SERVER:
- case THROTTLING:
- // this is usually temporary, don't clear the fields, and
- // ask the user to try again
- dialogBody = getString(R.string.error_server);
- break;
-
- case BAD_REQUEST:
- // this is likely a coding error, ask the user to file a bug
- dialogBody = getString(R.string.error_bad_request, error.getErrorMessage());
- break;
-
- case OTHER:
- case CLIENT:
- default:
- // an unknown issue occurred, this could be a code error, or
- // a server side issue, log the issue, and either ask the
- // user to retry, or file a bug
- dialogBody = getString(R.string.error_unknown, error.getErrorMessage());
- break;
- }
- }
-
- new AlertDialog.Builder(getActivity())
- .setPositiveButton(R.string.error_dialog_button_text, listener)
- .setTitle(R.string.error_dialog_title)
- .setMessage(dialogBody)
- .show();
- }
-
- private void startPickerActivity(Uri data, int requestCode) {
- Intent intent = new Intent();
- intent.setData(data);
- intent.setClass(getActivity(), PickerActivity.class);
- startActivityForResult(intent, requestCode);
- }
-
- /**
- * Interface representing the Meal Open Graph object.
- */
- private interface MealGraphObject extends GraphObject {
- public String getUrl();
- public void setUrl(String url);
-
- public String getId();
- public void setId(String id);
- }
-
- /**
- * Interface representing the Eat action.
- */
- private interface EatAction extends OpenGraphAction {
- public MealGraphObject getMeal();
- public void setMeal(MealGraphObject meal);
- }
-
- /**
- * Used to inspect the response from posting an action
- */
- private interface PostResponse extends GraphObject {
- String getId();
- }
-
- private class EatListElement extends BaseListElement {
-
- private static final String FOOD_KEY = "food";
- private static final String FOOD_URL_KEY = "food_url";
-
- private final String[] foodChoices;
- private final String[] foodUrls;
- private String foodChoiceUrl = null;
- private String foodChoice = null;
-
- public EatListElement(int requestCode) {
- super(getActivity().getResources().getDrawable(R.drawable.action_eating),
- getActivity().getResources().getString(R.string.action_eating),
- getActivity().getResources().getString(R.string.action_eating_default),
- requestCode);
- foodChoices = getActivity().getResources().getStringArray(R.array.food_types);
- foodUrls = getActivity().getResources().getStringArray(R.array.food_og_urls);
- }
-
- @Override
- protected View.OnClickListener getOnClickListener() {
- return new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- showMealOptions();
- }
- };
- }
-
- @Override
- protected void populateOGAction(OpenGraphAction action) {
- if (foodChoiceUrl != null) {
- EatAction eatAction = action.cast(EatAction.class);
- MealGraphObject meal = GraphObject.Factory.create(MealGraphObject.class);
- meal.setUrl(foodChoiceUrl);
- eatAction.setMeal(meal);
- }
- }
-
- @Override
- protected void onSaveInstanceState(Bundle bundle) {
- if (foodChoice != null && foodChoiceUrl != null) {
- bundle.putString(FOOD_KEY, foodChoice);
- bundle.putString(FOOD_URL_KEY, foodChoiceUrl);
- }
- }
-
- @Override
- protected boolean restoreState(Bundle savedState) {
- String food = savedState.getString(FOOD_KEY);
- String foodUrl = savedState.getString(FOOD_URL_KEY);
- if (food != null && foodUrl != null) {
- foodChoice = food;
- foodChoiceUrl = foodUrl;
- setFoodText();
- return true;
- }
- return false;
- }
-
- private void showMealOptions() {
- String title = getActivity().getResources().getString(R.string.select_meal);
- AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
- builder.setTitle(title).
- setCancelable(true).
- setItems(foodChoices, new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialogInterface, int i) {
- foodChoice = foodChoices[i];
- foodChoiceUrl = foodUrls[i];
- setFoodText();
- notifyDataChanged();
- }
- });
- builder.show();
- }
-
- private void setFoodText() {
- if (foodChoice != null && foodChoiceUrl != null) {
- setText2(foodChoice);
- announceButton.setEnabled(true);
- } else {
- setText2(getActivity().getResources().getString(R.string.action_eating_default));
- announceButton.setEnabled(false);
- }
- }
- }
-
- private class PeopleListElement extends BaseListElement {
-
- private static final String FRIENDS_KEY = "friends";
-
- private List selectedUsers;
-
- public PeopleListElement(int requestCode) {
- super(getActivity().getResources().getDrawable(R.drawable.action_people),
- getActivity().getResources().getString(R.string.action_people),
- getActivity().getResources().getString(R.string.action_people_default),
- requestCode);
- }
-
- @Override
- protected View.OnClickListener getOnClickListener() {
- return new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- startPickerActivity(PickerActivity.FRIEND_PICKER, getRequestCode());
- }
- };
- }
-
- @Override
- protected void onActivityResult(Intent data) {
- selectedUsers = ((ScrumptiousApplication) getActivity().getApplication()).getSelectedUsers();
- setUsersText();
- notifyDataChanged();
- }
-
- @Override
- protected void populateOGAction(OpenGraphAction action) {
- if (selectedUsers != null) {
- action.setTags(selectedUsers);
- }
- }
-
- @Override
- protected void onSaveInstanceState(Bundle bundle) {
- if (selectedUsers != null) {
- bundle.putByteArray(FRIENDS_KEY, getByteArray(selectedUsers));
- }
- }
-
- @Override
- protected boolean restoreState(Bundle savedState) {
- byte[] bytes = savedState.getByteArray(FRIENDS_KEY);
- if (bytes != null) {
- selectedUsers = restoreByteArray(bytes);
- setUsersText();
- return true;
- }
- return false;
- }
-
- private void setUsersText() {
- String text = null;
- if (selectedUsers != null) {
- if (selectedUsers.size() == 1) {
- text = String.format(getResources().getString(R.string.single_user_selected),
- selectedUsers.get(0).getName());
- } else if (selectedUsers.size() == 2) {
- text = String.format(getResources().getString(R.string.two_users_selected),
- selectedUsers.get(0).getName(), selectedUsers.get(1).getName());
- } else if (selectedUsers.size() > 2) {
- text = String.format(getResources().getString(R.string.multiple_users_selected),
- selectedUsers.get(0).getName(), (selectedUsers.size() - 1));
- }
- }
- if (text == null) {
- text = getResources().getString(R.string.action_people_default);
- }
- setText2(text);
- }
-
- private byte[] getByteArray(List users) {
- // convert the list of GraphUsers to a list of String where each element is
- // the JSON representation of the GraphUser so it can be stored in a Bundle
- List usersAsString = new ArrayList(users.size());
-
- for (GraphUser user : users) {
- usersAsString.add(user.getInnerJSONObject().toString());
- }
- try {
- ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
- new ObjectOutputStream(outputStream).writeObject(usersAsString);
- return outputStream.toByteArray();
- } catch (IOException e) {
- Log.e(TAG, "Unable to serialize users.", e);
- }
- return null;
- }
-
- private List restoreByteArray(byte[] bytes) {
- try {
- @SuppressWarnings("unchecked")
- List usersAsString =
- (List) (new ObjectInputStream(new ByteArrayInputStream(bytes))).readObject();
- if (usersAsString != null) {
- List users = new ArrayList(usersAsString.size());
- for (String user : usersAsString) {
- GraphUser graphUser = GraphObject.Factory
- .create(new JSONObject(user), GraphUser.class);
- users.add(graphUser);
- }
- return users;
- }
- } catch (ClassNotFoundException e) {
- Log.e(TAG, "Unable to deserialize users.", e);
- } catch (IOException e) {
- Log.e(TAG, "Unable to deserialize users.", e);
- } catch (JSONException e) {
- Log.e(TAG, "Unable to deserialize users.", e);
- }
- return null;
- }
- }
-
- private class LocationListElement extends BaseListElement {
-
- private static final String PLACE_KEY = "place";
-
- private GraphPlace selectedPlace = null;
-
- public LocationListElement(int requestCode) {
- super(getActivity().getResources().getDrawable(R.drawable.action_location),
- getActivity().getResources().getString(R.string.action_location),
- getActivity().getResources().getString(R.string.action_location_default),
- requestCode);
- }
-
- @Override
- protected View.OnClickListener getOnClickListener() {
- return new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- startPickerActivity(PickerActivity.PLACE_PICKER, getRequestCode());
- }
- };
- }
-
- @Override
- protected void onActivityResult(Intent data) {
- selectedPlace = ((ScrumptiousApplication) getActivity().getApplication()).getSelectedPlace();
- setPlaceText();
- notifyDataChanged();
- }
-
- @Override
- protected void populateOGAction(OpenGraphAction action) {
- if (selectedPlace != null) {
- action.setPlace(selectedPlace);
- }
- }
-
- @Override
- protected void onSaveInstanceState(Bundle bundle) {
- if (selectedPlace != null) {
- bundle.putString(PLACE_KEY, selectedPlace.getInnerJSONObject().toString());
- }
- }
-
- @Override
- protected boolean restoreState(Bundle savedState) {
- String place = savedState.getString(PLACE_KEY);
- if (place != null) {
- try {
- selectedPlace = GraphObject.Factory
- .create(new JSONObject(place), GraphPlace.class);
- setPlaceText();
- return true;
- } catch (JSONException e) {
- Log.e(TAG, "Unable to deserialize place.", e);
- }
- }
- return false;
- }
-
- private void setPlaceText() {
- String text = null;
- if (selectedPlace != null) {
- text = selectedPlace.getName();
- }
- if (text == null) {
- text = getResources().getString(R.string.action_location_default);
- }
- setText2(text);
- }
-
- }
-
- private class ActionListAdapter extends ArrayAdapter {
- private List listElements;
-
- public ActionListAdapter(Context context, int resourceId, List listElements) {
- super(context, resourceId, listElements);
- this.listElements = listElements;
- for (int i = 0; i < listElements.size(); i++) {
- listElements.get(i).setAdapter(this);
- }
- }
-
- @Override
- public View getView(int position, View convertView, ViewGroup parent) {
- View view = convertView;
- if (view == null) {
- LayoutInflater inflater =
- (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
- view = inflater.inflate(R.layout.listitem, null);
- }
-
- BaseListElement listElement = listElements.get(position);
- if (listElement != null) {
- view.setOnClickListener(listElement.getOnClickListener());
- ImageView icon = (ImageView) view.findViewById(R.id.icon);
- TextView text1 = (TextView) view.findViewById(R.id.text1);
- TextView text2 = (TextView) view.findViewById(R.id.text2);
- if (icon != null) {
- icon.setImageDrawable(listElement.getIcon());
- }
- if (text1 != null) {
- text1.setText(listElement.getText1());
- }
- if (text2 != null) {
- text2.setText(listElement.getText2());
- }
- }
- return view;
- }
-
- }
-}
diff --git a/facebook/samples/Scrumptious/src/com/facebook/scrumptious/SplashFragment.java b/facebook/samples/Scrumptious/src/com/facebook/scrumptious/SplashFragment.java
deleted file mode 100644
index d75436d49..000000000
--- a/facebook/samples/Scrumptious/src/com/facebook/scrumptious/SplashFragment.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * Copyright 2012 Facebook
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.facebook.scrumptious;
-
-import android.os.Bundle;
-import android.support.v4.app.Fragment;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-
-public class SplashFragment extends Fragment {
- @Override
- public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
- View view = inflater.inflate(R.layout.splash, container, false);
- return view;
- }
-}
diff --git a/facebook/samples/SessionLoginSample/.classpath b/facebook/samples/SessionLoginSample/.classpath
deleted file mode 100644
index 655a4a827..000000000
--- a/facebook/samples/SessionLoginSample/.classpath
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/SessionLoginSample/.project b/facebook/samples/SessionLoginSample/.project
deleted file mode 100644
index d8c641423..000000000
--- a/facebook/samples/SessionLoginSample/.project
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
- SessionLoginSample
-
-
-
-
-
- com.android.ide.eclipse.adt.ResourceManagerBuilder
-
-
-
-
- com.android.ide.eclipse.adt.PreCompilerBuilder
-
-
-
-
- org.eclipse.jdt.core.javabuilder
-
-
-
-
- com.android.ide.eclipse.adt.ApkBuilder
-
-
-
-
-
- com.android.ide.eclipse.adt.AndroidNature
- org.eclipse.jdt.core.javanature
-
-
diff --git a/facebook/samples/SessionLoginSample/AndroidManifest.xml b/facebook/samples/SessionLoginSample/AndroidManifest.xml
deleted file mode 100644
index c1272829b..000000000
--- a/facebook/samples/SessionLoginSample/AndroidManifest.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/SessionLoginSample/ant.properties b/facebook/samples/SessionLoginSample/ant.properties
deleted file mode 100644
index 939105d52..000000000
--- a/facebook/samples/SessionLoginSample/ant.properties
+++ /dev/null
@@ -1,18 +0,0 @@
-# This file is used to override default values used by the Ant build system.
-#
-# This file must be checked into Version Control Systems, as it is
-# integral to the build system of your project.
-
-# This file is only used by the Ant script.
-
-# You can use this to override default values such as
-# 'source.dir' for the location of your java source folder and
-# 'out.dir' for the location of your output folder.
-
-# You can also use it define how the release builds are signed by declaring
-# the following properties:
-# 'key.store' for the location of your keystore and
-# 'key.alias' for the name of the key to use.
-# The password will be asked during the build when you use the 'release' target.
-
-java.compilerargs=-Xlint -Werror
diff --git a/facebook/samples/SessionLoginSample/build.xml b/facebook/samples/SessionLoginSample/build.xml
deleted file mode 100644
index 4f044bbee..000000000
--- a/facebook/samples/SessionLoginSample/build.xml
+++ /dev/null
@@ -1,92 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/SessionLoginSample/proguard-project.txt b/facebook/samples/SessionLoginSample/proguard-project.txt
deleted file mode 100644
index f2fe1559a..000000000
--- a/facebook/samples/SessionLoginSample/proguard-project.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-# To enable ProGuard in your project, edit project.properties
-# to define the proguard.config property as described in that file.
-#
-# Add project specific ProGuard rules here.
-# By default, the flags in this file are appended to flags specified
-# in ${sdk.dir}/tools/proguard/proguard-android.txt
-# You can edit the include path and order by changing the ProGuard
-# include property in project.properties.
-#
-# For more details, see
-# http://developer.android.com/guide/developing/tools/proguard.html
-
-# Add any project specific keep options here:
-
-# If your project uses WebView with JS, uncomment the following
-# and specify the fully qualified class name to the JavaScript interface
-# class:
-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
-# public *;
-#}
diff --git a/facebook/samples/SessionLoginSample/project.properties b/facebook/samples/SessionLoginSample/project.properties
deleted file mode 100644
index cee0509c6..000000000
--- a/facebook/samples/SessionLoginSample/project.properties
+++ /dev/null
@@ -1,15 +0,0 @@
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-#
-# This file must be checked in Version Control Systems.
-#
-# To customize properties used by the Ant build system edit
-# "ant.properties", and override values to adapt the script to your
-# project structure.
-#
-# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
-#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
-
-# Project target.
-target=android-8
-android.library.reference.1=../../facebook
diff --git a/facebook/samples/SessionLoginSample/res/drawable-hdpi/icon.png b/facebook/samples/SessionLoginSample/res/drawable-hdpi/icon.png
deleted file mode 100644
index 78d41ad5f..000000000
Binary files a/facebook/samples/SessionLoginSample/res/drawable-hdpi/icon.png and /dev/null differ
diff --git a/facebook/samples/SessionLoginSample/res/drawable-mdpi/icon.png b/facebook/samples/SessionLoginSample/res/drawable-mdpi/icon.png
deleted file mode 100644
index 22598aa33..000000000
Binary files a/facebook/samples/SessionLoginSample/res/drawable-mdpi/icon.png and /dev/null differ
diff --git a/facebook/samples/SessionLoginSample/res/drawable-xhdpi/icon.png b/facebook/samples/SessionLoginSample/res/drawable-xhdpi/icon.png
deleted file mode 100644
index a2c3cb4b2..000000000
Binary files a/facebook/samples/SessionLoginSample/res/drawable-xhdpi/icon.png and /dev/null differ
diff --git a/facebook/samples/SessionLoginSample/res/drawable/icon.png b/facebook/samples/SessionLoginSample/res/drawable/icon.png
deleted file mode 100644
index 22598aa33..000000000
Binary files a/facebook/samples/SessionLoginSample/res/drawable/icon.png and /dev/null differ
diff --git a/facebook/samples/SessionLoginSample/res/layout/activity.xml b/facebook/samples/SessionLoginSample/res/layout/activity.xml
deleted file mode 100644
index acc8c45c2..000000000
--- a/facebook/samples/SessionLoginSample/res/layout/activity.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/SessionLoginSample/res/layout/custom_fragment_activity.xml b/facebook/samples/SessionLoginSample/res/layout/custom_fragment_activity.xml
deleted file mode 100644
index c0be0bbd8..000000000
--- a/facebook/samples/SessionLoginSample/res/layout/custom_fragment_activity.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/SessionLoginSample/res/layout/fragment.xml b/facebook/samples/SessionLoginSample/res/layout/fragment.xml
deleted file mode 100644
index 55da93ac9..000000000
--- a/facebook/samples/SessionLoginSample/res/layout/fragment.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/SessionLoginSample/res/layout/login_fragment_activity.xml b/facebook/samples/SessionLoginSample/res/layout/login_fragment_activity.xml
deleted file mode 100644
index b7ce7ce30..000000000
--- a/facebook/samples/SessionLoginSample/res/layout/login_fragment_activity.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/facebook/samples/SessionLoginSample/res/layout/main.xml b/facebook/samples/SessionLoginSample/res/layout/main.xml
deleted file mode 100644
index f5237dda5..000000000
--- a/facebook/samples/SessionLoginSample/res/layout/main.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/SessionLoginSample/res/values/strings.xml b/facebook/samples/SessionLoginSample/res/values/strings.xml
deleted file mode 100644
index a06061580..000000000
--- a/facebook/samples/SessionLoginSample/res/values/strings.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
- Login using Activity
- Login using Custom Fragment
- Login using UserSettingsFragment
- Hello World, SessionLoginSampleActivity!
- SessionLoginSample
- Login
- Login to create a link to fetch account data
- Log out
- 380615018626574
-
-
diff --git a/facebook/samples/SessionLoginSample/src/com/facebook/samples/sessionlogin/LoginUsingActivityActivity.java b/facebook/samples/SessionLoginSample/src/com/facebook/samples/sessionlogin/LoginUsingActivityActivity.java
deleted file mode 100644
index 8ac0884f5..000000000
--- a/facebook/samples/SessionLoginSample/src/com/facebook/samples/sessionlogin/LoginUsingActivityActivity.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/**
- * Copyright 2012 Facebook
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.facebook.samples.sessionlogin;
-
-import android.app.Activity;
-import android.content.Intent;
-import android.os.Bundle;
-import android.view.View;
-import android.view.View.OnClickListener;
-import android.widget.Button;
-import android.widget.TextView;
-import com.facebook.LoggingBehavior;
-import com.facebook.Session;
-import com.facebook.SessionState;
-import com.facebook.Settings;
-
-public class LoginUsingActivityActivity extends Activity {
- private static final String URL_PREFIX_FRIENDS = "https://graph.facebook.com/me/friends?access_token=";
-
- private TextView textInstructionsOrLink;
- private Button buttonLoginLogout;
- private Session.StatusCallback statusCallback = new SessionStatusCallback();
-
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity);
- buttonLoginLogout = (Button)findViewById(R.id.buttonLoginLogout);
- textInstructionsOrLink = (TextView)findViewById(R.id.instructionsOrLink);
-
- Settings.addLoggingBehavior(LoggingBehavior.INCLUDE_ACCESS_TOKENS);
-
- Session session = Session.getActiveSession();
- if (session == null) {
- if (savedInstanceState != null) {
- session = Session.restoreSession(this, null, statusCallback, savedInstanceState);
- }
- if (session == null) {
- session = new Session(this);
- }
- Session.setActiveSession(session);
- if (session.getState().equals(SessionState.CREATED_TOKEN_LOADED)) {
- session.openForRead(new Session.OpenRequest(this).setCallback(statusCallback));
- }
- }
-
- updateView();
- }
-
- @Override
- public void onStart() {
- super.onStart();
- Session.getActiveSession().addCallback(statusCallback);
- }
-
- @Override
- public void onStop() {
- super.onStop();
- Session.getActiveSession().removeCallback(statusCallback);
- }
-
- @Override
- public void onActivityResult(int requestCode, int resultCode, Intent data) {
- super.onActivityResult(requestCode, resultCode, data);
- Session.getActiveSession().onActivityResult(this, requestCode, resultCode, data);
- }
-
- @Override
- protected void onSaveInstanceState(Bundle outState) {
- super.onSaveInstanceState(outState);
- Session session = Session.getActiveSession();
- Session.saveSession(session, outState);
- }
-
- private void updateView() {
- Session session = Session.getActiveSession();
- if (session.isOpened()) {
- textInstructionsOrLink.setText(URL_PREFIX_FRIENDS + session.getAccessToken());
- buttonLoginLogout.setText(R.string.logout);
- buttonLoginLogout.setOnClickListener(new OnClickListener() {
- public void onClick(View view) { onClickLogout(); }
- });
- } else {
- textInstructionsOrLink.setText(R.string.instructions);
- buttonLoginLogout.setText(R.string.login);
- buttonLoginLogout.setOnClickListener(new OnClickListener() {
- public void onClick(View view) { onClickLogin(); }
- });
- }
- }
-
- private void onClickLogin() {
- Session session = Session.getActiveSession();
- if (!session.isOpened() && !session.isClosed()) {
- session.openForRead(new Session.OpenRequest(this).setCallback(statusCallback));
- } else {
- Session.openActiveSession(this, true, statusCallback);
- }
- }
-
- private void onClickLogout() {
- Session session = Session.getActiveSession();
- if (!session.isClosed()) {
- session.closeAndClearTokenInformation();
- }
- }
-
- private class SessionStatusCallback implements Session.StatusCallback {
- @Override
- public void call(Session session, SessionState state, Exception exception) {
- updateView();
- }
- }
-}
diff --git a/facebook/samples/SessionLoginSample/src/com/facebook/samples/sessionlogin/LoginUsingCustomFragmentActivity.java b/facebook/samples/SessionLoginSample/src/com/facebook/samples/sessionlogin/LoginUsingCustomFragmentActivity.java
deleted file mode 100644
index 4769dda32..000000000
--- a/facebook/samples/SessionLoginSample/src/com/facebook/samples/sessionlogin/LoginUsingCustomFragmentActivity.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- * Copyright 2012 Facebook
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.facebook.samples.sessionlogin;
-
-import android.os.Bundle;
-import android.support.v4.app.FragmentActivity;
-
-public class LoginUsingCustomFragmentActivity extends FragmentActivity {
-
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.custom_fragment_activity);
- }
-}
diff --git a/facebook/samples/SessionLoginSample/src/com/facebook/samples/sessionlogin/LoginUsingLoginFragmentActivity.java b/facebook/samples/SessionLoginSample/src/com/facebook/samples/sessionlogin/LoginUsingLoginFragmentActivity.java
deleted file mode 100644
index ff20bf257..000000000
--- a/facebook/samples/SessionLoginSample/src/com/facebook/samples/sessionlogin/LoginUsingLoginFragmentActivity.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/**
- * Copyright 2012 Facebook
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.facebook.samples.sessionlogin;
-
-import android.content.Intent;
-import android.os.Bundle;
-import android.support.v4.app.FragmentActivity;
-import android.support.v4.app.FragmentManager;
-import android.util.Log;
-import com.facebook.Session;
-import com.facebook.SessionState;
-import com.facebook.widget.UserSettingsFragment;
-
-public class LoginUsingLoginFragmentActivity extends FragmentActivity {
- private UserSettingsFragment userSettingsFragment;
-
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- setContentView(R.layout.login_fragment_activity);
-
- FragmentManager fragmentManager = getSupportFragmentManager();
- userSettingsFragment = (UserSettingsFragment) fragmentManager.findFragmentById(R.id.login_fragment);
- userSettingsFragment.setSessionStatusCallback(new Session.StatusCallback() {
- @Override
- public void call(Session session, SessionState state, Exception exception) {
- Log.d("LoginUsingLoginFragmentActivity", String.format("New session state: %s", state.toString()));
- }
- });
- }
-
- @Override
- public void onActivityResult(int requestCode, int resultCode, Intent data) {
- userSettingsFragment.onActivityResult(requestCode, resultCode, data);
- super.onActivityResult(requestCode, resultCode, data);
- }
-
-}
\ No newline at end of file
diff --git a/facebook/samples/SessionLoginSample/src/com/facebook/samples/sessionlogin/SessionLoginFragment.java b/facebook/samples/SessionLoginSample/src/com/facebook/samples/sessionlogin/SessionLoginFragment.java
deleted file mode 100644
index 7f2164f7b..000000000
--- a/facebook/samples/SessionLoginSample/src/com/facebook/samples/sessionlogin/SessionLoginFragment.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/**
- * Copyright 2012 Facebook
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.facebook.samples.sessionlogin;
-
-import android.content.Intent;
-import android.os.Bundle;
-import android.support.v4.app.Fragment;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.Button;
-import android.widget.TextView;
-import com.facebook.LoggingBehavior;
-import com.facebook.Session;
-import com.facebook.SessionState;
-import com.facebook.Settings;
-
-public class SessionLoginFragment extends Fragment {
- private static final String URL_PREFIX_FRIENDS = "https://graph.facebook.com/me/friends?access_token=";
-
- private TextView textInstructionsOrLink;
- private Button buttonLoginLogout;
- private Session.StatusCallback statusCallback = new SessionStatusCallback();
-
- @Override
- public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
- View view = inflater.inflate(R.layout.fragment, container, false);
-
- buttonLoginLogout = (Button) view.findViewById(R.id.buttonLoginLogout);
- textInstructionsOrLink = (TextView) view.findViewById(R.id.instructionsOrLink);
-
- Settings.addLoggingBehavior(LoggingBehavior.INCLUDE_ACCESS_TOKENS);
-
- Session session = Session.getActiveSession();
- if (session == null) {
- if (savedInstanceState != null) {
- session = Session.restoreSession(getActivity(), null, statusCallback, savedInstanceState);
- }
- if (session == null) {
- session = new Session(getActivity());
- }
- Session.setActiveSession(session);
- if (session.getState().equals(SessionState.CREATED_TOKEN_LOADED)) {
- session.openForRead(new Session.OpenRequest(this).setCallback(statusCallback));
- }
- }
-
- updateView();
-
- return view;
- }
-
- @Override
- public void onStart() {
- super.onStart();
- Session.getActiveSession().addCallback(statusCallback);
- }
-
- @Override
- public void onStop() {
- super.onStop();
- Session.getActiveSession().removeCallback(statusCallback);
- }
-
- @Override
- public void onActivityResult(int requestCode, int resultCode, Intent data) {
- super.onActivityResult(requestCode, resultCode, data);
- Session.getActiveSession().onActivityResult(getActivity(), requestCode, resultCode, data);
- }
-
- @Override
- public void onSaveInstanceState(Bundle outState) {
- super.onSaveInstanceState(outState);
- Session session = Session.getActiveSession();
- Session.saveSession(session, outState);
- }
-
- private void updateView() {
- Session session = Session.getActiveSession();
- if (session.isOpened()) {
- textInstructionsOrLink.setText(URL_PREFIX_FRIENDS + session.getAccessToken());
- buttonLoginLogout.setText(R.string.logout);
- buttonLoginLogout.setOnClickListener(new View.OnClickListener() {
- public void onClick(View view) { onClickLogout(); }
- });
- } else {
- textInstructionsOrLink.setText(R.string.instructions);
- buttonLoginLogout.setText(R.string.login);
- buttonLoginLogout.setOnClickListener(new View.OnClickListener() {
- public void onClick(View view) { onClickLogin(); }
- });
- }
- }
-
- private void onClickLogin() {
- Session session = Session.getActiveSession();
- if (!session.isOpened() && !session.isClosed()) {
- session.openForRead(new Session.OpenRequest(this).setCallback(statusCallback));
- } else {
- Session.openActiveSession(getActivity(), this, true, statusCallback);
- }
- }
-
- private void onClickLogout() {
- Session session = Session.getActiveSession();
- if (!session.isClosed()) {
- session.closeAndClearTokenInformation();
- }
- }
-
- private class SessionStatusCallback implements Session.StatusCallback {
- @Override
- public void call(Session session, SessionState state, Exception exception) {
- updateView();
- }
- }
-}
diff --git a/facebook/samples/SessionLoginSample/src/com/facebook/samples/sessionlogin/SessionLoginSampleActivity.java b/facebook/samples/SessionLoginSample/src/com/facebook/samples/sessionlogin/SessionLoginSampleActivity.java
deleted file mode 100644
index a6ce9bb97..000000000
--- a/facebook/samples/SessionLoginSample/src/com/facebook/samples/sessionlogin/SessionLoginSampleActivity.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/**
- * Copyright 2012 Facebook
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.facebook.samples.sessionlogin;
-
-import android.app.Activity;
-import android.content.Intent;
-import android.os.Bundle;
-import android.view.View;
-import android.widget.Button;
-
-public class SessionLoginSampleActivity extends Activity {
-
- private Button buttonLoginActivity;
- private Button buttonCustomFragment;
- private Button buttonLoginFragment;
-
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- setContentView(R.layout.main);
-
- // We demonstrate three different ways of managing session login/logout behavior:
- // 1) LoginUsingActivityActivity implements an Activity that handles all of its own
- // session management.
- // 2) LoginUsingCustomFragmentActivity uses a Fragment that handles session management;
- // this Fragment could be composed as part of a more complex Activity, although in this
- // case it is the only UI that the Activity displays.
- // 3) LoginUsingLoginFragmentActivity is similar to LoginUsingCustomFragmentActivity, but
- // uses the UserSettingsFragment class provided by the SDK to handle session management. As
- // in (2), this Fragment could be composed as part of a more complex Activity in a real app.
- buttonLoginActivity = (Button) findViewById(R.id.buttonLoginActivity);
- buttonLoginActivity.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- Intent intent = new Intent(SessionLoginSampleActivity.this, LoginUsingActivityActivity.class);
- startActivity(intent);
- }
- });
-
- buttonCustomFragment = (Button) findViewById(R.id.buttonLoginCustomFragment);
- buttonCustomFragment.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- Intent intent = new Intent(SessionLoginSampleActivity.this, LoginUsingCustomFragmentActivity.class);
- startActivity(intent);
- }
- });
-
- buttonLoginFragment = (Button) findViewById(R.id.buttonLoginFragment);
- buttonLoginFragment.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- Intent intent = new Intent(SessionLoginSampleActivity.this, LoginUsingLoginFragmentActivity.class);
- startActivity(intent);
- }
- });
- }
-}
\ No newline at end of file
diff --git a/facebook/samples/SwitchUserSample/.classpath b/facebook/samples/SwitchUserSample/.classpath
deleted file mode 100644
index 655a4a827..000000000
--- a/facebook/samples/SwitchUserSample/.classpath
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/SwitchUserSample/.project b/facebook/samples/SwitchUserSample/.project
deleted file mode 100644
index 2f6fda8c3..000000000
--- a/facebook/samples/SwitchUserSample/.project
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
- SwitchUserSample
-
-
-
-
-
- com.android.ide.eclipse.adt.ResourceManagerBuilder
-
-
-
-
- com.android.ide.eclipse.adt.PreCompilerBuilder
-
-
-
-
- org.eclipse.jdt.core.javabuilder
-
-
-
-
- com.android.ide.eclipse.adt.ApkBuilder
-
-
-
-
-
- com.android.ide.eclipse.adt.AndroidNature
- org.eclipse.jdt.core.javanature
-
-
diff --git a/facebook/samples/SwitchUserSample/AndroidManifest.xml b/facebook/samples/SwitchUserSample/AndroidManifest.xml
deleted file mode 100644
index 8107b8d41..000000000
--- a/facebook/samples/SwitchUserSample/AndroidManifest.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/SwitchUserSample/ant.properties b/facebook/samples/SwitchUserSample/ant.properties
deleted file mode 100644
index 939105d52..000000000
--- a/facebook/samples/SwitchUserSample/ant.properties
+++ /dev/null
@@ -1,18 +0,0 @@
-# This file is used to override default values used by the Ant build system.
-#
-# This file must be checked into Version Control Systems, as it is
-# integral to the build system of your project.
-
-# This file is only used by the Ant script.
-
-# You can use this to override default values such as
-# 'source.dir' for the location of your java source folder and
-# 'out.dir' for the location of your output folder.
-
-# You can also use it define how the release builds are signed by declaring
-# the following properties:
-# 'key.store' for the location of your keystore and
-# 'key.alias' for the name of the key to use.
-# The password will be asked during the build when you use the 'release' target.
-
-java.compilerargs=-Xlint -Werror
diff --git a/facebook/samples/SwitchUserSample/build.xml b/facebook/samples/SwitchUserSample/build.xml
deleted file mode 100644
index ee88101d7..000000000
--- a/facebook/samples/SwitchUserSample/build.xml
+++ /dev/null
@@ -1,92 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/SwitchUserSample/proguard-project.txt b/facebook/samples/SwitchUserSample/proguard-project.txt
deleted file mode 100644
index f2fe1559a..000000000
--- a/facebook/samples/SwitchUserSample/proguard-project.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-# To enable ProGuard in your project, edit project.properties
-# to define the proguard.config property as described in that file.
-#
-# Add project specific ProGuard rules here.
-# By default, the flags in this file are appended to flags specified
-# in ${sdk.dir}/tools/proguard/proguard-android.txt
-# You can edit the include path and order by changing the ProGuard
-# include property in project.properties.
-#
-# For more details, see
-# http://developer.android.com/guide/developing/tools/proguard.html
-
-# Add any project specific keep options here:
-
-# If your project uses WebView with JS, uncomment the following
-# and specify the fully qualified class name to the JavaScript interface
-# class:
-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
-# public *;
-#}
diff --git a/facebook/samples/SwitchUserSample/project.properties b/facebook/samples/SwitchUserSample/project.properties
deleted file mode 100644
index cee0509c6..000000000
--- a/facebook/samples/SwitchUserSample/project.properties
+++ /dev/null
@@ -1,15 +0,0 @@
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-#
-# This file must be checked in Version Control Systems.
-#
-# To customize properties used by the Ant build system edit
-# "ant.properties", and override values to adapt the script to your
-# project structure.
-#
-# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
-#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
-
-# Project target.
-target=android-8
-android.library.reference.1=../../facebook
diff --git a/facebook/samples/SwitchUserSample/res/drawable-hdpi/icon.png b/facebook/samples/SwitchUserSample/res/drawable-hdpi/icon.png
deleted file mode 100644
index cda826b7f..000000000
Binary files a/facebook/samples/SwitchUserSample/res/drawable-hdpi/icon.png and /dev/null differ
diff --git a/facebook/samples/SwitchUserSample/res/drawable-mdpi/icon.png b/facebook/samples/SwitchUserSample/res/drawable-mdpi/icon.png
deleted file mode 100644
index ffd35f432..000000000
Binary files a/facebook/samples/SwitchUserSample/res/drawable-mdpi/icon.png and /dev/null differ
diff --git a/facebook/samples/SwitchUserSample/res/drawable-xhdpi/icon.png b/facebook/samples/SwitchUserSample/res/drawable-xhdpi/icon.png
deleted file mode 100644
index be63ade0b..000000000
Binary files a/facebook/samples/SwitchUserSample/res/drawable-xhdpi/icon.png and /dev/null differ
diff --git a/facebook/samples/SwitchUserSample/res/drawable/icon.png b/facebook/samples/SwitchUserSample/res/drawable/icon.png
deleted file mode 100644
index ffd35f432..000000000
Binary files a/facebook/samples/SwitchUserSample/res/drawable/icon.png and /dev/null differ
diff --git a/facebook/samples/SwitchUserSample/res/layout/fragment_profile.xml b/facebook/samples/SwitchUserSample/res/layout/fragment_profile.xml
deleted file mode 100644
index 509a8a215..000000000
--- a/facebook/samples/SwitchUserSample/res/layout/fragment_profile.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/SwitchUserSample/res/layout/list_item_user.xml b/facebook/samples/SwitchUserSample/res/layout/list_item_user.xml
deleted file mode 100644
index 021f8a184..000000000
--- a/facebook/samples/SwitchUserSample/res/layout/list_item_user.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/facebook/samples/SwitchUserSample/res/layout/main.xml b/facebook/samples/SwitchUserSample/res/layout/main.xml
deleted file mode 100644
index a223f1d3e..000000000
--- a/facebook/samples/SwitchUserSample/res/layout/main.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
diff --git a/facebook/samples/SwitchUserSample/res/menu/context_settings.xml b/facebook/samples/SwitchUserSample/res/menu/context_settings.xml
deleted file mode 100644
index c1aa76530..000000000
--- a/facebook/samples/SwitchUserSample/res/menu/context_settings.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
-
diff --git a/facebook/samples/SwitchUserSample/res/menu/options_profile.xml b/facebook/samples/SwitchUserSample/res/menu/options_profile.xml
deleted file mode 100644
index 2457088f0..000000000
--- a/facebook/samples/SwitchUserSample/res/menu/options_profile.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
-
diff --git a/facebook/samples/SwitchUserSample/res/values/strings.xml b/facebook/samples/SwitchUserSample/res/values/strings.xml
deleted file mode 100644
index 4195ef509..000000000
--- a/facebook/samples/SwitchUserSample/res/values/strings.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
- SwitchUserSample
- Empty Slot
- Hello, %s!
- Please select a user via the options menu
- Select User
- Clear this slot
- 327842977278179
-
diff --git a/facebook/samples/SwitchUserSample/src/com/facebook/samples/switchuser/MainActivity.java b/facebook/samples/SwitchUserSample/src/com/facebook/samples/switchuser/MainActivity.java
deleted file mode 100644
index 8b4c9d482..000000000
--- a/facebook/samples/SwitchUserSample/src/com/facebook/samples/switchuser/MainActivity.java
+++ /dev/null
@@ -1,251 +0,0 @@
-/**
- * Copyright 2012 Facebook
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.facebook.samples.switchuser;
-
-import android.content.Intent;
-import android.os.Bundle;
-import android.support.v4.app.FragmentActivity;
-import android.support.v4.app.FragmentManager;
-import android.support.v4.app.FragmentTransaction;
-import android.view.MenuItem;
-import com.facebook.*;
-import com.facebook.model.GraphUser;
-
-public class MainActivity extends FragmentActivity {
-
- private static final String SHOWING_SETTINGS_KEY = "Showing settings";
- private static final String TOKEN_CACHE_NAME_KEY = "TokenCacheName";
-
- private ProfileFragment profileFragment;
- private SettingsFragment settingsFragment;
- private boolean isShowingSettings;
- private Slot currentSlot;
- private Session currentSession;
- private Session.StatusCallback sessionStatusCallback;
-
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
-
- restoreFragments(savedInstanceState);
-
- sessionStatusCallback = new Session.StatusCallback() {
- @Override
- public void call(Session session, SessionState state, Exception exception) {
- onSessionStateChange(session, state, exception);
- }
- };
-
- if (savedInstanceState != null) {
- if (savedInstanceState.getBoolean(SHOWING_SETTINGS_KEY)) {
- showSettings();
- } else {
- showProfile();
- }
-
- SharedPreferencesTokenCachingStrategy restoredCache = new SharedPreferencesTokenCachingStrategy(
- this,
- savedInstanceState.getString(TOKEN_CACHE_NAME_KEY));
- currentSession = Session.restoreSession(
- this,
- restoredCache,
- sessionStatusCallback,
- savedInstanceState);
- } else {
- showProfile();
- }
- }
-
- @Override
- public void onBackPressed() {
- if (isShowingSettings()) {
- // This back is from the settings fragment
- showProfile();
- } else {
- // Allow the user to back out of the app as well.
- super.onBackPressed();
- }
- }
-
-
- @Override
- protected void onSaveInstanceState(Bundle outState) {
- super.onSaveInstanceState(outState);
- outState.putBoolean(SHOWING_SETTINGS_KEY, isShowingSettings());
- if (currentSlot != null) {
- outState.putString(TOKEN_CACHE_NAME_KEY, currentSlot.getTokenCacheName());
- }
-
- FragmentManager manager = getSupportFragmentManager();
- manager.putFragment(outState, SettingsFragment.TAG, settingsFragment);
- manager.putFragment(outState, ProfileFragment.TAG, profileFragment);
-
- Session.saveSession(currentSession, outState);
- }
-
- @Override
- protected void onResume() {
- super.onResume();
-
- settingsFragment.setSlotChangedListener(new SettingsFragment.OnSlotChangedListener() {
- @Override
- public void onSlotChanged(Slot newSlot) {
- handleSlotChange(newSlot);
- }
- });
-
- profileFragment.setOnOptionsItemSelectedListener(new ProfileFragment.OnOptionsItemSelectedListener() {
- @Override
- public boolean onOptionsItemSelected(MenuItem item) {
- return handleOptionsItemSelected(item);
- }
- });
-
- if (currentSession != null) {
- currentSession.addCallback(sessionStatusCallback);
- }
- }
-
- @Override
- protected void onPause() {
- super.onPause();
-
- settingsFragment.setSlotChangedListener(null);
- profileFragment.setOnOptionsItemSelectedListener(null);
-
- if (currentSession != null) {
- currentSession.removeCallback(sessionStatusCallback);
- }
- }
-
- @Override
- public void onActivityResult(int requestCode, int resultCode, Intent data) {
- super.onActivityResult(requestCode, resultCode, data);
- if (currentSession != null) {
- currentSession.onActivityResult(this, requestCode, resultCode, data);
- }
- }
-
- private void onSessionStateChange(Session session, SessionState state, Exception exception) {
- if (session != currentSession) {
- return;
- }
-
- if (state.isOpened()) {
- // Log in just happened.
- fetchUserInfo();
- showProfile();
- } else if (state.isClosed()) {
- // Log out just happened. Update the UI.
- updateFragments(null);
- }
- }
-
- private void restoreFragments(Bundle savedInstanceState) {
- FragmentManager manager = getSupportFragmentManager();
- FragmentTransaction transaction = manager.beginTransaction();
-
- if (savedInstanceState != null) {
- profileFragment = (ProfileFragment)manager.getFragment(savedInstanceState, ProfileFragment.TAG);
- settingsFragment = (SettingsFragment)manager.getFragment(savedInstanceState, SettingsFragment.TAG);
- }
-
- if (profileFragment == null) {
- profileFragment = new ProfileFragment();
- transaction.add(R.id.fragmentContainer, profileFragment, ProfileFragment.TAG);
- }
-
- if (settingsFragment == null) {
- settingsFragment = new SettingsFragment();
- transaction.add(R.id.fragmentContainer, settingsFragment, SettingsFragment.TAG);
- }
-
- transaction.commit();
- }
-
- private void showSettings() {
- isShowingSettings = true;
-
- FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
- transaction.hide(profileFragment)
- .show(settingsFragment)
- .commit();
- }
-
- private boolean isShowingSettings() {
- return isShowingSettings;
- }
-
- private void showProfile() {
- isShowingSettings = false;
-
- FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
- transaction.hide(settingsFragment)
- .show(profileFragment)
- .commit();
- }
-
- private void fetchUserInfo() {
- if (currentSession != null && currentSession.isOpened()) {
- Request request = Request.newMeRequest(currentSession, new Request.GraphUserCallback() {
- @Override
- public void onCompleted(GraphUser me, Response response) {
- if (response.getRequest().getSession() == currentSession) {
- updateFragments(me);
- }
- }
- });
- request.executeAsync();
- }
- }
-
- private void handleSlotChange(Slot newSlot) {
- if (currentSession != null) {
- currentSession.close();
- currentSession = null;
- }
-
- if (newSlot != null) {
- currentSlot = newSlot;
- currentSession = new Session.Builder(this)
- .setTokenCachingStrategy(currentSlot.getTokenCache())
- .build();
- currentSession.addCallback(sessionStatusCallback);
-
- Session.OpenRequest openRequest = new Session.OpenRequest(this);
- openRequest.setLoginBehavior(newSlot.getLoginBehavior());
- openRequest.setRequestCode(Session.DEFAULT_AUTHORIZE_ACTIVITY_CODE);
- currentSession.openForRead(openRequest);
- }
- }
-
- private boolean handleOptionsItemSelected(MenuItem item) {
- switch (item.getItemId()) {
- case R.id.menu_item_switch:
- showSettings();
- return true;
- default:
- return false;
- }
- }
-
- private void updateFragments(GraphUser user) {
- settingsFragment.updateViewForUser(user);
- profileFragment.updateViewForUser(user);
- }
-}
diff --git a/facebook/samples/SwitchUserSample/src/com/facebook/samples/switchuser/ProfileFragment.java b/facebook/samples/SwitchUserSample/src/com/facebook/samples/switchuser/ProfileFragment.java
deleted file mode 100644
index 885fc93f9..000000000
--- a/facebook/samples/SwitchUserSample/src/com/facebook/samples/switchuser/ProfileFragment.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/**
- * Copyright 2012 Facebook
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.facebook.samples.switchuser;
-
-import android.os.Bundle;
-import android.support.v4.app.Fragment;
-import android.view.*;
-import android.widget.TextView;
-import com.facebook.model.GraphUser;
-import com.facebook.widget.ProfilePictureView;
-
-public class ProfileFragment extends Fragment {
-
- public static final String TAG = "ProfileFragment";
-
- private TextView userNameView;
- private ProfilePictureView profilePictureView;
- private OnOptionsItemSelectedListener onOptionsItemSelectedListener;
-
- private GraphUser pendingUpdateForUser;
-
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setHasOptionsMenu(true);
- }
-
- @Override
- public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
- super.onCreateOptionsMenu(menu, inflater);
- inflater.inflate(R.menu.options_profile, menu);
- }
-
- @Override
- public boolean onOptionsItemSelected(MenuItem item) {
- boolean handled = false;
- OnOptionsItemSelectedListener listener = onOptionsItemSelectedListener;
- if (listener != null) {
- handled = listener.onOptionsItemSelected(item);
- }
-
- if (!handled) {
- handled = super.onOptionsItemSelected(item);
- }
-
- return handled;
- }
-
- @Override
- public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {
- View v = inflater.inflate(R.layout.fragment_profile, parent, false);
-
- userNameView = (TextView)v.findViewById(R.id.profileUserName);
- profilePictureView = (ProfilePictureView)v.findViewById(R.id.profilePic);
-
- if (pendingUpdateForUser != null) {
- updateViewForUser(pendingUpdateForUser);
- pendingUpdateForUser = null;
- }
-
- return v;
- }
-
- public void setOnOptionsItemSelectedListener(OnOptionsItemSelectedListener listener) {
- this.onOptionsItemSelectedListener = listener;
- }
-
- public void updateViewForUser(GraphUser user) {
- if (userNameView == null || profilePictureView == null || !isAdded()) {
- // Fragment not yet added to the view. So let's store which user was intended
- // for display.
- pendingUpdateForUser = user;
- return;
- }
-
- if (user == null) {
- profilePictureView.setProfileId(null);
- userNameView.setText(R.string.greeting_no_user);
- } else {
- profilePictureView.setProfileId(user.getId());
- userNameView.setText(
- String.format(getString(R.string.greeting_format), user.getFirstName()));
- }
- }
-
- public interface OnOptionsItemSelectedListener {
- boolean onOptionsItemSelected(MenuItem item);
- }
-}
diff --git a/facebook/samples/SwitchUserSample/src/com/facebook/samples/switchuser/SettingsFragment.java b/facebook/samples/SwitchUserSample/src/com/facebook/samples/switchuser/SettingsFragment.java
deleted file mode 100644
index b140e2577..000000000
--- a/facebook/samples/SwitchUserSample/src/com/facebook/samples/switchuser/SettingsFragment.java
+++ /dev/null
@@ -1,283 +0,0 @@
-/**
- * Copyright 2012 Facebook
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.facebook.samples.switchuser;
-
-import android.content.Context;
-import android.content.SharedPreferences;
-import android.os.Bundle;
-import android.support.v4.app.ListFragment;
-import android.view.*;
-import android.widget.*;
-import com.facebook.model.GraphUser;
-import com.facebook.widget.ProfilePictureView;
-import com.facebook.SessionLoginBehavior;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-
-public class SettingsFragment extends ListFragment {
-
- public static final String TAG = "SettingsFragment";
-
- private static final String CURRENT_SLOT_KEY = "CurrentSlot";
-
- private SlotManager slotManager;
- private OnSlotChangedListener slotChangedListener;
- private boolean hasPendingNotifySlotChanged;
-
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- slotManager = new SlotManager();
- slotManager.restore(
- getActivity(),
- savedInstanceState != null ?
- savedInstanceState.getInt(CURRENT_SLOT_KEY, SlotManager.NO_SLOT) :
- SlotManager.NO_SLOT);
- ArrayList slotList = new ArrayList(
- Arrays.asList(slotManager.getAllSlots()));
-
- setListAdapter(new SlotAdapter(slotList));
- }
-
- @Override
- public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {
- View view = super.onCreateView(inflater, parent, savedInstanceState);
- registerForContextMenu(view.findViewById(android.R.id.list));
-
- return view;
- }
-
- @Override
- public void onCreateContextMenu(ContextMenu menu, View view, ContextMenu.ContextMenuInfo menuInfo) {
- super.onCreateContextMenu(menu, view, menuInfo);
- getActivity().getMenuInflater().inflate(R.menu.context_settings, menu);
- }
-
- @Override
- public void onListItemClick(ListView l, View view, int position, long id) {
- slotManager.toggleSlot(position);
- }
-
- @Override
- public boolean onContextItemSelected(MenuItem item) {
- AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) item.getMenuInfo();
- SlotAdapter adapter = (SlotAdapter) getListAdapter();
- Slot slot = adapter.getItem(info.position);
-
- switch (item.getItemId()) {
- case R.id.menu_item_clear_slot:
- if (slot.getUserId() != null) {
- // Clear out data that this app stored in the cache
- // Not calling Session.closeAndClearTokenInformation() because we have additional
- // data stored in the cache.
- slot.clear();
- if (slot == slotManager.getSelectedSlot()) {
- slotManager.toggleSlot(info.position);
- }
-
- updateListView();
- }
- return true;
- }
-
- return super.onContextItemSelected(item);
- }
-
- @Override
- public void onSaveInstanceState(Bundle outState) {
- super.onSaveInstanceState(outState);
-
- outState.putInt(CURRENT_SLOT_KEY, slotManager.getSelectedSlotNumber());
- }
-
- public void setSlotChangedListener(OnSlotChangedListener listener) {
- slotChangedListener = listener;
- if (listener != null && hasPendingNotifySlotChanged) {
- notifySlotChanged();
- hasPendingNotifySlotChanged = false;
- }
- }
-
- public void updateViewForUser(GraphUser user) {
- if (slotManager == null) {
- // Fragment has not had onCreate called yet.
- return;
- }
-
- if (user != null) {
- Slot s = slotManager.getSelectedSlot();
- if (s != null) {
- s.update(user);
- }
- } else {
- // If the user is null, then there isn't an actively selected
- // user. This can happen if the user cancelled a login. So make sure that
- // SlotManager is updated properly.
- slotManager.setSelectedSlotNumber(SlotManager.NO_SLOT);
- }
-
- updateListView();
- }
-
- private void notifySlotChanged() {
- OnSlotChangedListener listener = slotChangedListener;
- if (listener != null) {
- Slot newSlot = slotManager.getSelectedSlot();
- listener.onSlotChanged(newSlot);
- } else {
- hasPendingNotifySlotChanged = true;
- }
- }
-
- private void updateListView() {
- SlotAdapter adapter = (SlotAdapter) getListAdapter();
- adapter.notifyDataSetChanged();
- }
-
- public interface OnSlotChangedListener {
- void onSlotChanged(Slot newSlot);
- }
-
- private class SlotAdapter extends ArrayAdapter {
-
- public SlotAdapter(ArrayList slots) {
- super(getActivity(), android.R.layout.simple_list_item_1, slots);
- }
-
- @Override
- public View getView(int position, View convertView, ViewGroup parent) {
- if (null == convertView) {
- convertView = getActivity().getLayoutInflater()
- .inflate(R.layout.list_item_user, null);
- }
-
- Slot slot = getItem(position);
- String userName = slot.getUserName();
- if (userName == null) {
- userName = getString(R.string.empty_slot);
- }
-
- ProfilePictureView profilePictureView = (ProfilePictureView) convertView.findViewById(
- R.id.slotPic);
- profilePictureView.setCropped(true);
- profilePictureView.setProfileId(slot.getUserId());
-
- TextView userNameTextView = (TextView) convertView.findViewById(
- R.id.slotUserName);
- userNameTextView.setText(userName);
-
- CheckBox currentUserCheckBox = (CheckBox) convertView.findViewById(
- R.id.currentUserIndicator);
- currentUserCheckBox.setChecked(slotManager.getSelectedSlot() == slot);
-
- return convertView;
- }
-
- }
-
- private class SlotManager {
- static final int NO_SLOT = -1;
-
- private final static int MAX_SLOTS = 4;
-
- private static final String SETTINGS_CURRENT_SLOT_KEY = "CurrentSlot";
- private static final String SETTINGS_NAME = "UserManagerSettings";
-
- private SharedPreferences settings;
- private int selectedSlotNumber = NO_SLOT;
-
- private Slot[] slots;
-
- void restore(Context context, int oldSelectedSlot) {
- if (context == null) {
- throw new IllegalArgumentException("context cannot be null");
- }
-
- Context applicationContext = context.getApplicationContext();
- applicationContext = (applicationContext == null) ? context : applicationContext;
-
- slots = new Slot[MAX_SLOTS];
- for (int i = 0; i < MAX_SLOTS; i++) {
- SessionLoginBehavior loginBehavior = (i == 0) ?
- SessionLoginBehavior.SSO_WITH_FALLBACK :
- SessionLoginBehavior.SUPPRESS_SSO;
- slots[i] = new Slot(applicationContext, i, loginBehavior);
- }
-
- // Restore the last known state from when the app ran last.
- settings = applicationContext.getSharedPreferences(SETTINGS_NAME, Context.MODE_PRIVATE);
- int savedSlotNumber = settings.getInt(SETTINGS_CURRENT_SLOT_KEY, NO_SLOT);
- if (savedSlotNumber != NO_SLOT && savedSlotNumber != oldSelectedSlot) {
- // This will trigger the full flow of creating and opening the right session
- toggleSlot(savedSlotNumber);
- } else {
- // We already knew which slot was selected. So don't notify that a new slot was
- // selected since that will close out the old session and recreate a new one. And
- // doing so will have the effect of clearing out state like the profile pic.
- setSelectedSlotNumber(savedSlotNumber);
- }
- }
-
- void toggleSlot(int slot) {
- validateSlot(slot);
-
- if (slot == selectedSlotNumber) {
- setSelectedSlotNumber(NO_SLOT);
- } else {
- setSelectedSlotNumber(slot);
- }
-
- notifySlotChanged();
- }
-
- Slot getSelectedSlot() {
- if (selectedSlotNumber == NO_SLOT) {
- return null;
- } else {
- return getSlot(selectedSlotNumber);
- }
- }
-
- int getSelectedSlotNumber() {
- return selectedSlotNumber;
- }
-
- Slot[] getAllSlots() {
- return slots;
- }
-
- Slot getSlot(int slot) {
- validateSlot(slot);
-
- return slots[slot];
- }
-
- private void setSelectedSlotNumber(int slot) {
- // Store the selected slot number for when the app is closed and restarted
- settings.edit().putInt(SETTINGS_CURRENT_SLOT_KEY, slot).commit();
- selectedSlotNumber = slot;
- }
-
- private void validateSlot(int slot) {
- if (slot <= NO_SLOT || slot >= MAX_SLOTS) {
- throw new IllegalArgumentException(
- String.format("Choose a slot between 0 and %d inclusively", MAX_SLOTS-1));
- }
- }
- }
-}
diff --git a/facebook/samples/SwitchUserSample/src/com/facebook/samples/switchuser/Slot.java b/facebook/samples/SwitchUserSample/src/com/facebook/samples/switchuser/Slot.java
deleted file mode 100644
index 0dee18160..000000000
--- a/facebook/samples/SwitchUserSample/src/com/facebook/samples/switchuser/Slot.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/**
- * Copyright 2012 Facebook
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.facebook.samples.switchuser;
-
-import android.content.Context;
-import android.os.Bundle;
-import com.facebook.*;
-import com.facebook.model.GraphUser;
-
-public class Slot {
-
- private static final String CACHE_NAME_FORMAT = "TokenCache%d";
- private static final String CACHE_USER_ID_KEY = "SwitchUserSampleUserId";
- private static final String CACHE_USER_NAME_KEY = "SwitchUserSampleUserName";
-
- private String tokenCacheName;
- private String userName;
- private String userId;
- private SharedPreferencesTokenCachingStrategy tokenCache;
- private SessionLoginBehavior loginBehavior;
-
- public Slot(Context context, int slotNumber, SessionLoginBehavior loginBehavior) {
- this.loginBehavior = loginBehavior;
- this.tokenCacheName = String.format(CACHE_NAME_FORMAT, slotNumber);
- this.tokenCache = new SharedPreferencesTokenCachingStrategy(
- context,
- tokenCacheName);
-
- restore();
- }
-
- public String getTokenCacheName() {
- return tokenCacheName;
- }
-
- public String getUserName() {
- return userName;
- }
-
- public String getUserId() {
- return userId;
- }
-
- public SessionLoginBehavior getLoginBehavior() {
- return loginBehavior;
- }
-
- public SharedPreferencesTokenCachingStrategy getTokenCache() {
- return tokenCache;
- }
-
- public void update(GraphUser user) {
- if (user == null) {
- return;
- }
-
- userId = user.getId();
- userName = user.getName();
-
- Bundle userInfo = tokenCache.load();
- userInfo.putString(CACHE_USER_ID_KEY, userId);
- userInfo.putString(CACHE_USER_NAME_KEY, userName);
-
- tokenCache.save(userInfo);
- }
-
- public void clear() {
- tokenCache.clear();
- restore();
- }
-
- private void restore() {
- Bundle userInfo = tokenCache.load();
- userId = userInfo.getString(CACHE_USER_ID_KEY);
- userName = userInfo.getString(CACHE_USER_NAME_KEY);
- }
-}
diff --git a/facebook/tests/AndroidManifest.xml b/facebook/tests/AndroidManifest.xml
deleted file mode 100644
index 35f8aefcb..000000000
--- a/facebook/tests/AndroidManifest.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/facebook/tests/res/drawable/icon.png b/facebook/tests/res/drawable/icon.png
deleted file mode 100644
index a07c69fa5..000000000
Binary files a/facebook/tests/res/drawable/icon.png and /dev/null differ
diff --git a/facebook/tests/res/layout/main.xml b/facebook/tests/res/layout/main.xml
deleted file mode 100644
index bc121048b..000000000
--- a/facebook/tests/res/layout/main.xml
+++ /dev/null
@@ -1,89 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/facebook/tests/res/values/colors.xml b/facebook/tests/res/values/colors.xml
deleted file mode 100644
index 2f916914f..000000000
--- a/facebook/tests/res/values/colors.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
- #ffffff
- #000000
-
diff --git a/facebook/tests/res/values/strings.xml b/facebook/tests/res/values/strings.xml
deleted file mode 100644
index a8fa46759..000000000
--- a/facebook/tests/res/values/strings.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
- Hello World, Tests!
- Test Login
- Test UI Server
- Test Logout
- Functional Tests
-
diff --git a/facebook/tests/src/com/facebook/android/tests/Tests.java b/facebook/tests/src/com/facebook/android/tests/Tests.java
deleted file mode 100644
index 4fb93d730..000000000
--- a/facebook/tests/src/com/facebook/android/tests/Tests.java
+++ /dev/null
@@ -1,595 +0,0 @@
-/**
- * Copyright 2012 Facebook
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.facebook.android.tests;
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.net.MalformedURLException;
-
-import org.json.JSONObject;
-
-import com.facebook.android.AsyncFacebookRunner;
-import com.facebook.android.DialogError;
-import com.facebook.android.Facebook;
-import com.facebook.android.FacebookError;
-import com.facebook.android.Util;
-import com.facebook.android.AsyncFacebookRunner.RequestListener;
-import com.facebook.android.Facebook.DialogListener;
-
-import android.app.Activity;
-import android.content.Intent;
-import android.graphics.Color;
-import android.os.Bundle;
-import android.util.Log;
-import android.view.View;
-import android.view.View.OnClickListener;
-import android.widget.Button;
-import android.widget.TextView;
-
-public class Tests extends Activity {
-
- // Your Facebook Application ID must be set before running this example
- // See http://www.facebook.com/developers/createapp.php
- public static final String APP_ID = "110862205611506";
-
- private static final String[] PERMISSIONS =
- new String[] {"publish_stream", "read_stream", "offline_access"};
-
- TextView publicTestsText;
- TextView publicErrorsText;
- Button loginButton;
- TextView authenticatedTestsText;
- TextView authenticatedErrorsText;
- Button postButton;
- TextView wallPostText;
- TextView deletedPostText;
- Button logoutButton;
- TextView logoutText;
-
- Facebook authenticatedFacebook = new Facebook(APP_ID);
-
- /** Called when the activity is first created. */
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
-
- publicTestsText = (TextView) findViewById(R.id.publicTests);
- publicErrorsText = (TextView) findViewById(R.id.publicErrors);
- loginButton = (Button) findViewById(R.id.login);
- authenticatedTestsText = (TextView) findViewById(
- R.id.authenticatedTests);
- authenticatedErrorsText = (TextView) findViewById(
- R.id.authenticatedErrors);
- postButton = (Button) findViewById(R.id.post);
- wallPostText = (TextView) findViewById(R.id.wallPost);
- deletedPostText = (TextView) findViewById(R.id.deletedPost);
- logoutButton = (Button) findViewById(R.id.logout);
- logoutText = (TextView) findViewById(R.id.logoutTest);
-
- // button to test UI Server login method
- loginButton.setOnClickListener(new OnClickListener() {
- public void onClick(View v) {
- authenticatedFacebook.authorize(Tests.this, PERMISSIONS,
- new TestLoginListener());
- }
- });
-
- // button for testing UI server publish stream dialog
- postButton.setOnClickListener(new OnClickListener() {
- public void onClick(View v) {
- authenticatedFacebook.dialog(Tests.this, "stream.publish",
- new TestUiServerListener());
- }
- });
-
- // enable logout test button
- logoutButton.setOnClickListener(new OnClickListener() {
- public void onClick(View v) {
- runTestLogout();
- }
- });
-
- runTestPublicApi();
- }
-
- @Override
- public void onActivityResult(int requestCode, int resultCode, Intent data) {
- authenticatedFacebook.authorizeCallback(requestCode, resultCode, data);
- }
-
- public void runTestPublicApi() {
- if (testPublicApi()) {
- publicTestsText.setText("Public API tests passed");
- publicTestsText.setTextColor(Color.GREEN);
- } else {
- publicTestsText.setText("Public API tests failed");
- publicTestsText.setTextColor(Color.RED);
- }
-
- if (testPublicErrors()) {
- publicErrorsText.setText("Public API errors passed");
- publicErrorsText.setTextColor(Color.GREEN);
- } else {
- publicErrorsText.setText("Public API errors failed");
- publicErrorsText.setTextColor(Color.RED);
- }
- }
-
- public boolean testPublicApi() {
- Facebook fb = new Facebook(APP_ID);
- try {
- Log.d("Tests", "Testing standard API call");
- JSONObject response = Util.parseJson(fb.request("4"));
- if (!response.getString("name").equals("Mark Zuckerberg")) {
- return false;
- }
-
- Log.d("Tests", "Testing an API call with a specific method");
- response = Util.parseJson(
- fb.request("soneff", new Bundle(), "GET"));
- if (!response.getString("name").equals("Steven Soneff")) {
- return false;
- }
-
- Log.d("Tests", "Testing a public search query");
- Bundle params = new Bundle();
- params.putString("q", "facebook");
- response = Util.parseJson(fb.request("search", params));
- if (response.getJSONArray("data").length() == 0) return false;
-
- Log.d("Tests", "Public API Tests passed");
- return true;
- } catch (Throwable e) {
- e.printStackTrace();
- return false;
- }
- }
-
- public boolean testPublicErrors() {
- Facebook fb = new Facebook(APP_ID);
- try {
- Bundle params = new Bundle();
-
- Log.d("Tests", "Testing illegal post");
- params.putString("message", "Hello World");
- try {
- Util.parseJson(fb.request("4", params, "POST"));
- return false;
- } catch (FacebookError e) {
- Log.d("Tests", "*" + e.getMessage() + "*");
- if (!e.getMessage().equals("Unsupported post request.")) {
- return false;
- }
- }
-
- Log.d("Tests", "Testing illegal delete");
- try {
- Util.parseJson(fb.request("4", new Bundle(), "DELETE"));
- return false;
- } catch (FacebookError e) {
- Log.d("Tests", "*" + e.getMessage() + "*");
- if (!e.getMessage().equals(
- "An access token is required to request this " +
- "resource.")) {
- return false;
- }
- }
-
- Log.d("Tests", "Testing illegal post to Zuck's feed");
- try {
- Util.parseJson(fb.request("4/feed", new Bundle(), "POST"));
- return false;
- } catch (FacebookError e) {
- Log.d("Tests", "*" + e.getMessage() + "*");
- if (!e.getMessage().equals("(#200) The user hasn't " +
- "authorized the application to perform this action")) {
- return false;
- }
- }
-
- Log.d("Tests", "Testing invalidly specified parameters");
- try {
- Util.parseJson(fb.request("bgolub?fields=id,name,picture"));
- return false;
- } catch (FacebookError e) {
- Log.d("Tests", "*" + e.getMessage() + "*");
- if (!e.getMessage().startsWith("Unknown fields: picture?")) {
- return false;
- }
- }
-
- Log.d("Tests", "Testing request for 'me' is rejected without " +
- "access_token");
- try {
- Util.parseJson(fb.request("me"));
- return false;
- } catch (FacebookError e) {
- Log.d("Tests", "*" + e.getMessage() + "*");
- if (!e.getMessage().equals(
- "An active access token must be used to " +
- "query information about the current user.")) {
- return false;
- }
- }
-
- Log.d("Tests", "Testing empty request");
- try {
- Util.parseJson(fb.request(""));
- return false;
- } catch (FacebookError e) {
- Log.d("Tests", "*" + e.getMessage() + "*");
- if (!e.getMessage().equals("Unsupported get request.")) {
- return false;
- }
- }
-
- Log.d("Tests", "Testing an invalid path");
- try {
- Util.parseJson(fb.request("invalidinvalidinvalidinvalid"));
- return false;
- } catch (FacebookError e) {
- Log.d("Tests", "*" + e.getMessage() + "*");
- if (!e.getMessage().equals(
- "(#803) Some of the aliases you requested do not " +
- "exist: invalidinvalidinvalidinvalid")) {
- return false;
- }
- }
-
- Log.d("Tests", "Testing missing query parameter");
- try {
- Util.parseJson(fb.request("search", new Bundle(), "GET"));
- return false;
- } catch (FacebookError e) {
- Log.d("Tests", "*" + e.getMessage() + "*");
- if (!e.getMessage().equals("No node specified")) return false;
- }
-
- Log.d("Tests", "Testing that API method is specified");
- try {
- fb.request(new Bundle());
- return false;
- } catch (IllegalArgumentException e) {
- Log.d("Tests", "*" + e.getMessage() + "*");
- if (!e.getMessage().equals(
- "API method must be specified. " +
- "(parameters must contain key \"method\" " +
- "and value). See http://developers.facebook." +
- "com/docs/reference/rest/")) {
- return false;
- }
- }
-
- Log.d("Tests", "Testing that old API request cannot be made " +
- "without access token");
- params.putString("method", "stream.publish");
- try {
- Util.parseJson(fb.request(params));
- return false;
- } catch (FacebookError e) {
- Log.d("Tests", "*" + e.getMessage() + "*");
- if (e.getErrorCode() != 101 ||
- !e.getMessage().equals("Invalid API key") ) {
- return false;
- }
- }
-
- Log.d("Tests", "Testing invalid access token");
- try {
- fb.setAccessToken("invalid");
- Util.parseJson(fb.request("me", new Bundle(), "GET"));
- return false;
- } catch (FacebookError e) {
- Log.d("Tests", "*" + e.getMessage() + "*");
- if (!e.getMessage().equals("Invalid OAuth access token.")) {
- return false;
- }
- }
-
- Log.d("Tests", "Public API Error Tests passed");
- return true;
- } catch (Throwable e) {
- e.printStackTrace();
- return false;
- }
- }
-
- public class TestLoginListener implements DialogListener {
-
- public void onComplete(Bundle values) {
- if (testAuthenticatedApi()) {
- authenticatedTestsText.setText(
- "Authenticated API tests passed");
- authenticatedTestsText.setTextColor(Color.GREEN);
- } else {
- authenticatedTestsText.setText(
- "Authenticated API tests failed");
- authenticatedTestsText.setTextColor(Color.RED);
- }
- if (testAuthenticatedErrors()) {
- authenticatedErrorsText.setText(
- "Authenticated API errors passed");
- authenticatedErrorsText.setTextColor(Color.GREEN);
- } else {
- authenticatedErrorsText.setText(
- "Authenticated API errors failed");
- authenticatedErrorsText.setTextColor(Color.RED);
- }
- }
-
- public void onCancel() {
- }
-
- public void onError(DialogError e) {
- e.printStackTrace();
- }
-
- public void onFacebookError(FacebookError e) {
- e.printStackTrace();
- }
- }
-
- public boolean testAuthenticatedApi() {
- if (!authenticatedFacebook.isSessionValid()) return false;
- try {
- Log.d("Tests", "Testing request for 'me'");
- String response = authenticatedFacebook.request("me");
- JSONObject obj = Util.parseJson(response);
- if (obj.getString("name") == null ||
- obj.getString("name").equals("")) {
- return false;
- }
-
- Log.d("Tests", "Testing graph API wall post");
- Bundle parameters = new Bundle();
- parameters.putString("message", "hello world");
- parameters.putString("description", "test test test");
- response = authenticatedFacebook.request("me/feed", parameters,
- "POST");
- Log.d("Tests", "got response: " + response);
- if (response == null || response.equals("") ||
- response.equals("false")) {
- return false;
- }
-
- Log.d("Tests", "Testing graph API delete");
- response = response.replaceAll("\\{\"id\":\"", "");
- response = response.replaceAll("\"\\}", "");
- response = authenticatedFacebook.request(response, new Bundle(),
- "DELETE");
- if (!response.equals("true")) return false;
-
- Log.d("Tests", "Testing old API wall post");
- parameters = new Bundle();
- parameters.putString("method", "stream.publish");
- parameters.putString("attachment",
- "{\"name\":\"Name=Title\"," +
- "\"href\":\"http://www.google.fr/\",\"" +
- "caption\":\"Caption\",\"description\":\"Description" +
- "\",\"media\":[{\"type\":\"image\",\"src\":" +
- "\"http://www.kratiroff.com/logo-facebook.jpg\"," +
- "\"href\":\"http://developers.facebook.com/\"}]," +
- "\"properties\":{\"another link\":{\"text\":\"" +
- "Facebook homepage\",\"href\":\"http://www.facebook." +
- "com\"}}}");;
- response = authenticatedFacebook.request(parameters);
- Log.d("Tests", "got response: " + response);
- if (response == null || response.equals("") ||
- response.equals("false")) {
- return false;
- }
-
- Log.d("Tests", "Testing wall post delete");
- response = response.replaceAll("\"", "");
- response = authenticatedFacebook.request(
- response, new Bundle(), "DELETE");
- if (!response.equals("true")) return false;
-
- Log.d("Tests", "All Authenticated Tests Passed");
- return true;
- } catch (Throwable e) {
- e.printStackTrace();
- return false;
- }
- }
-
- public boolean testAuthenticatedErrors() {
- if (!authenticatedFacebook.isSessionValid()) return false;
-
- Log.d("Tests", "Testing that request for 'me/invalid' is rejected");
- try {
- Util.parseJson(authenticatedFacebook.request("me/invalid"));
- return false;
- } catch (Throwable e) {
- Log.d("Tests", "*" + e.getMessage() + "*");
- if (!e.getMessage().equals("Unknown path components: /invalid")) {
- return false;
- }
- }
-
- Log.d("Tests", "Testing that old API call with invalid method fails");
- Bundle params = new Bundle();
- params.putString("method", "something_invalid");
- try {
- Util.parseJson(authenticatedFacebook.request(params));
- return false;
- } catch (Throwable e) {
- Log.d("Tests", "*" + e.getMessage() + "*");
- if (!e.getMessage().equals("Unknown method") ) {
- return false;
- }
- }
-
- Log.d("Tests", "All Authenticated Error Tests Passed");
- return true;
- }
-
- public class TestUiServerListener implements DialogListener {
-
- public void onComplete(Bundle values) {
- final String postId = values.getString("post_id");
- if (postId != null) {
- Log.d("Facebook-Example", "Dialog Success! post_id=" + postId);
- new AsyncFacebookRunner(authenticatedFacebook).request(postId,
- new TestPostRequestListener());
- } else {
- Tests.this.runOnUiThread(new Runnable() {
- public void run() {
- wallPostText.setText("Wall Post Failure");
- wallPostText.setTextColor(Color.RED);
- }
- });
- }
- }
-
- public void onCancel() { }
-
- public void onError(DialogError e) {
- e.printStackTrace();
- }
-
- public void onFacebookError(FacebookError e) {
- e.printStackTrace();
- }
- }
-
- public class TestPostRequestListener implements RequestListener {
-
- public void onComplete(final String response, final Object state) {
- Log.d("Tests", "Got response: " + response);
- try {
- JSONObject json = Util.parseJson(response);
- //final String message = json.getString("message");
- String postId = json.getString("id");
- Tests.this.runOnUiThread(new Runnable() {
- public void run() {
- wallPostText.setText("Wall Post Success");
- wallPostText.setTextColor(Color.GREEN);
- }
- });
-
- Log.d("Tests", "Testing wall post delete");
- if (testPostDelete(postId)) {
- Tests.this.runOnUiThread(new Runnable() {
- public void run() {
- deletedPostText.setText("Deleted Post Success");
- deletedPostText.setTextColor(Color.GREEN);
- }
- });
- } else {
- Tests.this.runOnUiThread(new Runnable() {
- public void run() {
- deletedPostText.setText("Deleted Post Failure");
- deletedPostText.setTextColor(Color.RED);
- }
- });
- }
- } catch (Throwable e) {
- e.printStackTrace();
- Tests.this.runOnUiThread(new Runnable() {
- public void run() {
- wallPostText.setText("Wall Post Failure");
- wallPostText.setTextColor(Color.RED);
- }
- });
- }
- }
-
- public void onFacebookError(FacebookError e, final Object state) {
- e.printStackTrace();
- }
-
- public void onFileNotFoundException(FileNotFoundException e,
- final Object state) {
- e.printStackTrace();
- }
-
- public void onIOException(IOException e, final Object state) {
- e.printStackTrace();
- }
-
- public void onMalformedURLException(MalformedURLException e,
- final Object state) {
- e.printStackTrace();
- }
- }
-
- public boolean testPostDelete(String postId) {
- try {
- String deleteResponse =
- authenticatedFacebook.request(postId, new Bundle(), "DELETE");
- return deleteResponse.equals("true");
- } catch (Throwable e) {
- e.printStackTrace();
- return false;
- }
- }
-
- public void runTestLogout() {
- if (testLogout()) {
- logoutText.setText("Logout Tests Passed");
- logoutText.setTextColor(Color.GREEN);
- } else {
- logoutText.setText("Logout Tests Failed");
- logoutText.setTextColor(Color.RED);
- }
- }
-
- public boolean testLogout() {
- try {
- Log.d("Tests", "Testing logout");
- String response = authenticatedFacebook.logout(this);
- Log.d("Tests", "Got logout response: *" + response + "*");
- if (!response.equals("true")) {
- return false;
- }
-
- Log.d("Tests", "Testing logout on logged out facebook session");
- try {
- Util.parseJson(authenticatedFacebook.logout(this));
- return false;
- } catch (FacebookError e) {
- if (e.getErrorCode() != 101 ||
- !e.getMessage().equals("Invalid API key") ) {
- return false;
- }
- }
-
- Log.d("Tests", "Testing logout on unauthenticated object");
- try {
- Util.parseJson(new Facebook(APP_ID).logout(this));
- return false;
- } catch (FacebookError e) {
- if (e.getErrorCode() != 101 ||
- !e.getMessage().equals("Invalid API key") ) {
- return false;
- }
- }
-
- Log.d("Tests", "All Logout Tests Passed");
- return true;
- } catch (Throwable e) {
- e.printStackTrace();
- return false;
- }
- }
-
- // test bad UI server method?
-
- // test invalid permission? <-- UI server test
-}
diff --git a/greendroid/.gitignore b/greendroid/.gitignore
deleted file mode 100644
index 1136241e6..000000000
--- a/greendroid/.gitignore
+++ /dev/null
@@ -1,6 +0,0 @@
-*/bin/*
-*/gen/*
-*.DS_Store
-*.pyc
-GDCatalog/.project
-GreenDroid-GoogleAPIs/.project
diff --git a/greendroid/GDCatalog/.classpath b/greendroid/GDCatalog/.classpath
deleted file mode 100644
index 5a1b63236..000000000
--- a/greendroid/GDCatalog/.classpath
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/greendroid/GreenDroid-GoogleAPIs/.classpath b/greendroid/GreenDroid-GoogleAPIs/.classpath
deleted file mode 100644
index 2100bbda4..000000000
--- a/greendroid/GreenDroid-GoogleAPIs/.classpath
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/greendroid/GreenDroid/.classpath b/greendroid/GreenDroid/.classpath
deleted file mode 100644
index a4763d1ee..000000000
--- a/greendroid/GreenDroid/.classpath
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/greendroid/GreenDroid/.project b/greendroid/GreenDroid/.project
deleted file mode 100644
index fcb384fde..000000000
--- a/greendroid/GreenDroid/.project
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
- GreenDroid
-
-
-
-
-
- com.android.ide.eclipse.adt.ResourceManagerBuilder
-
-
-
-
- com.android.ide.eclipse.adt.PreCompilerBuilder
-
-
-
-
- org.eclipse.jdt.core.javabuilder
-
-
-
-
- com.android.ide.eclipse.adt.ApkBuilder
-
-
-
-
-
- com.android.ide.eclipse.adt.AndroidNature
- org.eclipse.jdt.core.javanature
-
-
diff --git a/greendroid/GreenDroid/GreenDroid.iml b/greendroid/GreenDroid/GreenDroid.iml
new file mode 100644
index 000000000..c5c53486d
--- /dev/null
+++ b/greendroid/GreenDroid/GreenDroid.iml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/greendroid/GreenDroid/build.xml b/greendroid/GreenDroid/build.xml
deleted file mode 100644
index 53ca4a287..000000000
--- a/greendroid/GreenDroid/build.xml
+++ /dev/null
@@ -1,85 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/filters/.classpath b/samples/filters/.classpath
deleted file mode 100644
index 52ae72c83..000000000
--- a/samples/filters/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
diff --git a/samples/filters/.settings/org.eclipse.jdt.core.prefs b/samples/filters/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 070dbff7d..000000000
--- a/samples/filters/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,332 +0,0 @@
-#Wed Jul 07 18:43:41 PDT 2010
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
-org.eclipse.jdt.core.compiler.problem.deadCode=ignore
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
-org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
-org.eclipse.jdt.core.compiler.problem.nullReference=warning
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
-org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=ignore
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=warning
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.6
-org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_assignment=0
-org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
-org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
-org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
-org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
-org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
-org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=0
-org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
-org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
-org.eclipse.jdt.core.formatter.blank_lines_after_package=1
-org.eclipse.jdt.core.formatter.blank_lines_before_field=0
-org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
-org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
-org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
-org.eclipse.jdt.core.formatter.blank_lines_before_method=1
-org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
-org.eclipse.jdt.core.formatter.blank_lines_before_package=0
-org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
-org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
-org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
-org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
-org.eclipse.jdt.core.formatter.comment.format_block_comments=true
-org.eclipse.jdt.core.formatter.comment.format_header=false
-org.eclipse.jdt.core.formatter.comment.format_html=true
-org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
-org.eclipse.jdt.core.formatter.comment.format_line_comments=true
-org.eclipse.jdt.core.formatter.comment.format_source_code=true
-org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
-org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
-org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
-org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
-org.eclipse.jdt.core.formatter.comment.line_length=80
-org.eclipse.jdt.core.formatter.compact_else_if=true
-org.eclipse.jdt.core.formatter.continuation_indentation=2
-org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
-org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
-org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
-org.eclipse.jdt.core.formatter.indent_empty_lines=false
-org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
-org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
-org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
-org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
-org.eclipse.jdt.core.formatter.indentation.size=4
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
-org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
-org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
-org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
-org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
-org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.join_lines_in_comments=true
-org.eclipse.jdt.core.formatter.join_wrapped_lines=true
-org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
-org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
-org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
-org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
-org.eclipse.jdt.core.formatter.lineSplit=80
-org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
-org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
-org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
-org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
-org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
-org.eclipse.jdt.core.formatter.tabulation.char=space
-org.eclipse.jdt.core.formatter.tabulation.size=4
-org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
-org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
diff --git a/samples/filters/.settings/org.eclipse.jdt.ui.prefs b/samples/filters/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index ace644cbc..000000000
--- a/samples/filters/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,109 +0,0 @@
-#Tue Jun 29 14:53:46 PDT 2010
-cleanup.add_default_serial_version_id=true
-cleanup.add_generated_serial_version_id=false
-cleanup.add_missing_annotations=true
-cleanup.add_missing_deprecated_annotations=true
-cleanup.add_missing_methods=false
-cleanup.add_missing_nls_tags=false
-cleanup.add_missing_override_annotations=true
-cleanup.add_serial_version_id=true
-cleanup.always_use_blocks=true
-cleanup.always_use_parentheses_in_expressions=false
-cleanup.always_use_this_for_non_static_field_access=false
-cleanup.always_use_this_for_non_static_method_access=false
-cleanup.convert_to_enhanced_for_loop=false
-cleanup.correct_indentation=false
-cleanup.format_source_code=false
-cleanup.format_source_code_changes_only=false
-cleanup.make_local_variable_final=true
-cleanup.make_parameters_final=false
-cleanup.make_private_fields_final=true
-cleanup.make_type_abstract_if_missing_method=false
-cleanup.make_variable_declarations_final=false
-cleanup.never_use_blocks=false
-cleanup.never_use_parentheses_in_expressions=true
-cleanup.organize_imports=true
-cleanup.qualify_static_field_accesses_with_declaring_class=false
-cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
-cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
-cleanup.qualify_static_member_accesses_with_declaring_class=true
-cleanup.qualify_static_method_accesses_with_declaring_class=false
-cleanup.remove_private_constructors=true
-cleanup.remove_trailing_whitespaces=true
-cleanup.remove_trailing_whitespaces_all=true
-cleanup.remove_trailing_whitespaces_ignore_empty=false
-cleanup.remove_unnecessary_casts=true
-cleanup.remove_unnecessary_nls_tags=true
-cleanup.remove_unused_imports=true
-cleanup.remove_unused_local_variables=false
-cleanup.remove_unused_private_fields=true
-cleanup.remove_unused_private_members=false
-cleanup.remove_unused_private_methods=true
-cleanup.remove_unused_private_types=true
-cleanup.sort_members=false
-cleanup.sort_members_all=false
-cleanup.use_blocks=false
-cleanup.use_blocks_only_for_return_and_throw=false
-cleanup.use_parentheses_in_expressions=false
-cleanup.use_this_for_non_static_field_access=false
-cleanup.use_this_for_non_static_field_access_only_if_necessary=true
-cleanup.use_this_for_non_static_method_access=false
-cleanup.use_this_for_non_static_method_access_only_if_necessary=true
-cleanup_profile=_Astrid
-cleanup_settings_version=2
-eclipse.preferences.version=1
-editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
-formatter_profile=_Astrid
-formatter_settings_version=11
-org.eclipse.jdt.ui.text.custom_code_templates=
-sp_cleanup.add_default_serial_version_id=true
-sp_cleanup.add_generated_serial_version_id=false
-sp_cleanup.add_missing_annotations=true
-sp_cleanup.add_missing_deprecated_annotations=true
-sp_cleanup.add_missing_methods=false
-sp_cleanup.add_missing_nls_tags=false
-sp_cleanup.add_missing_override_annotations=true
-sp_cleanup.add_serial_version_id=false
-sp_cleanup.always_use_blocks=true
-sp_cleanup.always_use_parentheses_in_expressions=false
-sp_cleanup.always_use_this_for_non_static_field_access=false
-sp_cleanup.always_use_this_for_non_static_method_access=false
-sp_cleanup.convert_to_enhanced_for_loop=false
-sp_cleanup.correct_indentation=false
-sp_cleanup.format_source_code=false
-sp_cleanup.format_source_code_changes_only=false
-sp_cleanup.make_local_variable_final=false
-sp_cleanup.make_parameters_final=false
-sp_cleanup.make_private_fields_final=true
-sp_cleanup.make_type_abstract_if_missing_method=false
-sp_cleanup.make_variable_declarations_final=true
-sp_cleanup.never_use_blocks=false
-sp_cleanup.never_use_parentheses_in_expressions=true
-sp_cleanup.on_save_use_additional_actions=true
-sp_cleanup.organize_imports=true
-sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
-sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
-sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
-sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
-sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
-sp_cleanup.remove_private_constructors=true
-sp_cleanup.remove_trailing_whitespaces=true
-sp_cleanup.remove_trailing_whitespaces_all=true
-sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
-sp_cleanup.remove_unnecessary_casts=false
-sp_cleanup.remove_unnecessary_nls_tags=true
-sp_cleanup.remove_unused_imports=true
-sp_cleanup.remove_unused_local_variables=false
-sp_cleanup.remove_unused_private_fields=true
-sp_cleanup.remove_unused_private_members=false
-sp_cleanup.remove_unused_private_methods=true
-sp_cleanup.remove_unused_private_types=true
-sp_cleanup.sort_members=false
-sp_cleanup.sort_members_all=false
-sp_cleanup.use_blocks=false
-sp_cleanup.use_blocks_only_for_return_and_throw=false
-sp_cleanup.use_parentheses_in_expressions=false
-sp_cleanup.use_this_for_non_static_field_access=false
-sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
-sp_cleanup.use_this_for_non_static_method_access=false
-sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
diff --git a/samples/filters/AndroidManifest.xml b/samples/filters/AndroidManifest.xml
deleted file mode 100644
index cc566b26d..000000000
--- a/samples/filters/AndroidManifest.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/samples/filters/README b/samples/filters/README
deleted file mode 100644
index 76e1e07b4..000000000
--- a/samples/filters/README
+++ /dev/null
@@ -1,7 +0,0 @@
-Filter Samples
-
-This project shows you how to create a filter plugin. It involves three files:
-
- FilterAddon.java - returns your addon, which allows users to turn it on or off
- FilterExposer.java - returns your filters
- AndroidManifest.xml - receives Astrid's requests and sends appropriate stuff
diff --git a/samples/filters/default.properties b/samples/filters/default.properties
deleted file mode 100644
index 9d79b12c7..000000000
--- a/samples/filters/default.properties
+++ /dev/null
@@ -1,11 +0,0 @@
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-#
-# This file must be checked in Version Control Systems.
-#
-# To customize properties used by the Ant build system use,
-# "build.properties", and override values to adapt the script to your
-# project structure.
-
-# Project target.
-target=android-4
diff --git a/samples/filters/res/drawable-hdpi/icon.png b/samples/filters/res/drawable-hdpi/icon.png
deleted file mode 100644
index 8074c4c57..000000000
Binary files a/samples/filters/res/drawable-hdpi/icon.png and /dev/null differ
diff --git a/samples/filters/res/drawable-ldpi/icon.png b/samples/filters/res/drawable-ldpi/icon.png
deleted file mode 100644
index 1095584ec..000000000
Binary files a/samples/filters/res/drawable-ldpi/icon.png and /dev/null differ
diff --git a/samples/filters/res/drawable-mdpi/icon.png b/samples/filters/res/drawable-mdpi/icon.png
deleted file mode 100644
index a07c69fa5..000000000
Binary files a/samples/filters/res/drawable-mdpi/icon.png and /dev/null differ
diff --git a/samples/filters/res/layout/main.xml b/samples/filters/res/layout/main.xml
deleted file mode 100644
index 68a58a4b4..000000000
--- a/samples/filters/res/layout/main.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
diff --git a/samples/filters/res/values/strings.xml b/samples/filters/res/values/strings.xml
deleted file mode 100644
index 433e62206..000000000
--- a/samples/filters/res/values/strings.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
- Hello World!
- Astrid Filter Samples
-
diff --git a/samples/filters/src/com/example/astrid/filter/FilterAddon.java b/samples/filters/src/com/example/astrid/filter/FilterAddon.java
deleted file mode 100644
index 48c3424c6..000000000
--- a/samples/filters/src/com/example/astrid/filter/FilterAddon.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * Copyright (c) 2012 Todoroo Inc
- *
- * See the file "LICENSE" for the full license governing this code.
- */
-package com.example.astrid.filter;
-
-import android.content.BroadcastReceiver;
-import android.content.Context;
-import android.content.Intent;
-
-/**
- * This class identifies the add-on to Astrid so users can re-order their
- * add-ons or toggle their visibility.
- *
- * @author Tim Su
- *
- */
-public class FilterAddon extends BroadcastReceiver {
-
- /**
- * Allows your plugin intents to identify themselves
- */
- static final String IDENTIFIER = "samplefilter"; //$NON-NLS-1$
-
- @Override
- public void onReceive(Context context, Intent intent) {
- // TODO coming in v3.0.0
- }
-
-}
diff --git a/samples/filters/src/com/example/astrid/filter/FilterExposer.java b/samples/filters/src/com/example/astrid/filter/FilterExposer.java
deleted file mode 100644
index df0a175ac..000000000
--- a/samples/filters/src/com/example/astrid/filter/FilterExposer.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * Copyright (c) 2012 Todoroo Inc
- *
- * See the file "LICENSE" for the full license governing this code.
- */
-package com.example.astrid.filter;
-
-import android.content.BroadcastReceiver;
-import android.content.ContentValues;
-import android.content.Context;
-import android.content.Intent;
-
-import com.todoroo.andlib.Order;
-import com.todoroo.andlib.QueryTemplate;
-import com.todoroo.astrid.api.AstridApiConstants;
-import com.todoroo.astrid.api.Filter;
-import com.todoroo.astrid.api.FilterListHeader;
-import com.todoroo.astrid.api.FilterListItem;
-import com.todoroo.astrid.data.Task;
-
-/**
- * Exposes Filters when requested
- *
- * @author Tim Su
- *
- */
-public final class FilterExposer extends BroadcastReceiver {
-
- @SuppressWarnings("nls")
- @Override
- public void onReceive(Context context, Intent intent) {
- FilterListItem[] list = new FilterListItem[2];
-
- list[0] = new FilterListHeader("Sample Filters");
-
- ContentValues completedValues = new ContentValues();
- completedValues.put(Task.COMPLETION_DATE.name, Filter.VALUE_NOW);
- list[1] = new Filter("Completed by Alpha",
- "Completed by Alpha",
- new QueryTemplate().where(Task.COMPLETION_DATE.gt(0)).orderBy(Order.asc(Task.TITLE)),
- completedValues);
-
- // transmit filter list
- Intent broadcastIntent = new Intent(AstridApiConstants.BROADCAST_SEND_FILTERS);
- broadcastIntent.putExtra(AstridApiConstants.EXTRAS_RESPONSE, list);
- context.sendBroadcast(broadcastIntent, AstridApiConstants.PERMISSION_READ);
- }
-
-}
diff --git a/samples/filters/src/com/todoroo/andlib/Constants.java b/samples/filters/src/com/todoroo/andlib/Constants.java
deleted file mode 100644
index cdd6a3e2e..000000000
--- a/samples/filters/src/com/todoroo/andlib/Constants.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * Copyright (c) 2012 Todoroo Inc
- *
- * See the file "LICENSE" for the full license governing this code.
- */
-package com.todoroo.andlib;
-
-@SuppressWarnings("nls")
-public final class Constants {
- static final String SELECT = "SELECT";
- static final String SPACE = " ";
- static final String AS = "AS";
- static final String COMMA = ",";
- static final String FROM = "FROM";
- static final String ON = "ON";
- static final String JOIN = "JOIN";
- static final String ALL = "*";
- static final String LEFT_PARENTHESIS = "(";
- static final String RIGHT_PARENTHESIS = ")";
- static final String AND = "AND";
- static final String BETWEEN = "BETWEEN";
- static final String LIKE = "LIKE";
- static final String OR = "OR";
- static final String ORDER_BY = "ORDER BY";
- static final String GROUP_BY = "GROUP BY";
- static final String WHERE = "WHERE";
- public static final String EXISTS = "EXISTS";
- public static final String NOT = "NOT";
- public static final String LIMIT = "LIMIT";
-}
diff --git a/samples/filters/src/com/todoroo/andlib/Criterion.java b/samples/filters/src/com/todoroo/andlib/Criterion.java
deleted file mode 100644
index 9fd2c1cf4..000000000
--- a/samples/filters/src/com/todoroo/andlib/Criterion.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/**
- * Copyright (c) 2012 Todoroo Inc
- *
- * See the file "LICENSE" for the full license governing this code.
- */
-package com.todoroo.andlib;
-
-import static com.todoroo.andlib.Constants.AND;
-import static com.todoroo.andlib.Constants.EXISTS;
-import static com.todoroo.andlib.Constants.LEFT_PARENTHESIS;
-import static com.todoroo.andlib.Constants.NOT;
-import static com.todoroo.andlib.Constants.OR;
-import static com.todoroo.andlib.Constants.RIGHT_PARENTHESIS;
-import static com.todoroo.andlib.Constants.SPACE;
-
-public abstract class Criterion {
- protected final Operator operator;
-
- Criterion(Operator operator) {
- this.operator = operator;
- }
-
- public static Criterion all = new Criterion(Operator.exists) {
- @Override
- protected void populate(StringBuilder sb) {
- sb.append(1);
- }
- };
-
- public static Criterion none = new Criterion(Operator.exists) {
- @Override
- protected void populate(StringBuilder sb) {
- sb.append(0);
- }
- };
-
- public static Criterion and(final Criterion criterion, final Criterion... criterions) {
- return new Criterion(Operator.and) {
-
- @Override
- protected void populate(StringBuilder sb) {
- sb.append(criterion);
- for (Criterion c : criterions) {
- sb.append(SPACE).append(AND).append(SPACE).append(c);
- }
- }
- };
- }
-
- public static Criterion or(final Criterion criterion, final Criterion... criterions) {
- return new Criterion(Operator.or) {
-
- @Override
- protected void populate(StringBuilder sb) {
- sb.append(criterion);
- for (Criterion c : criterions) {
- sb.append(SPACE).append(OR).append(SPACE).append(c.toString());
- }
- }
- };
- }
-
- public static Criterion exists(final Query query) {
- return new Criterion(Operator.exists) {
-
- @Override
- protected void populate(StringBuilder sb) {
- sb.append(EXISTS).append(SPACE).append(LEFT_PARENTHESIS).append(query).append(RIGHT_PARENTHESIS);
- }
- };
- }
-
- public static Criterion not(final Criterion criterion) {
- return new Criterion(Operator.not) {
-
- @Override
- protected void populate(StringBuilder sb) {
- sb.append(NOT).append(SPACE);
- criterion.populate(sb);
- }
- };
- }
-
- protected abstract void populate(StringBuilder sb);
-
- @Override
- public String toString() {
- StringBuilder builder = new StringBuilder(LEFT_PARENTHESIS);
- populate(builder);
- builder.append(RIGHT_PARENTHESIS);
- return builder.toString();
- }
-
-}
diff --git a/samples/filters/src/com/todoroo/andlib/DBObject.java b/samples/filters/src/com/todoroo/andlib/DBObject.java
deleted file mode 100644
index ecef0affc..000000000
--- a/samples/filters/src/com/todoroo/andlib/DBObject.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/**
- * Copyright (c) 2012 Todoroo Inc
- *
- * See the file "LICENSE" for the full license governing this code.
- */
-package com.todoroo.andlib;
-
-import static com.todoroo.andlib.Constants.AS;
-import static com.todoroo.andlib.Constants.SPACE;
-
-public abstract class DBObject> implements Cloneable {
- protected String alias;
- protected final String expression;
-
- protected DBObject(String expression){
- this.expression = expression;
- }
-
- @SuppressWarnings("unchecked")
- public T as(String newAlias) {
- try {
- T clone = (T) clone();
- clone.alias = newAlias;
- return clone;
- } catch (CloneNotSupportedException e) {
- throw new RuntimeException(e);
- }
- }
-
- public boolean hasAlias() {
- return alias != null;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
-
- DBObject> dbObject = (DBObject>) o;
-
- if (alias != null ? !alias.equals(dbObject.alias) : dbObject.alias != null) return false;
- if (expression != null ? !expression.equals(dbObject.expression) : dbObject.expression != null) return false;
-
- return true;
- }
-
- @Override
- public int hashCode() {
- int result = alias != null ? alias.hashCode() : 0;
- result = 31 * result + (expression != null ? expression.hashCode() : 0);
- return result;
- }
-
- @Override
- public final String toString() {
- if (hasAlias()) {
- return alias;
- }
- return expression;
- }
-
- public final String toStringInSelect() {
- StringBuilder sb = new StringBuilder(expression);
- if (hasAlias()) {
- sb.append(SPACE).append(AS).append(SPACE).append(alias);
- } else {
- int pos = expression.indexOf('.');
- if(pos > 0)
- sb.append(SPACE).append(AS).append(SPACE).append(expression.substring(pos + 1));
- }
- return sb.toString();
- }
-}
diff --git a/samples/filters/src/com/todoroo/andlib/DateUtilities.java b/samples/filters/src/com/todoroo/andlib/DateUtilities.java
deleted file mode 100644
index a822c7406..000000000
--- a/samples/filters/src/com/todoroo/andlib/DateUtilities.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/**
- * Copyright (c) 2012 Todoroo Inc
- *
- * See the file "LICENSE" for the full license governing this code.
- */
-package com.todoroo.andlib;
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.Locale;
-
-import android.content.Context;
-
-
-public class DateUtilities {
-
- /* ======================================================================
- * ============================================================ long time
- * ====================================================================== */
-
- /** Convert unixtime into date */
- public static final Date unixtimeToDate(long millis) {
- if(millis == 0)
- return null;
- return new Date(millis);
- }
-
- /** Convert date into unixtime */
- public static final long dateToUnixtime(Date date) {
- if(date == null)
- return 0;
- return date.getTime();
- }
-
- /** Returns unixtime for current time */
- public static final long now() {
- return System.currentTimeMillis();
- }
-
- /** Returns unixtime one month from now */
- public static final long oneMonthFromNow() {
- Date date = new Date();
- date.setMonth(date.getMonth() + 1);
- return date.getTime();
- }
-
- /** Represents a single hour */
- public static long ONE_HOUR = 3600000L;
-
- /** Represents a single day */
- public static long ONE_DAY = 24 * ONE_HOUR;
-
- /** Represents a single week */
- public static long ONE_WEEK = 7 * ONE_DAY;
-
- /* ======================================================================
- * =========================================================== formatters
- * ====================================================================== */
-
- @SuppressWarnings("nls")
- public static boolean is24HourFormat(Context context) {
- String value = android.provider.Settings.System.getString(context.getContentResolver(),
- android.provider.Settings.System.TIME_12_24);
- boolean b24 = !(value == null || value.equals("12"));
- return b24;
- }
-
- /**
- * @return time format (hours and minutes)
- */
- public static SimpleDateFormat getTimeFormat(Context context) {
- String value = getTimeFormatString(context);
- return new SimpleDateFormat(value);
- }
-
- /**
- * @return string used for time formatting
- */
- @SuppressWarnings("nls")
- private static String getTimeFormatString(Context context) {
- String value;
- if (is24HourFormat(context)) {
- value = "H:mm";
- } else {
- value = "h:mm a";
- }
- return value;
- }
-
- /**
- * @return string used for date formatting
- */
- @SuppressWarnings("nls")
- private static String getDateFormatString(Context context) {
- String value = android.provider.Settings.System.getString(context.getContentResolver(),
- android.provider.Settings.System.DATE_FORMAT);
- if (value == null) {
- // united states, you are special
- if (Locale.US.equals(Locale.getDefault())
- || Locale.CANADA.equals(Locale.getDefault()))
- value = "MMM d yyyy";
- else
- value = "d MMM yyyy";
- }
- return value;
- }
-
- /**
- * @return date format (month, day, year)
- */
- public static SimpleDateFormat getDateFormat(Context context) {
- return new SimpleDateFormat(getDateFormatString(context));
- }
-
- /**
- * @return date format as getDateFormat with weekday
- */
- @SuppressWarnings("nls")
- public static SimpleDateFormat getDateFormatWithWeekday(Context context) {
- return new SimpleDateFormat("EEE, " + getDateFormatString(context));
-
- }
-
- /**
- * @return date with time at the end
- */
- @SuppressWarnings("nls")
- public static SimpleDateFormat getDateWithTimeFormat(Context context) {
- return new SimpleDateFormat(getDateFormatString(context) + " " +
- getTimeFormatString(context));
-
- }
-
- /**
- * @return formatted date (will contain month, day, year)
- */
- public static String getFormattedDate(Context context, Date date) {
- return getDateFormat(context).format(date);
- }
-
-}
diff --git a/samples/filters/src/com/todoroo/andlib/EqCriterion.java b/samples/filters/src/com/todoroo/andlib/EqCriterion.java
deleted file mode 100644
index a000c1a4f..000000000
--- a/samples/filters/src/com/todoroo/andlib/EqCriterion.java
+++ /dev/null
@@ -1,12 +0,0 @@
-/**
- * Copyright (c) 2012 Todoroo Inc
- *
- * See the file "LICENSE" for the full license governing this code.
- */
-package com.todoroo.andlib;
-
-public class EqCriterion extends UnaryCriterion {
- EqCriterion(Field field, Object value) {
- super(field, Operator.eq, value);
- }
-}
diff --git a/samples/filters/src/com/todoroo/andlib/Field.java b/samples/filters/src/com/todoroo/andlib/Field.java
deleted file mode 100644
index 9bdbb202a..000000000
--- a/samples/filters/src/com/todoroo/andlib/Field.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/**
- * Copyright (c) 2012 Todoroo Inc
- *
- * See the file "LICENSE" for the full license governing this code.
- */
-package com.todoroo.andlib;
-
-import static com.todoroo.andlib.Constants.AND;
-import static com.todoroo.andlib.Constants.BETWEEN;
-import static com.todoroo.andlib.Constants.COMMA;
-import static com.todoroo.andlib.Constants.LEFT_PARENTHESIS;
-import static com.todoroo.andlib.Constants.RIGHT_PARENTHESIS;
-import static com.todoroo.andlib.Constants.SPACE;
-
-public class Field extends DBObject {
-
- protected Field(String expression) {
- super(expression);
- }
-
- public static Field field(String expression) {
- return new Field(expression);
- }
-
- public Criterion eq(Object value) {
- if(value == null)
- return UnaryCriterion.isNull(this);
- return UnaryCriterion.eq(this, value);
- }
-
- public Criterion neq(Object value) {
- if(value == null)
- return UnaryCriterion.isNotNull(this);
- return UnaryCriterion.neq(this, value);
- }
-
- public Criterion gt(Object value) {
- return UnaryCriterion.gt(this, value);
- }
-
- public Criterion lt(final Object value) {
- return UnaryCriterion.lt(this, value);
- }
-
- public Criterion isNull() {
- return UnaryCriterion.isNull(this);
- }
-
- public Criterion isNotNull() {
- return UnaryCriterion.isNotNull(this);
- }
-
- public Criterion between(final Object lower, final Object upper) {
- final Field field = this;
- return new Criterion(null) {
-
- @Override
- protected void populate(StringBuilder sb) {
- sb.append(field).append(SPACE).append(BETWEEN).append(SPACE).append(lower).append(SPACE).append(AND)
- .append(SPACE).append(upper);
- }
- };
- }
-
- public Criterion like(final String value) {
- return UnaryCriterion.like(this, value);
- }
-
- public Criterion in(final T... value) {
- final Field field = this;
- return new Criterion(Operator.in) {
-
- @Override
- protected void populate(StringBuilder sb) {
- sb.append(field).append(SPACE).append(Operator.in).append(SPACE).append(LEFT_PARENTHESIS);
- for (T t : value) {
- sb.append(t.toString()).append(COMMA);
- }
- sb.deleteCharAt(sb.length() - 1).append(RIGHT_PARENTHESIS);
- }
- };
- }
-
- public Criterion in(final Query query) {
- final Field field = this;
- return new Criterion(Operator.in) {
-
- @Override
- protected void populate(StringBuilder sb) {
- sb.append(field).append(SPACE).append(Operator.in).append(SPACE).append(LEFT_PARENTHESIS).append(query)
- .append(RIGHT_PARENTHESIS);
- }
- };
- }
-}
diff --git a/samples/filters/src/com/todoroo/andlib/Functions.java b/samples/filters/src/com/todoroo/andlib/Functions.java
deleted file mode 100644
index 13057357d..000000000
--- a/samples/filters/src/com/todoroo/andlib/Functions.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/**
- * Copyright (c) 2012 Todoroo Inc
- *
- * See the file "LICENSE" for the full license governing this code.
- */
-package com.todoroo.andlib;
-
-
-@SuppressWarnings("nls")
-public final class Functions {
-
- public static String caseStatement(Criterion when, Object ifTrue, Object ifFalse) {
- return new StringBuilder("(CASE WHEN ").
- append(when.toString()).append(" THEN ").append(value(ifTrue)).
- append(" ELSE ").append(value(ifFalse)).append(" END)").toString();
- }
-
- private static String value(Object value) {
- return value.toString();
- }
-
- public static Field upper(Field title) {
- return new Field("UPPER(" + title.toString() + ")");
- }
-
- /**
- * @return SQL now (in milliseconds)
- */
- public static Field now() {
- return new Field("(strftime('%s','now')*1000)");
- }
-
-}
diff --git a/samples/filters/src/com/todoroo/andlib/GroupBy.java b/samples/filters/src/com/todoroo/andlib/GroupBy.java
deleted file mode 100644
index 5d7d72126..000000000
--- a/samples/filters/src/com/todoroo/andlib/GroupBy.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * Copyright (c) 2012 Todoroo Inc
- *
- * See the file "LICENSE" for the full license governing this code.
- */
-package com.todoroo.andlib;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class GroupBy {
- private List fields = new ArrayList();
-
- public static GroupBy groupBy(Field field) {
- GroupBy groupBy = new GroupBy();
- groupBy.fields.add(field);
- return groupBy;
- }
-}
diff --git a/samples/filters/src/com/todoroo/andlib/Join.java b/samples/filters/src/com/todoroo/andlib/Join.java
deleted file mode 100644
index 53df02976..000000000
--- a/samples/filters/src/com/todoroo/andlib/Join.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * Copyright (c) 2012 Todoroo Inc
- *
- * See the file "LICENSE" for the full license governing this code.
- */
-package com.todoroo.andlib;
-
-import static com.todoroo.andlib.Constants.JOIN;
-import static com.todoroo.andlib.Constants.ON;
-import static com.todoroo.andlib.Constants.SPACE;
-
-public class Join {
- private final SqlTable joinTable;
- private final JoinType joinType;
- private final Criterion[] criterions;
-
- private Join(SqlTable table, JoinType joinType, Criterion... criterions) {
- joinTable = table;
- this.joinType = joinType;
- this.criterions = criterions;
- }
-
- public static Join inner(SqlTable expression, Criterion... criterions) {
- return new Join(expression, JoinType.INNER, criterions);
- }
-
- public static Join left(SqlTable table, Criterion... criterions) {
- return new Join(table, JoinType.LEFT, criterions);
- }
-
- public static Join right(SqlTable table, Criterion... criterions) {
- return new Join(table, JoinType.RIGHT, criterions);
- }
-
- public static Join out(SqlTable table, Criterion... criterions) {
- return new Join(table, JoinType.OUT, criterions);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append(joinType).append(SPACE).append(JOIN).append(SPACE).append(joinTable).append(SPACE).append(ON);
- for (Criterion criterion : criterions) {
- sb.append(SPACE).append(criterion);
- }
- return sb.toString();
- }
-}
diff --git a/samples/filters/src/com/todoroo/andlib/JoinType.java b/samples/filters/src/com/todoroo/andlib/JoinType.java
deleted file mode 100644
index 59d6fcbb4..000000000
--- a/samples/filters/src/com/todoroo/andlib/JoinType.java
+++ /dev/null
@@ -1,10 +0,0 @@
-/**
- * Copyright (c) 2012 Todoroo Inc
- *
- * See the file "LICENSE" for the full license governing this code.
- */
-package com.todoroo.andlib;
-
-public enum JoinType {
- INNER, LEFT, RIGHT, OUT
-}
diff --git a/samples/filters/src/com/todoroo/andlib/Operator.java b/samples/filters/src/com/todoroo/andlib/Operator.java
deleted file mode 100644
index 5186f958d..000000000
--- a/samples/filters/src/com/todoroo/andlib/Operator.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/**
- * Copyright (c) 2012 Todoroo Inc
- *
- * See the file "LICENSE" for the full license governing this code.
- */
-package com.todoroo.andlib;
-
-import static com.todoroo.andlib.Constants.SPACE;
-
-import java.util.HashMap;
-import java.util.Map;
-
-@SuppressWarnings("nls")
-public final class Operator {
-
- private final String operator;
- public static final Operator eq = new Operator("=");
- public static final Operator neq = new Operator("<>");
- public static final Operator isNull = new Operator("IS NULL");
- public static final Operator isNotNull = new Operator("IS NOT NULL");
- public static final Operator gt = new Operator(">");
- public static final Operator lt = new Operator("<");
- public static final Operator gte = new Operator(">=");
- public static final Operator lte = new Operator("<=");
- public static final Operator and = new Operator("AND");
- public static final Operator or = new Operator("OR");
- public static final Operator not = new Operator("NOT");
- public static final Operator exists = new Operator("EXISTS");
- public static final Operator like = new Operator("LIKE");
- public static final Operator in = new Operator("IN");
-
- private static final Map contraryRegistry = new HashMap();
-
- static {
- contraryRegistry.put(eq, neq);
- contraryRegistry.put(neq, eq);
- contraryRegistry.put(isNull, isNotNull);
- contraryRegistry.put(isNotNull, isNull);
- contraryRegistry.put(gt, lte);
- contraryRegistry.put(lte, gt);
- contraryRegistry.put(lt, gte);
- contraryRegistry.put(gte, lt);
- }
-
- private Operator(String operator) {
- this.operator = operator;
- }
-
- public Operator getContrary() {
- if(!contraryRegistry.containsKey(this)){
- Operator opposite = new Operator(not.toString() + SPACE + this.toString());
- contraryRegistry.put(this, opposite);
- contraryRegistry.put(opposite, this);
- }
- return contraryRegistry.get(this);
- }
-
- @Override
- public String toString() {
- return this.operator.toString();
- }
-}
diff --git a/samples/filters/src/com/todoroo/andlib/Order.java b/samples/filters/src/com/todoroo/andlib/Order.java
deleted file mode 100644
index 93f475f25..000000000
--- a/samples/filters/src/com/todoroo/andlib/Order.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/**
- * Copyright (c) 2012 Todoroo Inc
- *
- * See the file "LICENSE" for the full license governing this code.
- */
-package com.todoroo.andlib;
-
-import static com.todoroo.andlib.Constants.SPACE;
-
-public class Order {
- private final Object expression;
- private final OrderType orderType;
-
- private Order(Object expression) {
- this(expression, OrderType.ASC);
- }
-
- private Order(Object expression, OrderType orderType) {
- this.expression = expression;
- this.orderType = orderType;
- }
-
- public static Order asc(Object expression) {
- return new Order(expression);
- }
-
- public static Order desc(Object expression) {
- return new Order(expression, OrderType.DESC);
- }
-
- @Override
- public String toString() {
- return expression + SPACE + orderType;
- }
-}
diff --git a/samples/filters/src/com/todoroo/andlib/OrderType.java b/samples/filters/src/com/todoroo/andlib/OrderType.java
deleted file mode 100644
index 131557fc8..000000000
--- a/samples/filters/src/com/todoroo/andlib/OrderType.java
+++ /dev/null
@@ -1,10 +0,0 @@
-/**
- * Copyright (c) 2012 Todoroo Inc
- *
- * See the file "LICENSE" for the full license governing this code.
- */
-package com.todoroo.andlib;
-
-public enum OrderType {
- DESC, ASC
-}
diff --git a/samples/filters/src/com/todoroo/andlib/Query.java b/samples/filters/src/com/todoroo/andlib/Query.java
deleted file mode 100644
index d821a18f7..000000000
--- a/samples/filters/src/com/todoroo/andlib/Query.java
+++ /dev/null
@@ -1,197 +0,0 @@
-/**
- * Copyright (c) 2012 Todoroo Inc
- *
- * See the file "LICENSE" for the full license governing this code.
- */
-package com.todoroo.andlib;
-
-import static com.todoroo.andlib.Constants.ALL;
-import static com.todoroo.andlib.Constants.COMMA;
-import static com.todoroo.andlib.Constants.FROM;
-import static com.todoroo.andlib.Constants.GROUP_BY;
-import static com.todoroo.andlib.Constants.LEFT_PARENTHESIS;
-import static com.todoroo.andlib.Constants.ORDER_BY;
-import static com.todoroo.andlib.Constants.RIGHT_PARENTHESIS;
-import static com.todoroo.andlib.Constants.SELECT;
-import static com.todoroo.andlib.Constants.SPACE;
-import static com.todoroo.andlib.Constants.WHERE;
-import static com.todoroo.andlib.SqlTable.table;
-import static java.util.Arrays.asList;
-
-import java.util.ArrayList;
-
-import com.todoroo.astrid.data.Property;
-
-public final class Query {
-
- private SqlTable table;
- private String queryTemplate = null;
- private final ArrayList criterions = new ArrayList();
- private final ArrayList fields = new ArrayList();
- private final ArrayList joins = new ArrayList();
- private final ArrayList groupBies = new ArrayList();
- private final ArrayList orders = new ArrayList();
- private final ArrayList havings = new ArrayList();
-
- private Query(Field... fields) {
- this.fields.addAll(asList(fields));
- }
-
- public static Query select(Field... fields) {
- return new Query(fields);
- }
-
- public Query from(SqlTable fromTable) {
- this.table = fromTable;
- return this;
- }
-
- public Query join(Join... join) {
- joins.addAll(asList(join));
- return this;
- }
-
- public Query where(Criterion criterion) {
- criterions.add(criterion);
- return this;
- }
-
- public Query groupBy(Field... groupBy) {
- groupBies.addAll(asList(groupBy));
- return this;
- }
-
- public Query orderBy(Order... order) {
- orders.addAll(asList(order));
- return this;
- }
-
- public Query appendSelectFields(Property>... selectFields) {
- this.fields.addAll(asList(selectFields));
- return this;
- }
-
- @Override
- public boolean equals(Object o) {
- return this == o || !(o == null || getClass() != o.getClass()) && this.toString().equals(o.toString());
- }
-
- @Override
- public int hashCode() {
- return toString().hashCode();
- }
-
- @Override
- public String toString() {
- StringBuilder sql = new StringBuilder();
- visitSelectClause(sql);
- visitFromClause(sql);
-
- if(queryTemplate == null) {
- visitJoinClause(sql);
- visitWhereClause(sql);
- visitGroupByClause(sql);
- visitOrderByClause(sql);
- } else {
- if(joins.size() > 0 || groupBies.size() > 0 || orders.size() > 0 ||
- havings.size() > 0)
- throw new IllegalStateException("Can't have extras AND query template"); //$NON-NLS-1$
- sql.append(queryTemplate);
- }
-
- return sql.toString();
- }
-
- private void visitOrderByClause(StringBuilder sql) {
- if (orders.isEmpty()) {
- return;
- }
- sql.append(ORDER_BY);
- for (Order order : orders) {
- sql.append(SPACE).append(order).append(COMMA);
- }
- sql.deleteCharAt(sql.length() - 1).append(SPACE);
- }
-
- @SuppressWarnings("nls")
- private void visitGroupByClause(StringBuilder sql) {
- if (groupBies.isEmpty()) {
- return;
- }
- sql.append(GROUP_BY);
- for (Field groupBy : groupBies) {
- sql.append(SPACE).append(groupBy).append(COMMA);
- }
- sql.deleteCharAt(sql.length() - 1).append(SPACE);
- if (havings.isEmpty()) {
- return;
- }
- sql.append("HAVING");
- for (Criterion havingCriterion : havings) {
- sql.append(SPACE).append(havingCriterion).append(COMMA);
- }
- sql.deleteCharAt(sql.length() - 1).append(SPACE);
- }
-
- private void visitWhereClause(StringBuilder sql) {
- if (criterions.isEmpty()) {
- return;
- }
- sql.append(WHERE);
- for (Criterion criterion : criterions) {
- sql.append(SPACE).append(criterion).append(SPACE);
- }
- }
-
- private void visitJoinClause(StringBuilder sql) {
- for (Join join : joins) {
- sql.append(join).append(SPACE);
- }
- }
-
- private void visitFromClause(StringBuilder sql) {
- if (table == null) {
- return;
- }
- sql.append(FROM).append(SPACE).append(table).append(SPACE);
- }
-
- private void visitSelectClause(StringBuilder sql) {
- sql.append(SELECT).append(SPACE);
- if (fields.isEmpty()) {
- sql.append(ALL).append(SPACE);
- return;
- }
- for (Field field : fields) {
- sql.append(field.toStringInSelect()).append(COMMA);
- }
- sql.deleteCharAt(sql.length() - 1).append(SPACE);
- }
-
- public SqlTable as(String alias) {
- return table(LEFT_PARENTHESIS + this.toString() + RIGHT_PARENTHESIS).as(alias);
- }
-
- public Query having(Criterion criterion) {
- this.havings.add(criterion);
- return this;
- }
-
- /**
- * Gets a list of fields returned by this query
- * @return
- */
- public Property>[] getFields() {
- return fields.toArray(new Property>[fields.size()]);
- }
-
- /**
- * Add the SQL query template (comes after the "from")
- * @param sqlQuery
- * @return
- */
- public Query withQueryTemplate(String template) {
- queryTemplate = template;
- return this;
- }
-}
diff --git a/samples/filters/src/com/todoroo/andlib/QueryTemplate.java b/samples/filters/src/com/todoroo/andlib/QueryTemplate.java
deleted file mode 100644
index 5b039e1cd..000000000
--- a/samples/filters/src/com/todoroo/andlib/QueryTemplate.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/**
- * Copyright (c) 2012 Todoroo Inc
- *
- * See the file "LICENSE" for the full license governing this code.
- */
-package com.todoroo.andlib;
-
-import static com.todoroo.andlib.Constants.COMMA;
-import static com.todoroo.andlib.Constants.GROUP_BY;
-import static com.todoroo.andlib.Constants.LIMIT;
-import static com.todoroo.andlib.Constants.ORDER_BY;
-import static com.todoroo.andlib.Constants.SPACE;
-import static com.todoroo.andlib.Constants.WHERE;
-import static java.util.Arrays.asList;
-
-import java.util.ArrayList;
-
-/**
- * Query Template returns a bunch of criteria that allows a query to be
- * constructed
- *
- * @author Tim Su
- *
- */
-public final class QueryTemplate {
-
- private final ArrayList criterions = new ArrayList();
- private final ArrayList joins = new ArrayList();
- private final ArrayList groupBies = new ArrayList();
- private final ArrayList orders = new ArrayList();
- private final ArrayList havings = new ArrayList();
- private Integer limit = null;
-
- public QueryTemplate join(Join... join) {
- joins.addAll(asList(join));
- return this;
- }
-
- public QueryTemplate where(Criterion criterion) {
- criterions.add(criterion);
- return this;
- }
-
- public QueryTemplate groupBy(Field... groupBy) {
- groupBies.addAll(asList(groupBy));
- return this;
- }
-
- public QueryTemplate orderBy(Order... order) {
- orders.addAll(asList(order));
- return this;
- }
-
- @Override
- public String toString() {
- StringBuilder sql = new StringBuilder();
- visitJoinClause(sql);
- visitWhereClause(sql);
- visitGroupByClause(sql);
- visitOrderByClause(sql);
- if(limit != null)
- sql.append(LIMIT).append(SPACE).append(limit);
- return sql.toString();
- }
-
- private void visitOrderByClause(StringBuilder sql) {
- if (orders.isEmpty()) {
- return;
- }
- sql.append(ORDER_BY);
- for (Order order : orders) {
- sql.append(SPACE).append(order).append(COMMA);
- }
- sql.deleteCharAt(sql.length() - 1).append(SPACE);
- }
-
- @SuppressWarnings("nls")
- private void visitGroupByClause(StringBuilder sql) {
- if (groupBies.isEmpty()) {
- return;
- }
- sql.append(GROUP_BY);
- for (Field groupBy : groupBies) {
- sql.append(SPACE).append(groupBy).append(COMMA);
- }
- sql.deleteCharAt(sql.length() - 1).append(SPACE);
- if (havings.isEmpty()) {
- return;
- }
- sql.append("HAVING");
- for (Criterion havingCriterion : havings) {
- sql.append(SPACE).append(havingCriterion).append(COMMA);
- }
- sql.deleteCharAt(sql.length() - 1).append(SPACE);
- }
-
- private void visitWhereClause(StringBuilder sql) {
- if (criterions.isEmpty()) {
- return;
- }
- sql.append(WHERE);
- for (Criterion criterion : criterions) {
- sql.append(SPACE).append(criterion).append(SPACE);
- }
- }
-
- private void visitJoinClause(StringBuilder sql) {
- for (Join join : joins) {
- sql.append(join).append(SPACE);
- }
- }
-
- public QueryTemplate having(Criterion criterion) {
- this.havings.add(criterion);
- return this;
- }
-
- public QueryTemplate limit(int limitValue) {
- this.limit = limitValue;
- return this;
- }
-}
diff --git a/samples/filters/src/com/todoroo/andlib/SqlTable.java b/samples/filters/src/com/todoroo/andlib/SqlTable.java
deleted file mode 100644
index 19d2b43af..000000000
--- a/samples/filters/src/com/todoroo/andlib/SqlTable.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/**
- * Copyright (c) 2012 Todoroo Inc
- *
- * See the file "LICENSE" for the full license governing this code.
- */
-package com.todoroo.andlib;
-
-public class SqlTable extends DBObject {
-
- protected SqlTable(String expression) {
- super(expression);
- }
-
- public static SqlTable table(String table) {
- return new SqlTable(table);
- }
-
- @SuppressWarnings("nls")
- protected String fieldExpression(String fieldName) {
- if (hasAlias()) {
- return alias + "." + fieldName;
- }
- return expression+"."+fieldName;
- }
-}
diff --git a/samples/filters/src/com/todoroo/andlib/UnaryCriterion.java b/samples/filters/src/com/todoroo/andlib/UnaryCriterion.java
deleted file mode 100644
index f794c4d71..000000000
--- a/samples/filters/src/com/todoroo/andlib/UnaryCriterion.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/**
- * Copyright (c) 2012 Todoroo Inc
- *
- * See the file "LICENSE" for the full license governing this code.
- */
-package com.todoroo.andlib;
-
-import static com.todoroo.andlib.Constants.SPACE;
-
-public class UnaryCriterion extends Criterion {
- protected final Field expression;
- protected final Object value;
-
- UnaryCriterion(Field expression, Operator operator, Object value) {
- super(operator);
- this.expression = expression;
- this.value = value;
- }
-
- @Override
- protected void populate(StringBuilder sb) {
- beforePopulateOperator(sb);
- populateOperator(sb);
- afterPopulateOperator(sb);
- }
-
- public static Criterion eq(Field expression, Object value) {
- return new UnaryCriterion(expression, Operator.eq, value);
- }
-
- protected void beforePopulateOperator(StringBuilder sb) {
- sb.append(expression);
- }
-
- protected void populateOperator(StringBuilder sb) {
- sb.append(operator);
- }
-
- @SuppressWarnings("nls")
- protected void afterPopulateOperator(StringBuilder sb) {
- if(value == null)
- return;
- else if(value instanceof String)
- sb.append("'").append(sanitize((String) value)).append("'");
- else
- sb.append(value);
- }
-
- /**
- * Sanitize the given input for SQL
- * @param input
- * @return
- */
- @SuppressWarnings("nls")
- public static String sanitize(String input) {
- return input.replace("\\", "\\\\").replace("'", "\\'");
- }
-
- public static Criterion neq(Field field, Object value) {
- return new UnaryCriterion(field, Operator.neq, value);
- }
-
- public static Criterion gt(Field field, Object value) {
- return new UnaryCriterion(field, Operator.gt, value);
- }
-
- public static Criterion lt(Field field, Object value) {
- return new UnaryCriterion(field, Operator.lt, value);
- }
-
- public static Criterion isNull(Field field) {
- return new UnaryCriterion(field, Operator.isNull, null) {
- @Override
- protected void populateOperator(StringBuilder sb) {
- sb.append(SPACE).append(operator);
- }
- };
- }
-
- public static Criterion isNotNull(Field field) {
- return new UnaryCriterion(field, Operator.isNotNull, null) {
- @Override
- protected void populateOperator(StringBuilder sb) {
- sb.append(SPACE).append(operator);
- }
- };
- }
-
- public static Criterion like(Field field, String value) {
- return new UnaryCriterion(field, Operator.like, value) {
- @Override
- protected void populateOperator(StringBuilder sb) {
- sb.append(SPACE).append(operator).append(SPACE);
- }
- };
- }
-}
diff --git a/samples/filters/src/com/todoroo/astrid/api/Addon.java b/samples/filters/src/com/todoroo/astrid/api/Addon.java
deleted file mode 100644
index bf3e1ecaf..000000000
--- a/samples/filters/src/com/todoroo/astrid/api/Addon.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/**
- * Copyright (c) 2012 Todoroo Inc
- *
- * See the file "LICENSE" for the full license governing this code.
- */
-package com.todoroo.astrid.api;
-
-import android.os.Parcel;
-import android.os.Parcelable;
-
-/**
- * Represents an add-onn for Astrid. Users can enable or disable add-ons,
- * which affect all other extension points that share the same identifier.
- *
- * @author Tim Su
- *
- */
-public class Addon implements Parcelable {
-
- /**
- * Add-on Identifier
- */
- public String addon = null;
-
- /**
- * Plug-in Title
- */
- public String title = null;
-
- /**
- * Plug-in Author
- */
- public String author = null;
-
- /**
- * Plug-in Description
- */
- public String description = null;
-
- /**
- * Convenience constructor to generate a plug-in object
- *
- * @param addon
- * @param title
- * @param author
- * @param description
- */
- public Addon(String addon, String title, String author, String description) {
- this.addon = addon;
- this.title = title;
- this.author = author;
- this.description = description;
- }
-
- // --- parcelable helpers
-
-
- /**
- * {@inheritDoc}
- */
- public int describeContents() {
- return 0;
- }
-
- /**
- * {@inheritDoc}
- */
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeString(addon);
- dest.writeString(title);
- dest.writeString(author);
- dest.writeString(description);
- }
-
- /**
- * Parcelable creator
- */
- public static final Parcelable.Creator CREATOR = new Parcelable.Creator() {
- /**
- * {@inheritDoc}
- */
- public Addon createFromParcel(Parcel source) {
- return new Addon(source.readString(), source.readString(),
- source.readString(), source.readString());
- }
-
- /**
- * {@inheritDoc}
- */
- public Addon[] newArray(int size) {
- return new Addon[size];
- };
- };
-
-}
diff --git a/samples/filters/src/com/todoroo/astrid/api/AstridApiConstants.java b/samples/filters/src/com/todoroo/astrid/api/AstridApiConstants.java
deleted file mode 100644
index d2c651113..000000000
--- a/samples/filters/src/com/todoroo/astrid/api/AstridApiConstants.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/**
- * Copyright (c) 2012 Todoroo Inc
- *
- * See the file "LICENSE" for the full license governing this code.
- */
-package com.todoroo.astrid.api;
-
-import android.widget.RemoteViews;
-
-/**
- * Constants for interfacing with Astrid.
- *
- * @author Tim Su
- */
-@SuppressWarnings("nls")
-public class AstridApiConstants {
-
- // --- General Constants
-
- /**
- * Astrid application package name
- */
- public static final String PACKAGE = "com.todoroo.astrid";
-
- /**
- * Permission for reading tasks and receiving to GET_FILTERS intent
- */
- public static final String PERMISSION_READ = PACKAGE + ".READ";
-
- /**
- * Permission for writing and creating tasks
- */
- public static final String PERMISSION_WRITE = PACKAGE + ".WRITE";
-
- // --- Broadcast Extras
-
- /**
- * Extras name for task id
- */
- public static final String EXTRAS_TASK_ID = "task";
-
- /**
- * Extras name for a response item broadcast to astrid
- */
- public static final String EXTRAS_RESPONSE = "response";
-
- /**
- * Extras name for plug-in identifier
- */
- public static final String EXTRAS_ADDON = "addon";
-
- /**
- * Extras name for whether task detail request is extended
- */
- public static final String EXTRAS_EXTENDED = "extended";
-
- // --- Add-ons API
-
- /**
- * Action name for broadcast intent requesting add-ons
- */
- public static final String BROADCAST_REQUEST_ADDONS = PACKAGE + ".REQUEST_ADDONS";
-
- /**
- * Action name for broadcast intent sending add-ons back to Astrid
- * @extra EXTRAS_RESPONSE an {@link Addon} object
- */
- public static final String BROADCAST_SEND_ADDONS = PACKAGE + ".SEND_ADDONS";
-
- // --- Filters API
-
- /**
- * Action name for broadcast intent requesting filters
- */
- public static final String BROADCAST_REQUEST_FILTERS = PACKAGE + ".REQUEST_FILTERS";
-
- /**
- * Action name for broadcast intent sending filters back to Astrid
- * @extra EXTRAS_ADDON your add-on identifier
- * @extra EXTRAS_RESPONSE an array of {@link FilterListItem}s
- */
- public static final String BROADCAST_SEND_FILTERS = PACKAGE + ".SEND_FILTERS";
-
- // --- Edit Controls API
-
- /**
- * Action name for broadcast intent requesting task edit controls
- * @extra EXTRAS_TASK_ID id of the task user is editing
- */
- public static final String BROADCAST_REQUEST_EDIT_CONTROLS = PACKAGE + ".REQUEST_EDIT_CONTROLS";
-
- /**
- * Action name for broadcast intent sending task edit controls back to Astrid
- * @extra EXTRAS_ADDON your add-on identifier
- * @extra EXTRAS_RESPONSE a {@link RemoteViews} with your edit controls
- */
- public static final String BROADCAST_SEND_EDIT_CONTROLS = PACKAGE + ".SEND_EDIT_CONTROLS";
-
- // --- Task Details API
-
- /**
- * Action name for broadcast intent requesting details for a task.
- * Extended details are displayed when a user presses on a task.
- *
- * @extra EXTRAS_TASK_ID id of the task
- * @extra EXTRAS_EXTENDED whether request is for standard or extended details
- */
- public static final String BROADCAST_REQUEST_DETAILS = PACKAGE + ".REQUEST_DETAILS";
-
- /**
- * Action name for broadcast intent sending details back to Astrid
- * @extra EXTRAS_ADDON your add-on identifier
- * @extra EXTRAS_TASK_ID id of the task
- * @extra EXTRAS_EXTENDED whether request is for standard or extended details
- * @extra EXTRAS_RESPONSE a String
- */
- public static final String BROADCAST_SEND_DETAILS = PACKAGE + ".SEND_DETAILS";
-
- // --- Task Actions API
-
- /**
- * Action name for broadcast intent requesting actions for a task
- * @extra EXTRAS_TASK_ID id of the task
- */
- public static final String BROADCAST_REQUEST_ACTIONS = PACKAGE + ".REQUEST_ACTIONS";
-
- /**
- * Action name for broadcast intent sending actions back to Astrid
- * @extra EXTRAS_ADDON your add-on identifier
- * @extra EXTRAS_TASK_ID id of the task
- * @extra EXTRAS_RESPONSE a String
- */
- public static final String BROADCAST_SEND_ACTIONS = PACKAGE + ".SEND_ACTIONS";
-
- // --- Task Decorations API
-
- /**
- * Action name for broadcast intent requesting task list decorations for a task
- * @extra EXTRAS_TASK_ID id of the task
- */
- public static final String BROADCAST_REQUEST_DECORATIONS = PACKAGE + ".REQUEST_DECORATIONS";
-
- /**
- * Action name for broadcast intent sending decorations back to Astrid
- * @extra EXTRAS_ADDON your add-on identifier
- * @extra EXTRAS_TASK_ID id of the task
- * @extra EXTRAS_RESPONSE a {@link TaskDecoration}
- */
- public static final String BROADCAST_SEND_DECORATIONS = PACKAGE + ".SEND_DECORATIONS";
-
- // --- Actions API
-
- /**
- * Action name for intents to be displayed on task context menu
- * @extra EXTRAS_TASK_ID id of the task
- */
- public static final String ACTION_TASK_CONTEXT_MENU = PACKAGE + ".CONTEXT_MENU";
-
- /**
- * Action name for intents to be displayed on Astrid's task list menu
- * @extra EXTRAS_ADDON your add-on identifier
- * @extra EXTRAS_RESPONSE an array of {@link Intent}s
- */
- public static final String ACTION_TASK_LIST_MENU = PACKAGE + ".TASK_LIST_MENU";
-
- // --- Settings API
-
- /**
- * Action name for intents to be displayed in Astrid's settings
- */
- public static final String ACTION_SETTINGS = PACKAGE + ".SETTINGS";
-
- // --- Events API
-
- /**
- * Action name for broadcast intent notifying that task was completed
- * @extra EXTRAS_TASK_ID id of the task
- */
- public static final String BROADCAST_EVENT_TASK_COMPLETED = PACKAGE + ".TASK_COMPLETED";
-
- /**
- * Action name for broadcast intent notifying that task was created
- * @extra EXTRAS_TASK_ID id of the task
- */
- public static final String BROADCAST_EVENT_TASK_CREATED = PACKAGE + ".TASK_CREATED";
-
- // --- SQL Constants
-
- /**
- * Table name for tasks
- */
- public static final String TASK_TABLE = "tasks";
-
- /**
- * Table name for metadata
- */
- public static final String METADATA_TABLE = "metadata";
-
-}
diff --git a/samples/filters/src/com/todoroo/astrid/api/Filter.java b/samples/filters/src/com/todoroo/astrid/api/Filter.java
deleted file mode 100644
index 6678529fe..000000000
--- a/samples/filters/src/com/todoroo/astrid/api/Filter.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/**
- * Copyright (c) 2012 Todoroo Inc
- *
- * See the file "LICENSE" for the full license governing this code.
- */
-package com.todoroo.astrid.api;
-
-import android.content.ContentValues;
-import android.os.Parcel;
-import android.os.Parcelable;
-
-import com.todoroo.andlib.QueryTemplate;
-
-/**
- * A FilterListFilter allows users to display tasks that have
- * something in common.
- *
- * A plug-in can expose new FilterListFilters to the system by
- * responding to the com.todoroo.astrid.GET_FILTERS broadcast
- * intent.
- *
- * @author Tim Su
- *
- */
-public final class Filter extends FilterListItem {
-
- // --- constants
-
- /** Constant for valuesForNewTasks to indicate the value should be replaced
- * with the current time as long */
- public static final long VALUE_NOW = Long.MIN_VALUE + 1;
-
- // --- instance variables
-
- /**
- * Expanded title of this filter. This is displayed at the top
- * of the screen when user is viewing this filter.
- *
- * e.g "Tasks With Notes"
- */
- public String title;
-
- /**
- * SQL query for this filter. The query will be appended to the select
- * statement after "SELECT fields FROM table %s". It is
- * recommended that you use a {@link QueryTemplate} to construct your
- * query.
- *
- * Examples:
- *
- * "WHERE completionDate = 0"
- * "INNER JOIN " +
- * Constants.TABLE_METADATA + " ON metadata.task = tasks.id WHERE
- * metadata.namespace = " + NAMESPACE + " AND metadata.key = 'a' AND
- * metadata.value = 'b' GROUP BY tasks.id ORDER BY tasks.title"
- *
- */
- public String sqlQuery;
-
- /**
- * Values to apply to a task when quick-adding a task from this filter.
- * For example, when a user views tasks tagged 'ABC', the
- * tasks they create should also be tagged 'ABC'. If set to null, no
- * additional values will be stored for a task.
- */
- public ContentValues valuesForNewTasks = null;
-
- /**
- * Utility constructor for creating a TaskList object
- * @param listingTitle
- * Title of this item as displayed on the lists page, e.g. Inbox
- * @param title
- * Expanded title of this filter when user is viewing this
- * filter, e.g. Inbox (20 tasks)
- * @param sqlQuery
- * SQL query for this list (see {@link sqlQuery} for examples).
- * @param valuesForNewTasks
- * see {@link sqlForNewTasks}
- */
- public Filter(String listingTitle, String title,
- QueryTemplate sqlQuery, ContentValues valuesForNewTasks) {
- this.listingTitle = listingTitle;
- this.title = title;
- if(sqlQuery != null)
- this.sqlQuery = sqlQuery.toString();
- this.valuesForNewTasks = valuesForNewTasks;
- }
-
- /**
- * Utility constructor
- *
- * @param plugin
- * {@link Addon} identifier that encompasses object
- */
- protected Filter() {
- // do nothing
- }
-
- // --- parcelable
-
- /**
- * {@inheritDoc}
- */
- public int describeContents() {
- return 0;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void writeToParcel(Parcel dest, int flags) {
- super.writeToParcel(dest, flags);
- dest.writeString(title);
- dest.writeString(sqlQuery);
- dest.writeParcelable(valuesForNewTasks, 0);
- }
-
- /**
- * Parcelable Creator Object
- */
- public static final Parcelable.Creator CREATOR = new Parcelable.Creator() {
-
- /**
- * {@inheritDoc}
- */
- public Filter createFromParcel(Parcel source) {
- Filter item = new Filter();
- item.readFromParcel(source);
- item.title = source.readString();
- item.sqlQuery = source.readString();
- item.valuesForNewTasks = source.readParcelable(ContentValues.class.getClassLoader());
- return item;
- }
-
- /**
- * {@inheritDoc}
- */
- public Filter[] newArray(int size) {
- return new Filter[size];
- }
-
- };
-}
diff --git a/samples/filters/src/com/todoroo/astrid/api/FilterCategory.java b/samples/filters/src/com/todoroo/astrid/api/FilterCategory.java
deleted file mode 100644
index cdca14ff3..000000000
--- a/samples/filters/src/com/todoroo/astrid/api/FilterCategory.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/**
- * Copyright (c) 2012 Todoroo Inc
- *
- * See the file "LICENSE" for the full license governing this code.
- */
-package com.todoroo.astrid.api;
-
-import android.os.Parcel;
-import android.os.Parcelable;
-
-/**
- * A FilterCategory groups common {@link Filter}s and allows
- * a user to show/hide all of its children.
- *
- * @author Tim Su
- *
- */
-public class FilterCategory extends FilterListItem {
-
- /**
- * {@link Filter}s contained by this category
- */
- public Filter[] children;
-
- /**
- * Constructor for creating a new FilterCategory
- * @param listingTitle
- * Title of this item as displayed on the lists page, e.g. Inbox
- * @param children
- * filters belonging to this category
- */
- public FilterCategory(String listingTitle, Filter[] children) {
- this.listingTitle = listingTitle;
- this.children = children;
- }
-
- /**
- * Constructor for creating a new FilterCategory
- *
- * @param plugin
- * {@link Addon} identifier that encompasses object
- */
- protected FilterCategory() {
- //
- }
-
- // --- parcelable
-
- /**
- * {@inheritDoc}
- */
- public int describeContents() {
- return 0;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void writeToParcel(Parcel dest, int flags) {
- super.writeToParcel(dest, flags);
- dest.writeParcelableArray(children, 0);
- }
-
- /**
- * Parcelable creator
- */
- public static final Parcelable.Creator CREATOR = new Parcelable.Creator() {
-
- /**
- * {@inheritDoc}
- */
- public FilterCategory createFromParcel(Parcel source) {
- FilterCategory item = new FilterCategory();
- item.readFromParcel(source);
-
- Parcelable[] parcelableChildren = source.readParcelableArray(
- FilterCategory.class.getClassLoader());
- item.children = new Filter[parcelableChildren.length];
- for(int i = 0; i < item.children.length; i++) {
- if(parcelableChildren[i] instanceof FilterListItem)
- item.children[i] = (Filter) parcelableChildren[i];
- else
- item.children[i] = null;
- }
-
- return item;
- }
-
- /**
- * {@inheritDoc}
- */
- public FilterCategory[] newArray(int size) {
- return new FilterCategory[size];
- }
-
- };
-}
diff --git a/samples/filters/src/com/todoroo/astrid/api/FilterListHeader.java b/samples/filters/src/com/todoroo/astrid/api/FilterListHeader.java
deleted file mode 100644
index 06e0b064c..000000000
--- a/samples/filters/src/com/todoroo/astrid/api/FilterListHeader.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/**
- * Copyright (c) 2012 Todoroo Inc
- *
- * See the file "LICENSE" for the full license governing this code.
- */
-package com.todoroo.astrid.api;
-
-import android.os.Parcel;
-import android.os.Parcelable;
-
-/**
- * Section Header for Filter List
- *
- * @author Tim Su
- *
- */
-public class FilterListHeader extends FilterListItem {
-
- /**
- * Constructor for creating a new FilterListHeader
- * @param listingTitle
- * @param listingIconResource
- * @param priority
- */
- public FilterListHeader(String listingTitle) {
- this.listingTitle = listingTitle;
- }
-
- /**
- * Constructor for creating a new FilterListHeader
- *
- * @param plugin
- * {@link Addon} identifier that encompasses object
- */
- protected FilterListHeader() {
- //
- }
-
- // --- parcelable
-
- public int describeContents() {
- return 0;
- }
-
- @Override
- public void writeToParcel(Parcel dest, int flags) {
- super.writeToParcel(dest, flags);
- }
-
- public static final Parcelable.Creator CREATOR = new Parcelable.Creator() {
-
- public FilterListHeader createFromParcel(Parcel source) {
- FilterListHeader item = new FilterListHeader();
- item.readFromParcel(source);
- return item;
- }
-
- public FilterListHeader[] newArray(int size) {
- return new FilterListHeader[size];
- }
-
- };
-}
diff --git a/samples/filters/src/com/todoroo/astrid/api/FilterListItem.java b/samples/filters/src/com/todoroo/astrid/api/FilterListItem.java
deleted file mode 100644
index 5dca6786f..000000000
--- a/samples/filters/src/com/todoroo/astrid/api/FilterListItem.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/**
- * Copyright (c) 2012 Todoroo Inc
- *
- * See the file "LICENSE" for the full license governing this code.
- */
-package com.todoroo.astrid.api;
-
-import android.content.Intent;
-import android.graphics.Bitmap;
-import android.os.Parcel;
-import android.os.Parcelable;
-
-/**
- * Represents an item displayed by Astrid's FilterListActivity
- *
- * @author Tim Su
- *
- */
-abstract public class FilterListItem implements Parcelable {
-
- /**
- * Title of this item displayed on the Filters page
- */
- public String listingTitle = null;
-
- /**
- * Bitmap for icon used on listing page. null => no icon
- */
- public Bitmap listingIcon = null;
-
- /**
- * Context Menu labels. The context menu will be displayed when users
- * long-press on this filter list item.
- */
- public String contextMenuLabels[] = new String[0];
-
- /**
- * Context menu intents. This intent will be started when the corresponding
- * content menu label is invoked. This array must be the same size as
- * the contextMenuLabels array.
- */
- public Intent contextMenuIntents[] = new Intent[0];
-
- // --- parcelable helpers
-
- /**
- * {@inheritDoc}
- */
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeString(listingTitle);
- dest.writeParcelable(listingIcon, 0);
-
- // write array lengths before arrays
- dest.writeInt(contextMenuLabels.length);
- dest.writeStringArray(contextMenuLabels);
- dest.writeInt(contextMenuIntents.length);
- dest.writeTypedArray(contextMenuIntents, 0);
- }
-
- /**
- * Utility method to read FilterListItem properties from a parcel.
- *
- * @param source
- */
- public void readFromParcel(Parcel source) {
- listingTitle = source.readString();
- listingIcon = source.readParcelable(Bitmap.class.getClassLoader());
-
- int length = source.readInt();
- contextMenuLabels = new String[length];
- source.readStringArray(contextMenuLabels);
- length = source.readInt();
- contextMenuIntents = new Intent[length];
- source.readTypedArray(contextMenuIntents, Intent.CREATOR);
- }
-}
diff --git a/samples/filters/src/com/todoroo/astrid/api/TaskAction.java b/samples/filters/src/com/todoroo/astrid/api/TaskAction.java
deleted file mode 100644
index 570ab88a0..000000000
--- a/samples/filters/src/com/todoroo/astrid/api/TaskAction.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/**
- * Copyright (c) 2012 Todoroo Inc
- *
- * See the file "LICENSE" for the full license governing this code.
- */
-package com.todoroo.astrid.api;
-
-import android.app.PendingIntent;
-import android.os.Parcel;
-import android.os.Parcelable;
-
-/**
- * Represents an intent that can be called on a task
- *
- * @author Tim Su
- *
- */
-public class TaskAction implements Parcelable {
-
- /**
- * Label
- */
- public String text = null;
-
- /**
- * Intent to call when invoking this operation
- */
- public PendingIntent intent = null;
-
- /**
- * Create an EditOperation object
- *
- * @param text
- * label to display
- * @param intent
- * intent to invoke. {@link EXTRAS_TASK_ID} will be passed
- */
- public TaskAction(String text, PendingIntent intent) {
- super();
- this.text = text;
- this.intent = intent;
- }
-
- // --- parcelable helpers
-
- /**
- * {@inheritDoc}
- */
- public int describeContents() {
- return 0;
- }
-
- /**
- * {@inheritDoc}
- */
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeString(text);
- dest.writeParcelable(intent, 0);
- }
-
- /**
- * Parcelable creator
- */
- public static final Parcelable.Creator CREATOR = new Parcelable.Creator() {
- /**
- * {@inheritDoc}
- */
- public TaskAction createFromParcel(Parcel source) {
- return new TaskAction(source.readString(), (PendingIntent)source.readParcelable(
- PendingIntent.class.getClassLoader()));
- }
-
- /**
- * {@inheritDoc}
- */
- public TaskAction[] newArray(int size) {
- return new TaskAction[size];
- };
- };
-
-}
diff --git a/samples/filters/src/com/todoroo/astrid/api/TaskDecoration.java b/samples/filters/src/com/todoroo/astrid/api/TaskDecoration.java
deleted file mode 100644
index 2d9d8a373..000000000
--- a/samples/filters/src/com/todoroo/astrid/api/TaskDecoration.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/**
- * Copyright (c) 2012 Todoroo Inc
- *
- * See the file "LICENSE" for the full license governing this code.
- */
-package com.todoroo.astrid.api;
-
-import android.os.Parcel;
-import android.os.Parcelable;
-import android.widget.RemoteViews;
-import android.widget.RemoteViews.RemoteView;
-
-/**
- * Represents a line of text displayed in the Task List
- *
- * @author Tim Su
- *
- */
-public final class TaskDecoration implements Parcelable {
-
- /**
- * Place decoration between completion box and task title
- */
- public static final int POSITION_LEFT = 0;
-
- /**
- * Place decoration between task title and importance bar
- */
- public static final int POSITION_RIGHT = 1;
-
- /**
- * {@link RemoteView} decoration
- */
- public RemoteViews decoration = null;
-
- /**
- * Decoration position
- */
- public int position = POSITION_LEFT;
-
- /**
- * Decorated task background color. 0 is default
- */
- public int color = 0;
-
- /**
- * Creates a TaskDetail object
- * @param text
- * text to display
- * @param color
- * color to use for text. Use