-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Your Name
committed
Apr 26, 2018
1 parent
0ccb970
commit 0896805
Showing
17 changed files
with
192 additions
and
3 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
app/src/main/java/com/project/wanderlust/UserDetailsActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package com.project.wanderlust; | ||
|
||
import android.content.ContextWrapper; | ||
import android.content.Intent; | ||
import android.graphics.Bitmap; | ||
import android.support.v7.app.AppCompatActivity; | ||
import android.os.Bundle; | ||
import android.widget.ImageView; | ||
import android.widget.TextView; | ||
|
||
import com.google.firebase.auth.FirebaseAuth; | ||
import com.google.firebase.database.DataSnapshot; | ||
import com.google.firebase.database.DatabaseError; | ||
import com.google.firebase.database.FirebaseDatabase; | ||
import com.google.firebase.database.ValueEventListener; | ||
|
||
import java.io.File; | ||
|
||
public class UserDetailsActivity extends AppCompatActivity { | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_user_details); | ||
|
||
FirebaseDatabase.getInstance().getReference("users").child(FirebaseAuth.getInstance().getCurrentUser().getPhoneNumber()) | ||
.addListenerForSingleValueEvent(new ValueEventListener() { | ||
@Override | ||
public void onDataChange(DataSnapshot dataSnapshot) { | ||
String name = dataSnapshot.child("name").getValue(String.class); | ||
((TextView) findViewById(R.id.name)).setText(name); | ||
} | ||
@Override public void onCancelled(DatabaseError databaseError) { } | ||
}); | ||
|
||
FirebaseDatabase.getInstance().getReference("Journeys").child(FirebaseAuth.getInstance().getCurrentUser().getPhoneNumber()) | ||
.addListenerForSingleValueEvent(new ValueEventListener() { | ||
@Override | ||
public void onDataChange(DataSnapshot dataSnapshot) { | ||
long checkIns = dataSnapshot.getChildrenCount(); | ||
((TextView) findViewById(R.id.check)).setText(Long.toString(checkIns)); | ||
} | ||
|
||
@Override public void onCancelled(DatabaseError databaseError) { } | ||
}); | ||
|
||
ContextWrapper wrapper = new ContextWrapper(getApplicationContext()); | ||
File file = wrapper.getDir("profilePictures",MODE_PRIVATE); | ||
file = new File(file, FirebaseAuth.getInstance().getCurrentUser().getPhoneNumber() + ".jpg"); | ||
final Bitmap bitmap = SharedFunctions.decodeBitmapFromFile(file, 100, 100); | ||
((ImageView) findViewById(R.id.photo)).setImageBitmap(bitmap); | ||
|
||
((TextView) findViewById(R.id.friends)).setText(Integer.toString(Contacts.arrayList.size())); | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:orientation="vertical" | ||
tools:context=".UserDetailsActivity"> | ||
|
||
<ImageView | ||
android:id="@+id/photo" | ||
android:layout_width="match_parent" | ||
android:layout_height="200dp" | ||
android:layout_gravity="center_horizontal" | ||
android:scaleType="centerCrop" | ||
android:src="@drawable/test"/> | ||
|
||
<LinearLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:gravity="center" | ||
android:orientation="vertical"> | ||
<TextView | ||
android:id="@+id/name" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:textSize="25sp" | ||
android:textColor="@android:color/black" | ||
android:textStyle="bold"/> | ||
|
||
<TextView | ||
android:id="@+id/location" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="@string/lahore"/> | ||
</LinearLayout> | ||
|
||
<LinearLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:orientation="vertical" | ||
android:layout_marginTop="15dp" | ||
android:layout_marginStart="15dp" | ||
android:layout_marginEnd="15dp"> | ||
<LinearLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="100dp" | ||
android:background="@drawable/checkins" | ||
android:orientation="vertical" | ||
android:gravity="center" | ||
android:paddingStart="20dp" | ||
android:paddingEnd="20dp"> | ||
<TextView | ||
android:id="@+id/check" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:textColor="@android:color/white" | ||
android:textStyle="bold" | ||
android:textSize="25sp"/> | ||
|
||
<TextView | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:text="@string/check" | ||
android:textColor="@android:color/white" | ||
android:textSize="15sp"/> | ||
</LinearLayout> | ||
|
||
<LinearLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="100dp" | ||
android:background="@drawable/locations" | ||
android:orientation="vertical" | ||
android:gravity="center" | ||
android:layout_marginTop="10dp" | ||
android:paddingStart="20dp" | ||
android:paddingEnd="20dp"> | ||
<TextView | ||
android:id="@+id/locations" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:textColor="@android:color/white" | ||
android:textStyle="bold" | ||
android:textSize="25sp"/> | ||
|
||
<TextView | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:text="@string/places" | ||
android:textColor="@android:color/white" | ||
android:textSize="15sp"/> | ||
</LinearLayout> | ||
|
||
<LinearLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="100dp" | ||
android:background="@drawable/friends" | ||
android:orientation="vertical" | ||
android:gravity="center" | ||
android:layout_marginTop="10dp" | ||
android:paddingStart="20dp" | ||
android:paddingEnd="20dp"> | ||
<TextView | ||
android:id="@+id/friends" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:textColor="@android:color/white" | ||
android:textStyle="bold" | ||
android:textSize="25sp"/> | ||
|
||
<TextView | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:text="@string/friends" | ||
android:textColor="@android:color/white" | ||
android:textSize="15sp"/> | ||
</LinearLayout> | ||
</LinearLayout> | ||
|
||
</LinearLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters