added handling of onclicks for each social site.
also handled removal of sites. also removed locationlib. There are too many issues with skyhook. Since this project does not use skyhook I will handle location internally. had to make a small modification to Add Social Site preference. For some reason the key value changed. works now.
This commit is contained in:
@@ -3,13 +3,7 @@
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="src" path="gen"/>
|
||||
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
|
||||
<classpathentry kind="lib" path="/LocationLib/lib/wpsapi.jar">
|
||||
<attributes>
|
||||
<attribute name="javadoc_location" value="http://tcdevsvn1/ShyHookdocumentation"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="lib" path="/Users/warren/Development/workspace/TravelPost/libs/twitter4j-core-2.1.11.jar"/>
|
||||
<classpathentry kind="src" path="LocationLib_src"/>
|
||||
<classpathentry kind="src" path="ExceptionHandlerLib_src"/>
|
||||
<classpathentry kind="src" path="FacebookLib_src"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
|
||||
@@ -41,10 +41,5 @@
|
||||
<type>2</type>
|
||||
<locationURI>_android_FacebookLib_9c84f9bf/src</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>LocationLib_src</name>
|
||||
<type>2</type>
|
||||
<locationURI>_android_LocationLib_84551a70/src</locationURI>
|
||||
</link>
|
||||
</linkedResources>
|
||||
</projectDescription>
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
#Sun Jul 17 17:40:10 EDT 2011
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false
|
||||
@@ -1,6 +1,6 @@
|
||||
renamed Twitter.java to TwitterServices.java and copied code from original TwitterServices.java (why change what works?)
|
||||
added thread needed to start twitter authorization to TravelPostMain.java. Created TwitterWebAuth.java and twitterwebauth.xml
|
||||
modified some strings to better explain failure points.
|
||||
added handling of onclicks for each social site.
|
||||
also handled removal of sites.
|
||||
|
||||
tested and working for authorization.
|
||||
also removed locationlib. There are too many issues with skyhook. Since this project does not use skyhook I will handle location internally.
|
||||
|
||||
had to make a small modification to Add Social Site preference. For some reason the key value changed. works now.
|
||||
@@ -9,6 +9,5 @@
|
||||
|
||||
# Project target.
|
||||
target=Google Inc.:Google APIs:12
|
||||
android.library.reference.3=../LocationLib
|
||||
android.library.reference.1=../ExceptionHandlerLib
|
||||
android.library.reference.2=../FacebookLib
|
||||
|
||||
@@ -1,95 +0,0 @@
|
||||
/* AUTO-GENERATED FILE. DO NOT MODIFY.
|
||||
*
|
||||
* This class was automatically generated by the
|
||||
* aapt tool from the resource data it found. It
|
||||
* should not be modified by hand.
|
||||
*/
|
||||
|
||||
package com.TwentyCodes.android.SkyHook;
|
||||
|
||||
public final class R {
|
||||
public static final class array {
|
||||
public static final int accuracy_entries=0x7f060000;
|
||||
public static final int accuracy_values=0x7f060001;
|
||||
}
|
||||
public static final class attr {
|
||||
}
|
||||
public static final class drawable {
|
||||
public static final int compass=0x7f020000;
|
||||
public static final int facebook_icon=0x7f020001;
|
||||
public static final int icon=0x7f020002;
|
||||
public static final int logoidea3=0x7f020003;
|
||||
public static final int needle=0x7f020004;
|
||||
public static final int notification=0x7f020005;
|
||||
public static final int skyhook_logo=0x7f020006;
|
||||
public static final int skyhook_logo_alpha=0x7f020007;
|
||||
public static final int skyhook_logo_alpha_small=0x7f020008;
|
||||
public static final int tc_logo_complete=0x7f020009;
|
||||
public static final int user=0x7f02000a;
|
||||
public static final int widget=0x7f02000b;
|
||||
}
|
||||
public static final class id {
|
||||
public static final int authCode=0x7f070004;
|
||||
public static final int authOkButton=0x7f070003;
|
||||
public static final int authWebView=0x7f070005;
|
||||
public static final int skyhook_img=0x7f070000;
|
||||
public static final int socialsites=0x7f070006;
|
||||
public static final int tc_img=0x7f070002;
|
||||
public static final int text=0x7f070001;
|
||||
}
|
||||
public static final class layout {
|
||||
public static final int facebookactivity=0x7f030000;
|
||||
public static final int powered_by_skyhook=0x7f030001;
|
||||
public static final int twitterwebauth=0x7f030002;
|
||||
}
|
||||
public static final class string {
|
||||
public static final int about=0x7f050005;
|
||||
public static final int about_info=0x7f050006;
|
||||
public static final int about_verify=0x7f050007;
|
||||
public static final int accuracy=0x7f050008;
|
||||
public static final int accuracy_info=0x7f050009;
|
||||
public static final int add_social_site=0x7f05000a;
|
||||
public static final int app_name=0x7f050000;
|
||||
public static final int cancel_service=0x7f05000b;
|
||||
public static final int check_in_at=0x7f05000c;
|
||||
public static final int clear=0x7f05000d;
|
||||
public static final int crash=0x7f050003;
|
||||
public static final int disable_facebook_checkin=0x7f05000e;
|
||||
public static final int enable_facebook_checkin=0x7f05000f;
|
||||
public static final int facebook=0x7f050010;
|
||||
public static final int facebook_already_authorized=0x7f050011;
|
||||
public static final int facebook_authorization_failure=0x7f050012;
|
||||
public static final int facebook_options=0x7f050013;
|
||||
public static final int facebook_session_not_valid=0x7f050014;
|
||||
public static final int fb_signin=0x7f050015;
|
||||
public static final int gathering=0x7f05001c;
|
||||
public static final int gps_fix=0x7f050001;
|
||||
public static final int loading=0x7f050016;
|
||||
public static final int location_settings=0x7f050017;
|
||||
public static final int poor_data_connection=0x7f05001e;
|
||||
public static final int post_hint=0x7f050018;
|
||||
public static final int post_lenght=0x7f050019;
|
||||
public static final int post_settings=0x7f05001d;
|
||||
public static final int post_to_long=0x7f05001a;
|
||||
public static final int posting=0x7f05001b;
|
||||
public static final int remove_facebook=0x7f05001f;
|
||||
public static final int remove_facebook_confirmation=0x7f050020;
|
||||
public static final int remove_site_title=0x7f050021;
|
||||
public static final int remove_twitter=0x7f050022;
|
||||
public static final int save_a_post=0x7f050023;
|
||||
public static final int social_site=0x7f050024;
|
||||
public static final int sorry=0x7f050004;
|
||||
public static final int sorry_theres_trouble=0x7f050002;
|
||||
public static final int twitter=0x7f050025;
|
||||
public static final int twitter_already_authorized=0x7f050026;
|
||||
public static final int twitter_authorization_failure=0x7f050027;
|
||||
public static final int twitter_exception=0x7f050028;
|
||||
public static final int twitter_signin=0x7f050029;
|
||||
public static final int update=0x7f05002a;
|
||||
public static final int verify_message=0x7f05002b;
|
||||
public static final int verify_post=0x7f05002c;
|
||||
}
|
||||
public static final class xml {
|
||||
public static final int travelpostmain=0x7f040000;
|
||||
}
|
||||
}
|
||||
@@ -15,75 +15,63 @@ public final class R {
|
||||
public static final class attr {
|
||||
}
|
||||
public static final class drawable {
|
||||
public static final int compass=0x7f020000;
|
||||
public static final int facebook_icon=0x7f020001;
|
||||
public static final int icon=0x7f020002;
|
||||
public static final int logoidea3=0x7f020003;
|
||||
public static final int needle=0x7f020004;
|
||||
public static final int notification=0x7f020005;
|
||||
public static final int skyhook_logo=0x7f020006;
|
||||
public static final int skyhook_logo_alpha=0x7f020007;
|
||||
public static final int skyhook_logo_alpha_small=0x7f020008;
|
||||
public static final int tc_logo_complete=0x7f020009;
|
||||
public static final int user=0x7f02000a;
|
||||
public static final int widget=0x7f02000b;
|
||||
public static final int facebook_icon=0x7f020000;
|
||||
public static final int icon=0x7f020001;
|
||||
public static final int notification=0x7f020002;
|
||||
public static final int widget=0x7f020003;
|
||||
}
|
||||
public static final class id {
|
||||
public static final int authCode=0x7f070004;
|
||||
public static final int authOkButton=0x7f070003;
|
||||
public static final int authWebView=0x7f070005;
|
||||
public static final int skyhook_img=0x7f070000;
|
||||
public static final int socialsites=0x7f070006;
|
||||
public static final int tc_img=0x7f070002;
|
||||
public static final int text=0x7f070001;
|
||||
public static final int authCode=0x7f070001;
|
||||
public static final int authOkButton=0x7f070000;
|
||||
public static final int authWebView=0x7f070002;
|
||||
public static final int socialsites=0x7f070003;
|
||||
}
|
||||
public static final class layout {
|
||||
public static final int facebookactivity=0x7f030000;
|
||||
public static final int powered_by_skyhook=0x7f030001;
|
||||
public static final int twitterwebauth=0x7f030002;
|
||||
public static final int twitterwebauth=0x7f030001;
|
||||
}
|
||||
public static final class string {
|
||||
public static final int about=0x7f050005;
|
||||
public static final int about_info=0x7f050006;
|
||||
public static final int about_verify=0x7f050007;
|
||||
public static final int accuracy=0x7f050008;
|
||||
public static final int accuracy_info=0x7f050009;
|
||||
public static final int add_social_site=0x7f05000a;
|
||||
public static final int app_name=0x7f050000;
|
||||
public static final int cancel_service=0x7f05000b;
|
||||
public static final int check_in_at=0x7f05000c;
|
||||
public static final int clear=0x7f05000d;
|
||||
public static final int crash=0x7f050003;
|
||||
public static final int disable_facebook_checkin=0x7f05000e;
|
||||
public static final int enable_facebook_checkin=0x7f05000f;
|
||||
public static final int facebook=0x7f050010;
|
||||
public static final int facebook_already_authorized=0x7f050011;
|
||||
public static final int facebook_authorization_failure=0x7f050012;
|
||||
public static final int facebook_options=0x7f050013;
|
||||
public static final int facebook_session_not_valid=0x7f050014;
|
||||
public static final int fb_signin=0x7f050015;
|
||||
public static final int gathering=0x7f05001c;
|
||||
public static final int gps_fix=0x7f050001;
|
||||
public static final int loading=0x7f050016;
|
||||
public static final int location_settings=0x7f050017;
|
||||
public static final int poor_data_connection=0x7f05001e;
|
||||
public static final int post_hint=0x7f050018;
|
||||
public static final int post_lenght=0x7f050019;
|
||||
public static final int post_settings=0x7f05001d;
|
||||
public static final int post_to_long=0x7f05001a;
|
||||
public static final int posting=0x7f05001b;
|
||||
public static final int remove_facebook=0x7f05001f;
|
||||
public static final int remove_facebook_confirmation=0x7f050020;
|
||||
public static final int remove_site_title=0x7f050021;
|
||||
public static final int remove_twitter=0x7f050022;
|
||||
public static final int save_a_post=0x7f050023;
|
||||
public static final int social_site=0x7f050024;
|
||||
public static final int sorry=0x7f050004;
|
||||
public static final int sorry_theres_trouble=0x7f050002;
|
||||
public static final int twitter=0x7f050025;
|
||||
public static final int twitter_already_authorized=0x7f050026;
|
||||
public static final int twitter_authorization_failure=0x7f050027;
|
||||
public static final int twitter_exception=0x7f050028;
|
||||
public static final int about=0x7f050002;
|
||||
public static final int about_info=0x7f050003;
|
||||
public static final int about_verify=0x7f050004;
|
||||
public static final int accuracy=0x7f050005;
|
||||
public static final int accuracy_info=0x7f050006;
|
||||
public static final int add_social_site=0x7f050007;
|
||||
public static final int app_name=0x7f050008;
|
||||
public static final int cancel_service=0x7f050009;
|
||||
public static final int check_in_at=0x7f05000a;
|
||||
public static final int clear=0x7f05000b;
|
||||
public static final int crash=0x7f050000;
|
||||
public static final int disable_facebook_checkin=0x7f05000c;
|
||||
public static final int enable_facebook_checkin=0x7f05000d;
|
||||
public static final int facebook=0x7f05000e;
|
||||
public static final int facebook_already_authorized=0x7f05000f;
|
||||
public static final int facebook_authorization_failure=0x7f050010;
|
||||
public static final int facebook_options=0x7f050011;
|
||||
public static final int facebook_session_not_valid=0x7f050012;
|
||||
public static final int fb_signin=0x7f050013;
|
||||
public static final int gathering=0x7f05001a;
|
||||
public static final int loading=0x7f050014;
|
||||
public static final int location_settings=0x7f050015;
|
||||
public static final int poor_data_connection=0x7f05001c;
|
||||
public static final int post_hint=0x7f050016;
|
||||
public static final int post_lenght=0x7f050017;
|
||||
public static final int post_settings=0x7f05001b;
|
||||
public static final int post_to_long=0x7f050018;
|
||||
public static final int posting=0x7f050019;
|
||||
public static final int remove_facebook=0x7f05001d;
|
||||
public static final int remove_facebook_confirmation=0x7f05001e;
|
||||
public static final int remove_site_title=0x7f05001f;
|
||||
public static final int remove_twitter=0x7f050020;
|
||||
public static final int remove_twitter_confirmation=0x7f050021;
|
||||
public static final int save_a_post=0x7f050022;
|
||||
public static final int social_site=0x7f050023;
|
||||
public static final int sorry=0x7f050001;
|
||||
public static final int twitter=0x7f050024;
|
||||
public static final int twitter_already_authorized=0x7f050025;
|
||||
public static final int twitter_authorization_failure=0x7f050026;
|
||||
public static final int twitter_exception=0x7f050027;
|
||||
public static final int twitter_options=0x7f050028;
|
||||
public static final int twitter_signin=0x7f050029;
|
||||
public static final int update=0x7f05002a;
|
||||
public static final int verify_message=0x7f05002b;
|
||||
|
||||
@@ -15,75 +15,63 @@ public final class R {
|
||||
public static final class attr {
|
||||
}
|
||||
public static final class drawable {
|
||||
public static final int compass=0x7f020000;
|
||||
public static final int facebook_icon=0x7f020001;
|
||||
public static final int icon=0x7f020002;
|
||||
public static final int logoidea3=0x7f020003;
|
||||
public static final int needle=0x7f020004;
|
||||
public static final int notification=0x7f020005;
|
||||
public static final int skyhook_logo=0x7f020006;
|
||||
public static final int skyhook_logo_alpha=0x7f020007;
|
||||
public static final int skyhook_logo_alpha_small=0x7f020008;
|
||||
public static final int tc_logo_complete=0x7f020009;
|
||||
public static final int user=0x7f02000a;
|
||||
public static final int widget=0x7f02000b;
|
||||
public static final int facebook_icon=0x7f020000;
|
||||
public static final int icon=0x7f020001;
|
||||
public static final int notification=0x7f020002;
|
||||
public static final int widget=0x7f020003;
|
||||
}
|
||||
public static final class id {
|
||||
public static final int authCode=0x7f070004;
|
||||
public static final int authOkButton=0x7f070003;
|
||||
public static final int authWebView=0x7f070005;
|
||||
public static final int skyhook_img=0x7f070000;
|
||||
public static final int socialsites=0x7f070006;
|
||||
public static final int tc_img=0x7f070002;
|
||||
public static final int text=0x7f070001;
|
||||
public static final int authCode=0x7f070001;
|
||||
public static final int authOkButton=0x7f070000;
|
||||
public static final int authWebView=0x7f070002;
|
||||
public static final int socialsites=0x7f070003;
|
||||
}
|
||||
public static final class layout {
|
||||
public static final int facebookactivity=0x7f030000;
|
||||
public static final int powered_by_skyhook=0x7f030001;
|
||||
public static final int twitterwebauth=0x7f030002;
|
||||
public static final int twitterwebauth=0x7f030001;
|
||||
}
|
||||
public static final class string {
|
||||
public static final int about=0x7f050005;
|
||||
public static final int about_info=0x7f050006;
|
||||
public static final int about_verify=0x7f050007;
|
||||
public static final int accuracy=0x7f050008;
|
||||
public static final int accuracy_info=0x7f050009;
|
||||
public static final int add_social_site=0x7f05000a;
|
||||
public static final int app_name=0x7f050000;
|
||||
public static final int cancel_service=0x7f05000b;
|
||||
public static final int check_in_at=0x7f05000c;
|
||||
public static final int clear=0x7f05000d;
|
||||
public static final int crash=0x7f050003;
|
||||
public static final int disable_facebook_checkin=0x7f05000e;
|
||||
public static final int enable_facebook_checkin=0x7f05000f;
|
||||
public static final int facebook=0x7f050010;
|
||||
public static final int facebook_already_authorized=0x7f050011;
|
||||
public static final int facebook_authorization_failure=0x7f050012;
|
||||
public static final int facebook_options=0x7f050013;
|
||||
public static final int facebook_session_not_valid=0x7f050014;
|
||||
public static final int fb_signin=0x7f050015;
|
||||
public static final int gathering=0x7f05001c;
|
||||
public static final int gps_fix=0x7f050001;
|
||||
public static final int loading=0x7f050016;
|
||||
public static final int location_settings=0x7f050017;
|
||||
public static final int poor_data_connection=0x7f05001e;
|
||||
public static final int post_hint=0x7f050018;
|
||||
public static final int post_lenght=0x7f050019;
|
||||
public static final int post_settings=0x7f05001d;
|
||||
public static final int post_to_long=0x7f05001a;
|
||||
public static final int posting=0x7f05001b;
|
||||
public static final int remove_facebook=0x7f05001f;
|
||||
public static final int remove_facebook_confirmation=0x7f050020;
|
||||
public static final int remove_site_title=0x7f050021;
|
||||
public static final int remove_twitter=0x7f050022;
|
||||
public static final int save_a_post=0x7f050023;
|
||||
public static final int social_site=0x7f050024;
|
||||
public static final int sorry=0x7f050004;
|
||||
public static final int sorry_theres_trouble=0x7f050002;
|
||||
public static final int twitter=0x7f050025;
|
||||
public static final int twitter_already_authorized=0x7f050026;
|
||||
public static final int twitter_authorization_failure=0x7f050027;
|
||||
public static final int twitter_exception=0x7f050028;
|
||||
public static final int about=0x7f050002;
|
||||
public static final int about_info=0x7f050003;
|
||||
public static final int about_verify=0x7f050004;
|
||||
public static final int accuracy=0x7f050005;
|
||||
public static final int accuracy_info=0x7f050006;
|
||||
public static final int add_social_site=0x7f050007;
|
||||
public static final int app_name=0x7f050008;
|
||||
public static final int cancel_service=0x7f050009;
|
||||
public static final int check_in_at=0x7f05000a;
|
||||
public static final int clear=0x7f05000b;
|
||||
public static final int crash=0x7f050000;
|
||||
public static final int disable_facebook_checkin=0x7f05000c;
|
||||
public static final int enable_facebook_checkin=0x7f05000d;
|
||||
public static final int facebook=0x7f05000e;
|
||||
public static final int facebook_already_authorized=0x7f05000f;
|
||||
public static final int facebook_authorization_failure=0x7f050010;
|
||||
public static final int facebook_options=0x7f050011;
|
||||
public static final int facebook_session_not_valid=0x7f050012;
|
||||
public static final int fb_signin=0x7f050013;
|
||||
public static final int gathering=0x7f05001a;
|
||||
public static final int loading=0x7f050014;
|
||||
public static final int location_settings=0x7f050015;
|
||||
public static final int poor_data_connection=0x7f05001c;
|
||||
public static final int post_hint=0x7f050016;
|
||||
public static final int post_lenght=0x7f050017;
|
||||
public static final int post_settings=0x7f05001b;
|
||||
public static final int post_to_long=0x7f050018;
|
||||
public static final int posting=0x7f050019;
|
||||
public static final int remove_facebook=0x7f05001d;
|
||||
public static final int remove_facebook_confirmation=0x7f05001e;
|
||||
public static final int remove_site_title=0x7f05001f;
|
||||
public static final int remove_twitter=0x7f050020;
|
||||
public static final int remove_twitter_confirmation=0x7f050021;
|
||||
public static final int save_a_post=0x7f050022;
|
||||
public static final int social_site=0x7f050023;
|
||||
public static final int sorry=0x7f050001;
|
||||
public static final int twitter=0x7f050024;
|
||||
public static final int twitter_already_authorized=0x7f050025;
|
||||
public static final int twitter_authorization_failure=0x7f050026;
|
||||
public static final int twitter_exception=0x7f050027;
|
||||
public static final int twitter_options=0x7f050028;
|
||||
public static final int twitter_signin=0x7f050029;
|
||||
public static final int update=0x7f05002a;
|
||||
public static final int verify_message=0x7f05002b;
|
||||
|
||||
@@ -15,75 +15,63 @@ public final class R {
|
||||
public static final class attr {
|
||||
}
|
||||
public static final class drawable {
|
||||
public static final int compass=0x7f020000;
|
||||
public static final int facebook_icon=0x7f020001;
|
||||
public static final int icon=0x7f020002;
|
||||
public static final int logoidea3=0x7f020003;
|
||||
public static final int needle=0x7f020004;
|
||||
public static final int notification=0x7f020005;
|
||||
public static final int skyhook_logo=0x7f020006;
|
||||
public static final int skyhook_logo_alpha=0x7f020007;
|
||||
public static final int skyhook_logo_alpha_small=0x7f020008;
|
||||
public static final int tc_logo_complete=0x7f020009;
|
||||
public static final int user=0x7f02000a;
|
||||
public static final int widget=0x7f02000b;
|
||||
public static final int facebook_icon=0x7f020000;
|
||||
public static final int icon=0x7f020001;
|
||||
public static final int notification=0x7f020002;
|
||||
public static final int widget=0x7f020003;
|
||||
}
|
||||
public static final class id {
|
||||
public static final int authCode=0x7f070004;
|
||||
public static final int authOkButton=0x7f070003;
|
||||
public static final int authWebView=0x7f070005;
|
||||
public static final int skyhook_img=0x7f070000;
|
||||
public static final int socialsites=0x7f070006;
|
||||
public static final int tc_img=0x7f070002;
|
||||
public static final int text=0x7f070001;
|
||||
public static final int authCode=0x7f070001;
|
||||
public static final int authOkButton=0x7f070000;
|
||||
public static final int authWebView=0x7f070002;
|
||||
public static final int socialsites=0x7f070003;
|
||||
}
|
||||
public static final class layout {
|
||||
public static final int facebookactivity=0x7f030000;
|
||||
public static final int powered_by_skyhook=0x7f030001;
|
||||
public static final int twitterwebauth=0x7f030002;
|
||||
public static final int twitterwebauth=0x7f030001;
|
||||
}
|
||||
public static final class string {
|
||||
public static final int about=0x7f050005;
|
||||
public static final int about_info=0x7f050006;
|
||||
public static final int about_verify=0x7f050007;
|
||||
public static final int accuracy=0x7f050008;
|
||||
public static final int accuracy_info=0x7f050009;
|
||||
public static final int add_social_site=0x7f05000a;
|
||||
public static final int app_name=0x7f050000;
|
||||
public static final int cancel_service=0x7f05000b;
|
||||
public static final int check_in_at=0x7f05000c;
|
||||
public static final int clear=0x7f05000d;
|
||||
public static final int crash=0x7f050003;
|
||||
public static final int disable_facebook_checkin=0x7f05000e;
|
||||
public static final int enable_facebook_checkin=0x7f05000f;
|
||||
public static final int facebook=0x7f050010;
|
||||
public static final int facebook_already_authorized=0x7f050011;
|
||||
public static final int facebook_authorization_failure=0x7f050012;
|
||||
public static final int facebook_options=0x7f050013;
|
||||
public static final int facebook_session_not_valid=0x7f050014;
|
||||
public static final int fb_signin=0x7f050015;
|
||||
public static final int gathering=0x7f05001c;
|
||||
public static final int gps_fix=0x7f050001;
|
||||
public static final int loading=0x7f050016;
|
||||
public static final int location_settings=0x7f050017;
|
||||
public static final int poor_data_connection=0x7f05001e;
|
||||
public static final int post_hint=0x7f050018;
|
||||
public static final int post_lenght=0x7f050019;
|
||||
public static final int post_settings=0x7f05001d;
|
||||
public static final int post_to_long=0x7f05001a;
|
||||
public static final int posting=0x7f05001b;
|
||||
public static final int remove_facebook=0x7f05001f;
|
||||
public static final int remove_facebook_confirmation=0x7f050020;
|
||||
public static final int remove_site_title=0x7f050021;
|
||||
public static final int remove_twitter=0x7f050022;
|
||||
public static final int save_a_post=0x7f050023;
|
||||
public static final int social_site=0x7f050024;
|
||||
public static final int sorry=0x7f050004;
|
||||
public static final int sorry_theres_trouble=0x7f050002;
|
||||
public static final int twitter=0x7f050025;
|
||||
public static final int twitter_already_authorized=0x7f050026;
|
||||
public static final int twitter_authorization_failure=0x7f050027;
|
||||
public static final int twitter_exception=0x7f050028;
|
||||
public static final int about=0x7f050002;
|
||||
public static final int about_info=0x7f050003;
|
||||
public static final int about_verify=0x7f050004;
|
||||
public static final int accuracy=0x7f050005;
|
||||
public static final int accuracy_info=0x7f050006;
|
||||
public static final int add_social_site=0x7f050007;
|
||||
public static final int app_name=0x7f050008;
|
||||
public static final int cancel_service=0x7f050009;
|
||||
public static final int check_in_at=0x7f05000a;
|
||||
public static final int clear=0x7f05000b;
|
||||
public static final int crash=0x7f050000;
|
||||
public static final int disable_facebook_checkin=0x7f05000c;
|
||||
public static final int enable_facebook_checkin=0x7f05000d;
|
||||
public static final int facebook=0x7f05000e;
|
||||
public static final int facebook_already_authorized=0x7f05000f;
|
||||
public static final int facebook_authorization_failure=0x7f050010;
|
||||
public static final int facebook_options=0x7f050011;
|
||||
public static final int facebook_session_not_valid=0x7f050012;
|
||||
public static final int fb_signin=0x7f050013;
|
||||
public static final int gathering=0x7f05001a;
|
||||
public static final int loading=0x7f050014;
|
||||
public static final int location_settings=0x7f050015;
|
||||
public static final int poor_data_connection=0x7f05001c;
|
||||
public static final int post_hint=0x7f050016;
|
||||
public static final int post_lenght=0x7f050017;
|
||||
public static final int post_settings=0x7f05001b;
|
||||
public static final int post_to_long=0x7f050018;
|
||||
public static final int posting=0x7f050019;
|
||||
public static final int remove_facebook=0x7f05001d;
|
||||
public static final int remove_facebook_confirmation=0x7f05001e;
|
||||
public static final int remove_site_title=0x7f05001f;
|
||||
public static final int remove_twitter=0x7f050020;
|
||||
public static final int remove_twitter_confirmation=0x7f050021;
|
||||
public static final int save_a_post=0x7f050022;
|
||||
public static final int social_site=0x7f050023;
|
||||
public static final int sorry=0x7f050001;
|
||||
public static final int twitter=0x7f050024;
|
||||
public static final int twitter_already_authorized=0x7f050025;
|
||||
public static final int twitter_authorization_failure=0x7f050026;
|
||||
public static final int twitter_exception=0x7f050027;
|
||||
public static final int twitter_options=0x7f050028;
|
||||
public static final int twitter_signin=0x7f050029;
|
||||
public static final int update=0x7f05002a;
|
||||
public static final int verify_message=0x7f05002b;
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<string name="location_settings">Location Settings</string>
|
||||
<string name="post_hint">Whats up?</string>
|
||||
<string name="post_lenght">Post Lenght: </string>
|
||||
<string name="post_to_long">Please Reduce your post to 140 chars</string>
|
||||
<string name="post_to_long">Please Reduce your post to 140 characters</string>
|
||||
<string name="posting">Posting...</string>
|
||||
<string name="gathering">Gathering location...</string>
|
||||
<string name="post_settings">Post Settings</string>
|
||||
@@ -30,13 +30,15 @@
|
||||
<string name="remove_facebook">Remove Facebook</string>
|
||||
<string name="remove_facebook_confirmation">Are you sure you want to remove Facebook? You will not be able to post messages to Facebook anymore.</string>
|
||||
<string name="remove_site_title">Remove Social Site</string>
|
||||
<string name="remove_twitter">Are you sure you want to remove Twitter? You will not be able to post messages to Twitter anymore.</string>
|
||||
<string name="remove_twitter">Remove Twitter</string>
|
||||
<string name="remove_twitter_confirmation">Are you sure you want to remove Twitter? You will not be able to post messages to Twitter anymore.</string>
|
||||
<string name="save_a_post">Save a Post</string>
|
||||
<string name="social_site">Social Sites</string>
|
||||
<string name="twitter">Twitter</string>
|
||||
<string name="twitter_already_authorized">Twitter is already authorized.</string>
|
||||
<string name="twitter_authorization_failure">Unable to authorize Twitter account. Please try again or check your Twitter settings.</string>
|
||||
<string name="twitter_exception">We could not connect to Twitter. Please check your connection and try again.</string>
|
||||
<string name="twitter_options">Twitter Options</string>
|
||||
<string name="twitter_signin">Twitter Sign In</string>
|
||||
<string name="update">Update</string>
|
||||
<string name="verify_message">Verify the message before posting.</string>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
android:key="socialsites">
|
||||
<Preference
|
||||
android:title="@string/add_social_site"
|
||||
android:key="add_social_site" />
|
||||
android:key="@string/add_social_site" />
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
|
||||
@@ -5,6 +5,7 @@ import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.DialogInterface.OnClickListener;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
@@ -91,10 +92,9 @@ public class TravelPostMain extends PreferenceActivity implements OnPreferenceCl
|
||||
this.getPreferenceManager().setSharedPreferencesName(SETTINGS);
|
||||
this.addPreferencesFromResource(R.xml.travelpostmain);
|
||||
|
||||
this.getSharedPreferences(SETTINGS, 0);
|
||||
mFacebookPrefs = this.getSharedPreferences(FACEBOOK, 0);
|
||||
mSocialSites = (PreferenceCategory) this.findPreference("socialsites");
|
||||
this.findPreference("add_social_site").setOnPreferenceClickListener(this);
|
||||
this.findPreference(this.getString(R.string.add_social_site)).setOnPreferenceClickListener(this);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -236,13 +236,147 @@ public class TravelPostMain extends PreferenceActivity implements OnPreferenceCl
|
||||
public boolean onPreferenceClick(Preference preference) {
|
||||
if (Debug.LOGGING)
|
||||
Log.i(TAG, "onPreferenceClick()");
|
||||
if (preference.getKey().equals("add_social_site")) {
|
||||
if (preference.getKey().equals(this.getString(R.string.add_social_site))) {
|
||||
this.displaySocialSitesDialog();
|
||||
return true;
|
||||
} else if (preference.getKey().equals(this.getString(R.string.facebook))) {
|
||||
this.facebookDialog();
|
||||
return true;
|
||||
} else if (preference.getKey().equals(this.getString(R.string.twitter))) {
|
||||
this.twitterDialog();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Dialog displayed when the facebook selection is picked. allows the user to post to wall/checkin, and remove facebook
|
||||
*/
|
||||
|
||||
private void facebookDialog() {
|
||||
final SharedPreferences prefs = mFacebookPrefs;
|
||||
CharSequence[] options;
|
||||
if (prefs.getBoolean("checkin", true)) {
|
||||
options = new CharSequence[] {this.getString(R.string.disable_facebook_checkin), this.getString(R.string.remove_facebook)};
|
||||
} else {
|
||||
options = new CharSequence[] {this.getString(R.string.enable_facebook_checkin), this.getString(R.string.remove_facebook)};
|
||||
}
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
builder.setTitle(this.getString(R.string.facebook_options));
|
||||
builder.setItems(options, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
switch (which) {
|
||||
case 0:
|
||||
if (prefs.getBoolean("checkin", true)) {
|
||||
prefs.edit().putBoolean("checkin", false).commit();
|
||||
} else {
|
||||
prefs.edit().putBoolean("checkin", true).commit();
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
removeSiteDialog(R.string.remove_facebook_confirmation);
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
AlertDialog alert = builder.create();
|
||||
alert.show();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method prompts the user for confirmation of removal of social site
|
||||
* @param id - the id used to confirm removal of site. ex: R.string.remove_twitter_confirmaiton
|
||||
*/
|
||||
|
||||
private void removeSiteDialog(final int id) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
builder.setTitle(this.getString(R.string.remove_site_title));
|
||||
builder.setMessage(this.getString(id));
|
||||
builder.setPositiveButton(android.R.string.ok, new OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(DialogInterface arg0, int arg1) {
|
||||
switch (id) {
|
||||
case (R.string.remove_twitter_confirmation):
|
||||
removeSite(R.string.twitter);
|
||||
break;
|
||||
case (R.string.remove_facebook_confirmation):
|
||||
removeSite(R.string.facebook);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
builder.setNegativeButton(android.R.string.cancel, new OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
});
|
||||
AlertDialog alert = builder.create();
|
||||
alert.show();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method removes the shared prefs and preference for the given social site.
|
||||
* @param id - R id given to preference when site was created
|
||||
*/
|
||||
|
||||
private void removeSite(int id) {
|
||||
if (Debug.LOGGING)
|
||||
Log.i(TAG, "removeSite.site: " + this.getString(id));
|
||||
SharedPreferences prefSettings = this.getSharedPreferences(SETTINGS, 0);
|
||||
int auth = 0;
|
||||
switch (id) {
|
||||
case R.string.facebook:
|
||||
auth = prefSettings.getInt(AUTHORIZED, 1);
|
||||
prefSettings.edit().putInt(AUTHORIZED, auth - 1).commit();
|
||||
mFacebookPrefs.edit().clear().commit();
|
||||
this.getSharedPreferences("facebook-session", 0).edit().clear().commit();
|
||||
this.deleteDatabase("webviewCache.db");
|
||||
this.deleteDatabase("webview.db");
|
||||
break;
|
||||
case R.string.twitter:
|
||||
auth = prefSettings.getInt(AUTHORIZED, 1);
|
||||
prefSettings.edit().putInt(AUTHORIZED, auth - 1).commit();
|
||||
this.getSharedPreferences(TWITTER, 0).edit().clear().commit();
|
||||
break;
|
||||
}
|
||||
this.removePreference(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Dialog displayed when the twitter selection is picked. allows the user to remove the feature
|
||||
*/
|
||||
|
||||
private void twitterDialog() {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
builder.setTitle(this.getString(R.string.twitter_options));
|
||||
builder.setItems(new CharSequence[] {this.getString(R.string.remove_twitter)}, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
removeSiteDialog(R.string.remove_twitter_confirmation);
|
||||
}
|
||||
});
|
||||
AlertDialog alert = builder.create();
|
||||
alert.show();
|
||||
}
|
||||
|
||||
/**
|
||||
* removes a given preference from the social sites preference category
|
||||
* @param id of the preference
|
||||
*/
|
||||
|
||||
private void removePreference(int id) {
|
||||
if (Debug.LOGGING)
|
||||
Log.i(TAG, "removePreference: " + this.getString(id));
|
||||
mSocialSites.removePreference(findPreference(this.getString(id)));
|
||||
}
|
||||
|
||||
/**
|
||||
* This method creates a preferences with the given ID under the socialsites preference category.
|
||||
* It also assigned the onclicklistener
|
||||
@@ -251,7 +385,7 @@ public class TravelPostMain extends PreferenceActivity implements OnPreferenceCl
|
||||
|
||||
private void createPreference(int id) {
|
||||
if (Debug.LOGGING)
|
||||
Log.i(TAG, "createPreference: " + id);
|
||||
Log.i(TAG, "createPreference: " + this.getString(id));
|
||||
Preference pref = new Preference(this);
|
||||
pref.setTitle(this.getString(id));
|
||||
pref.setKey(this.getString(id));
|
||||
|
||||
Reference in New Issue
Block a user