Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Apr 26, 2018
1 parent 0ccb970 commit 0896805
Show file tree
Hide file tree
Showing 17 changed files with 192 additions and 3 deletions.
Binary file modified .gradle/4.4/fileHashes/fileHashes.bin
Binary file not shown.
Binary file modified .gradle/4.4/fileHashes/fileHashes.lock
Binary file not shown.
Binary file modified .gradle/4.4/taskHistory/taskHistory.bin
Binary file not shown.
Binary file modified .gradle/4.4/taskHistory/taskHistory.lock
Binary file not shown.
Binary file modified .gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
Binary file modified .idea/caches/build_file_checksums.ser
Binary file not shown.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ android {
compileSdkVersion 27
defaultConfig {
applicationId "com.project.wanderlust"
minSdkVersion 18
minSdkVersion 21
targetSdkVersion 27
versionCode 1
versionName "1.0"
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
<activity android:name=".Contacts" />
<activity android:name=".CreateJourneyActivity" />
<activity android:name=".ShowJourney" />
<activity android:name=".JourneysLsitActivity"></activity>
<activity android:name=".JourneysLsitActivity" />
<activity android:name=".UserDetailsActivity"
android:theme="@style/AppTheme3" />
</application>

</manifest>
2 changes: 1 addition & 1 deletion app/src/main/java/com/project/wanderlust/Contacts.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class Contacts extends AppCompatActivity implements RecyclerView.OnItemTo
GestureDetector gestureDetector;
Context c;
RecyclerView rv;
final ArrayList<Contact> arrayList = new ArrayList<>();
final static ArrayList<Contact> arrayList = new ArrayList<>();
ContactAdapter adapter;

@Override
Expand Down
55 changes: 55 additions & 0 deletions app/src/main/java/com/project/wanderlust/UserDetailsActivity.java
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()));
}
}
Binary file added app/src/main/res/drawable/checkins.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/friends.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/locations.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/test.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
120 changes: 120 additions & 0 deletions app/src/main/res/layout/activity_user_details.xml
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>
6 changes: 6 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -213,20 +213,26 @@
<string name="camera">Camera</string>
<string name="cancel">Cancel</string>
<string name="carrier">Carrier SMS charges may apply</string>
<string name="check">Check-ins</string>
<string name="create">Create</string>

<string name="description">Want to describe?</string>
<string name="desc">Description</string>

<string name="enter_code">Enter 6-digit code</string>

<string name="friends">Friends</string>

<string name="gallery">Gallery</string>

<string name="lahore">Lahore, Pakistan</string>

<string name="mobile">MOBILE</string>

<string name="next">next</string>

<string name="phone_number">phone number</string>
<string name="places">Places</string>
<string name="provide_info">Profile info</string>
<string name="provide_profile_info">Please provide your name and profile photo</string>

Expand Down
6 changes: 6 additions & 0 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,10 @@
<item name="colorAccent">@color/colorAccent</item>
</style>

<style name="AppTheme3" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:windowTranslucentStatus">true</item>
</style>

</resources>

0 comments on commit 0896805

Please sign in to comment.