Unpolished version of a social network link page

pull/14/head
Sam Bosley 12 years ago
parent ce30ce5684
commit 670e21a9a6

@ -165,6 +165,8 @@
</intent-filter>
</activity>
<activity android:name="com.todoroo.astrid.activity.ShareActivity"/>
<!-- Start of Crittercism.com Code -->
<activity android:name="com.crittercism.NewFeedbackSpringboardActivity" android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"></activity>
<activity android:name="com.crittercism.NewFeedbackIssueListActivity" android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"></activity>

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/share_facebook"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="16sp"
android:textColor="#444"
android:layout_marginBottom="15dip"/>
<TextView
android:id="@+id/share_twitter"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="16sp"
android:textColor="#444"
android:layout_marginBottom="15dip"/>
<TextView
android:id="@+id/share_google"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="16sp"
android:textColor="#444"
android:layout_marginBottom="15dip"/>
</LinearLayout>

@ -322,5 +322,10 @@
<string name="actfm_inapp_billing">Upgrade to Premium</string>
<string name="actfm_inapp_billing_summary">Attach files, voice backups, premium support &amp; more</string>
<!-- Sharing -->
<string name="share_with_facebook">Share with Facebook</string>
<string name="share_with_twitter">Share with Twitter</string>
<string name="share_with_google">Share with Google+</string>
</resources>

@ -567,6 +567,12 @@
<!-- slide 31g: Preference Window Title -->
<string name="EPr_title">Astrid: Settings</string>
<string name="EPr_title_short">Settings</string>
<string name="EPr_share_astrid">Tell others about Astrid</string>
<string name="EPr_share_astrid_summary">Rate us or share on your favorite social network</string>
<!-- slide 46a -->
<string name="EPr_deactivated">deactivated</string>

@ -18,6 +18,12 @@
<PreferenceScreen android:title="@string/EPr_faq_title" android:key="@string/p_help"/>
</PreferenceScreen>
<PreferenceScreen android:title="@string/EPr_share_astrid"
android:key="@string/EPr_share_astrid"
android:summary="@string/EPr_share_astrid_summary"/>
<PreferenceCategory android:title="@string/EPr_title_short"/>
<PreferenceScreen
android:title="@string/EPr_appearance_header"
android:summary="@string/EPr_appearance_summary">

@ -82,7 +82,7 @@ public class EditPreferences extends TodorooPreferenceActivity {
private static final String SUPPORT_URL = "http://blog.astrid.com/topics/support/android"; //$NON-NLS-1$
private static final int APPEARANCE_PREFERENCE = 2;
private static final int APPEARANCE_PREFERENCE = 4;
private static final int REQUEST_CODE_SYNC = 0;
private static final int REQUEST_CODE_FILES_DIR = 2;
@ -178,6 +178,15 @@ public class EditPreferences extends TodorooPreferenceActivity {
}
});
preference = screen.findPreference(getString(R.string.EPr_share_astrid));
preference.setOnPreferenceClickListener(new OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference p) {
showShareActivity();
return true;
}
});
PreferenceScreen appearance = (PreferenceScreen) screen.getPreference(APPEARANCE_PREFERENCE);
Preference beastMode = appearance.getPreference(1);
beastMode.setOnPreferenceClickListener(new OnPreferenceClickListener() {
@ -284,6 +293,11 @@ public class EditPreferences extends TodorooPreferenceActivity {
}
}
private void showShareActivity() {
Intent intent = new Intent(this, ShareActivity.class);
startActivity(intent);
}
private static final HashMap<Class<?>, Integer> PREFERENCE_REQUEST_CODES = new HashMap<Class<?>, Integer>();
static {
PREFERENCE_REQUEST_CODES.put(SyncProviderPreferences.class, REQUEST_CODE_SYNC);

@ -0,0 +1,46 @@
package com.todoroo.astrid.activity;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.text.SpannableString;
import android.text.style.UnderlineSpan;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;
import com.timsu.astrid.R;
public class ShareActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.share_activity);
TextView fb = (TextView) findViewById(R.id.share_facebook);
setUpTextView(fb, getString(R.string.share_with_facebook), "http://facebook.com/weloveastrid"); //$NON-NLS-1$
TextView twitter = (TextView) findViewById(R.id.share_twitter);
setUpTextView(twitter, getString(R.string.share_with_twitter), "http://twitter.com/#!/weloveastrid"); //$NON-NLS-1$
TextView google = (TextView) findViewById(R.id.share_google);
setUpTextView(google, getString(R.string.share_with_google), "https://plus.google.com/116404018347675245869"); //$NON-NLS-1$
}
private void setUpTextView(TextView tv, String text, final String url) {
SpannableString span = new SpannableString(text);
span.setSpan(new UnderlineSpan(), 0, text.length(), 0);
tv.setText(span);
tv.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
startActivity(intent);
}
});
}
}
Loading…
Cancel
Save