i migrated all strings to string.xml

i made PostActivity.java to get users input after a widget click

i added post options to the settings.xml

TravelPostWidget.java
i added an if block to check users settings for posting

LocationReceiver.java
i made a convince method for posting and added an if block that generates a post base on users settings
This commit is contained in:
2011-02-07 01:08:44 +00:00
parent 414f1a18bf
commit dafa2f284c
10 changed files with 279 additions and 28 deletions

View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="wrap_content">
<RelativeLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#FFFFFF">
<Button android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@android:string/ok"
android:id="@+id/postOkButton"
android:layout_alignBottom="@+id/post"
android:layout_alignTop="@id/post"
android:layout_alignParentRight="true"></Button>
<EditText android:layout_toLeftOf="@id/postOkButton"
android:layout_width="fill_parent"
android:layout_alignParentTop="true"
android:layout_height="wrap_content"
android:hint="@string/post_hint"
android:id="@id/post">
</EditText>
</RelativeLayout>
</RelativeLayout>

View File

@@ -2,4 +2,12 @@
<resources>
<string name="hello">Hello World!</string>
<string name="app_name">Travel Post</string>
<string name="twitter_signin">Twitter Sign In</string>
<string name="fb_signin">Facebook Sign In</string>
<string name="location_settings">Location Settings</string>
<string name="about">About</string>
<string name="post_settings">Post Settings</string>
<string name="save_a_post">Save a post</string>
<string name="services">Social Services</string>
<string name="post_hint">Whats up?</string>
</resources>

View File

@@ -1,17 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
android:title="Travel Post">
<PreferenceCategory
android:title="Services">
android:title="@string/app_name">
<PreferenceCategory android:title="@string/post_settings">
<CheckBoxPreference android:title="@string/save_a_post" android:key="save_a_post"></CheckBoxPreference>
<EditTextPreference android:key="saved_post" android:title="Post" android:dependency="save_a_post"></EditTextPreference>
</PreferenceCategory><PreferenceCategory
android:title="@string/services">
<Preference
android:title="Twitter Sign In"
android:title="@string/twitter_signin"
android:key="twitter_sign_in"/>
<Preference
android:title="Facebook Sign In"
android:title="@string/fb_signin"
android:key="facebook_sign_in"/>
</PreferenceCategory>
<PreferenceCategory
android:title="Location Settings">
android:title="@string/location_settings">
</PreferenceCategory><PreferenceCategory android:title="@string/about">
<com.TwentyCodes.android.TravelPost.TextViewPreference android:title="@string/hello"/>
</PreferenceCategory>
</PreferenceScreen>