Before Width: | Height: | Size: 9.3 KiB After Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 9.0 KiB After Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 9.2 KiB After Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 9.3 KiB After Width: | Height: | Size: 4.1 KiB |
@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- When selected, use grey -->
|
||||
<item android:drawable="@drawable/ic_tab_favorites_dark"
|
||||
<item android:drawable="@drawable/ic_tab_thinkit_dark"
|
||||
android:state_selected="true" />
|
||||
<!-- When not selected, use white-->
|
||||
<item android:drawable="@drawable/ic_tab_favorites_light" />
|
||||
<item android:drawable="@drawable/ic_tab_thinkit_light" />
|
||||
</selector>
|
After Width: | Height: | Size: 833 B |
After Width: | Height: | Size: 833 B |
After Width: | Height: | Size: 1.2 KiB |
@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:background="#ffffff"
|
||||
android:orientation="vertical" android:layout_gravity="center">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/thinkit_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/logo_thinkit" android:layout_gravity="center_vertical|center_horizontal" android:layout_marginTop="200px" android:paddingBottom="0px" android:paddingLeft="0px" android:paddingRight="0px" android:paddingTop="0px"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/email"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Contact us !"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge" android:textColor="#000000" android:layout_gravity="center" android:clickable="true" android:layout_marginTop="10px"/>
|
||||
|
||||
</LinearLayout>
|
@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linearLayout1"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#002531"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tweet_text"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Large Text"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||
android:textSize="30px" android:layout_marginBottom="10px" android:layout_marginTop="15px"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tweet_date"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Small Text"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall" android:textSize="20px"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
@ -1,13 +0,0 @@
|
||||
package com.thinkit.lewebconnect;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
|
||||
public class Likes extends Activity {
|
||||
/** Called when the activity is first created. */
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.main);
|
||||
}
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package com.thinkit.lewebconnect;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
|
||||
public class ThinkIT extends Activity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
// TODO Auto-generated method stub
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
setContentView(R.layout.thinkit);
|
||||
|
||||
try {
|
||||
View button = findViewById(R.id.thinkit_button);
|
||||
button.setOnClickListener(new View.OnClickListener() {
|
||||
public void onClick(View v) {
|
||||
String url = "http://i-think-it.com/";
|
||||
Intent i = new Intent(Intent.ACTION_VIEW);
|
||||
i.setData(Uri.parse(url));
|
||||
startActivity(i);
|
||||
}
|
||||
});
|
||||
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
View button = findViewById(R.id.email);
|
||||
button.setOnClickListener(new View.OnClickListener() {
|
||||
|
||||
public void onClick(View v) {
|
||||
// TODO Auto-generated method stub
|
||||
final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
|
||||
emailIntent.setType("plain/text");
|
||||
emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{"contact@i-think-it.com"});
|
||||
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Feedback");
|
||||
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, "Hello guys, your app is great ... ");
|
||||
startActivity(Intent.createChooser(emailIntent, "Send mail..."));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,102 @@
|
||||
package com.thinkit.lewebconnect;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.apache.http.HttpEntity;
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.client.ClientProtocolException;
|
||||
import org.apache.http.client.HttpClient;
|
||||
import org.apache.http.client.ResponseHandler;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
import org.apache.http.impl.client.BasicResponseHandler;
|
||||
import org.apache.http.impl.client.DefaultHttpClient;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
import org.json.JSONTokener;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.widget.Toast;
|
||||
|
||||
public class Tweet {
|
||||
public static final String TWEETS_URL = "http://api.twitter.com/1/statuses/user_timeline.json?screen_name=";
|
||||
public String message;
|
||||
public String date_created;
|
||||
public String tweet_id;
|
||||
public String profile_image_url;
|
||||
|
||||
public Tweet(String tweet_id, String message, String date_created, String profile_image_url) {
|
||||
this.message = message;
|
||||
this.date_created = date_created;
|
||||
this.tweet_id = tweet_id;
|
||||
this.profile_image_url = profile_image_url;
|
||||
}
|
||||
|
||||
public static ArrayList<Tweet> getTweets(String username) {
|
||||
|
||||
ArrayList<Tweet> tweets = new ArrayList<Tweet>();
|
||||
|
||||
HttpClient client = new DefaultHttpClient();
|
||||
HttpGet get = new HttpGet(TWEETS_URL + username + "&count=10");
|
||||
|
||||
|
||||
HttpResponse httpResponse = null;
|
||||
|
||||
// ResponseHandler<String> responseHandler = new BasicResponseHandler();
|
||||
String responseBody = null;
|
||||
|
||||
try {
|
||||
// responseBody = client.execute(get, responseHandler);
|
||||
httpResponse = client.execute(get);
|
||||
HttpEntity httpEntity = httpResponse.getEntity();
|
||||
responseBody = EntityUtils.toString(httpEntity, "UTF-8");
|
||||
} catch (ClientProtocolException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
// JSONObject stats = (JSONObject) new JSONTokener(responseBody).nextValue();
|
||||
JSONTokener tokener = new JSONTokener(responseBody);
|
||||
JSONArray stats = new JSONArray(tokener);
|
||||
|
||||
for (int i =0; i < stats.length(); i++) {
|
||||
JSONObject stat = stats.getJSONObject(i);
|
||||
String tweet_id = stat.getString("id_str");
|
||||
String tweet_msg = stat.getString("text");
|
||||
String tweet_date = stat.getString("created_at");
|
||||
tweet_date = tweet_date.substring(0, 16);
|
||||
JSONObject user = stat.getJSONObject("user");
|
||||
String profile_image = user.getString("profile_image_url");
|
||||
Tweet tweet = new Tweet(tweet_id, tweet_msg, tweet_date, profile_image);
|
||||
tweets.add(tweet);
|
||||
}
|
||||
|
||||
} catch (JSONException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return tweets;
|
||||
|
||||
}
|
||||
|
||||
public Bitmap getBitmap(String bitmapUrl) {
|
||||
try {
|
||||
URL url = new URL(bitmapUrl);
|
||||
return BitmapFactory.decodeStream(url.openConnection().getInputStream());
|
||||
} catch (Exception e) {
|
||||
// TODO: handle exception
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
package com.thinkit.lewebconnect;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.TextView;
|
||||
|
||||
public class TweetsAdapter extends ArrayAdapter<Tweet> {
|
||||
private ArrayList<Tweet> tweets;
|
||||
private Context context;
|
||||
|
||||
public TweetsAdapter(Context context, int textViewResouceID, ArrayList<Tweet> tweets) {
|
||||
super(context, textViewResouceID, tweets);
|
||||
this.tweets = tweets;
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
View v = convertView;
|
||||
if (v == null) {
|
||||
LayoutInflater vi = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
v = vi.inflate(R.layout.tweet_row, null);
|
||||
}
|
||||
|
||||
Tweet tweet = tweets.get(position);
|
||||
if (tweet != null) {
|
||||
TextView tweet_msg = (TextView) v.findViewById(R.id.tweet_text);
|
||||
TextView tweet_date = (TextView) v.findViewById(R.id.tweet_date);
|
||||
// ImageView image = (ImageView) v.findViewById(R.id.avatar);
|
||||
//
|
||||
if (tweet_date != null) {
|
||||
tweet_date.setText(tweet.date_created);
|
||||
}
|
||||
|
||||
if(tweet_msg != null) {
|
||||
tweet_msg.setText(tweet.message);
|
||||
}
|
||||
|
||||
// if(image != null) {
|
||||
// image.setImageBitmap(getBitmap(tweet.image_url));
|
||||
// }
|
||||
}
|
||||
return v;
|
||||
|
||||
}
|
||||
}
|