Skip to content

Commit

Permalink
User picture now displays on UserProfileActivity
Browse files Browse the repository at this point in the history
  • Loading branch information
Muhammad Hamza Farrukh committed Jan 22, 2017
1 parent f04abba commit 37ffd18
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Client/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Client/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ dependencies {
compile 'com.google.android.gms:play-services:10.0.1'
compile 'com.google.firebase:firebase-database:10.0.1'
compile 'com.google.firebase:firebase-auth:10.0.1'
compile 'com.squareup.picasso:picasso:2.5.2'
testCompile 'junit:junit:4.12'

}


Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package boilermake.swollmate;

import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.CheckBox;
import android.widget.ImageView;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;
Expand All @@ -14,6 +16,7 @@
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.squareup.picasso.Picasso;

public class UserProfileActivity extends AppCompatActivity {

Expand Down Expand Up @@ -139,10 +142,13 @@ public void readFromFirebase() {
@Override
public void onChildAdded(DataSnapshot dataSnapshot, String s) {
String key = (String) dataSnapshot.getKey();
String value = (String) dataSnapshot.getValue().toString() + " ";
String value = (String) dataSnapshot.getValue().toString();

if (key.equals("firstName") || key.equals("lastName")) {
name.setText(name.getText() + value);
name.setText(name.getText() + " " + value);
}
if (key.equals("picURL")) {
Picasso.with(UserProfileActivity.this).load(value).into((ImageView)findViewById(R.id.my_pic));
}
}

Expand Down

0 comments on commit 37ffd18

Please sign in to comment.