Skip to content
Browse files

Merge branch 'master' of github.com:chrismarra/DrnkTxt.me

  • Loading branch information...
2 parents 34eab81 + 0ebe24f commit f0f1a5d2acd4aa0ea30b1969df0c510a854ea1c2 @mseger mseger committed Oct 22, 2011
View
BIN DrunkTexter/out/production/DrunkTexter/DrunkTexter.apk
Binary file not shown.
View
BIN DrunkTexter/out/production/DrunkTexter/DrunkTexter.apk.res
Binary file not shown.
View
BIN DrunkTexter/out/production/DrunkTexter/DrunkTexter.apk.unaligned
Binary file not shown.
View
BIN DrunkTexter/out/production/DrunkTexter/classes.dex
Binary file not shown.
View
1 DrunkTexter/res/layout/sms.xml
@@ -28,6 +28,7 @@
android:textStyle="bold|italic"
android:paddingLeft = "5dp"
android:paddingTop="10dp"
+ android:paddingRight = "2dp"
android:textSize="25dp"
android:layout_toRightOf="@+id/contact_image"
/>
View
50 DrunkTexter/src/me/drnktxt/drunktexter/SMS.java
@@ -6,6 +6,7 @@
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
+import android.graphics.Typeface;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.net.Uri;
@@ -14,6 +15,8 @@
import android.telephony.SmsManager;
import android.util.Log;
import android.view.View;
+import android.view.animation.Animation;
+import android.view.animation.AnimationUtils;
import android.widget.*;
import com.markupartist.android.widget.ActionBar;
import java.io.InputStream;
@@ -30,6 +33,7 @@
TextView display_name;
TextView display_num;
ImageView contact_photo;
+ ImageButton prevContactButton;
DrunkContact currentContact;
DrunkContact prevContact;
@@ -47,6 +51,7 @@ public void onCreate(Bundle savedInstanceState) {
display_name = (TextView) findViewById(R.id.contactName);
display_num = (TextView) findViewById(R.id.contactNum);
contact_photo = (ImageView) findViewById(R.id.contact_image);
+ prevContactButton = (ImageButton) findViewById(R.id.button_previous);
// actionbar stuff
actionBar = (ActionBar)findViewById(R.id.sms_actionbar);
@@ -56,10 +61,11 @@ public void onCreate(Bundle savedInstanceState) {
currentContact = getRandomContact();
// display chosen contact info
- display_name.setVisibility(1);
+ display_name.setVisibility(View.VISIBLE);
display_name.setText(currentContact.getName());
- display_num.setVisibility(1);
+ display_num.setVisibility(View.VISIBLE);
display_num.setText(currentContact.getNumber());
+ prevContactButton.setEnabled(false);
if(currentContact.getImage()!= null) {
contact_photo.setImageBitmap(currentContact.getImage());
@@ -75,31 +81,47 @@ public void getNextRandomContact(View v){
// get the random contact to send message to
prevContact = currentContact;
currentContact = getRandomContact();
+ prevContactButton.setEnabled(true);
usePrev = false;
+ Animation slidein = AnimationUtils.loadAnimation(this, android.R.anim.slide_in_left);
+
// display chosen contact info
display_name.setText(currentContact.getName());
display_num.setText(currentContact.getNumber());
- if(currentContact.getImage()!= null){
- contact_photo.setImageBitmap(currentContact.getImage());
- }else{
- contact_photo.setImageResource(R.drawable.photonotfound);
- }
+ if(currentContact.getImage()!= null){ contact_photo.setImageBitmap(currentContact.getImage()); }
+ else{contact_photo.setImageResource(R.drawable.photonotfound); }
+
+ display_name.startAnimation(slidein);
+ display_num.startAnimation(slidein);
+ contact_photo.startAnimation(slidein);
+
+
}
public void previousRandomContact(View v){
- if(prevContact == null){
+
+ if(prevContact == null) {
Toast.makeText(SMS.this, "No Previous Contact", Toast.LENGTH_SHORT).show();
- }else{
+ }
+ else {
+ currentContact = prevContact;
+ prevContactButton.setEnabled(false);
//display the previous contact's contact info
- display_name.setText(prevContact.getName());
- display_num.setText(prevContact.getNumber());
+ display_name.setText(currentContact.getName());
+ display_num.setText(currentContact.getNumber());
usePrev=true;
- if(prevContact.getImage()!= null){
- contact_photo.setImageBitmap(prevContact.getImage());
+ if(currentContact.getImage()!= null){
+ contact_photo.setImageBitmap(currentContact.getImage());
}else{
contact_photo.setImageResource(R.drawable.photonotfound);
}
+
+ Animation slidein = AnimationUtils.loadAnimation(this, android.R.anim.slide_in_left);
+
+ display_name.startAnimation(slidein);
+ display_num.startAnimation(slidein);
+ contact_photo.startAnimation(slidein);
}
}
@@ -124,7 +146,7 @@ public void startSMSSend(View v) {
mistake.putExtra("name", sendTo.getName());
mistake.putExtra("number",sendTo.getNumber());
- startActivityForResult(mistake,0);
+ startActivityForResult(mistake, 0);
}else
Toast.makeText(getBaseContext(),"Shit, something is broken. Damnit.",Toast.LENGTH_SHORT).show();
}

0 comments on commit f0f1a5d

Please sign in to comment.
Something went wrong with that request. Please try again.