mirror of https://github.com/tasks/tasks
Unpolished version of a social network link page
parent
ce30ce5684
commit
670e21a9a6
@ -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>
|
||||||
@ -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…
Reference in New Issue