Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #83

Merged
merged 60 commits into from
Nov 30, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
5c019fb
fix: [ #27 ] Current location will be set when app starts
CloudyPadmal Mar 30, 2017
64286b2
Merge pull request #29 from CloudyPadmal/currentLocation
Dilu9218 Apr 12, 2017
4473920
Added the switch activity switching between private and public reposi…
icancode23 Jun 19, 2017
81f2eed
resolving conflicts
icancode23 Jun 19, 2017
3a78807
Merge branch 'master' into develop
icancode23 Jun 19, 2017
26b85ae
ignore google services
icancode23 Jun 19, 2017
eb9d22b
added the original google services json
icancode23 Jun 19, 2017
f125c79
Minor change Switch activity for public and private vehicles ready
icancode23 Jun 19, 2017
4639492
Added the HomeBaseScreen
icancode23 Jun 19, 2017
5f86b14
Facebook profile extracted person registered as a user in firebase db
icancode23 Jun 23, 2017
ae64dfa
Merge pull request #70 from KuteGSOC/HomeBaseScreen
NickHub4017 Jun 23, 2017
af7dd27
Added Feature for Friend Profile Viewing also improved fragment flow…
icancode23 Jun 25, 2017
db1049a
Replaced google services json and removed my own keys
icancode23 Jun 25, 2017
e3dd479
Code Refactor to remove unnecessary spaces between brackets and unne…
icancode23 Jun 26, 2017
2c30d1d
Replaced google services json and removed my own keys
icancode23 Jun 26, 2017
6d18f95
Merge pull request #71 from KuteGSOC/ConnectViewFriends
NickHub4017 Jun 30, 2017
ab5d123
Some Changes
icancode23 Jul 3, 2017
cc50fe7
Added the feature for custom profile Image
icancode23 Jul 3, 2017
377c596
Changed the layout a bit
icancode23 Jul 3, 2017
b4fa3f9
minor change
icancode23 Jul 5, 2017
44e7266
check
icancode23 Jul 5, 2017
e3df3b7
minor change
icancode23 Jul 5, 2017
a4eb9bd
minor change
icancode23 Jul 5, 2017
d610803
Completed profile edit without integrating edit profile image
icancode23 Jul 6, 2017
14af78b
Merge pull request #72 from KuteGSOC/ProfilePictureEdit
NickHub4017 Jul 7, 2017
35af0b9
midway
icancode23 Jul 7, 2017
f5ed115
Replaced google services and removed self ids from strings
icancode23 Jul 7, 2017
2c303cd
few changes
icancode23 Jul 7, 2017
31bd401
dialog layouts done
icancode23 Jul 7, 2017
fffefde
Deleted some test data sent to git by mistake
icancode23 Jul 7, 2017
4418eac
Complete But not tested
icancode23 Jul 9, 2017
bd86bf1
Dynamic loading of friends using a pull to load recycler view
icancode23 Jul 11, 2017
b4d654e
minor change
icancode23 Jul 12, 2017
11b210e
Merge pull request #73 from KuteGSOC/UserSelfProfileFilling
NickHub4017 Jul 14, 2017
60dff52
small fix
icancode23 Jul 17, 2017
4139a2c
Support for base64 in recycler
icancode23 Jul 21, 2017
9ac333c
replaced google services json
icancode23 Jul 22, 2017
6f7bb5e
fix
icancode23 Jul 22, 2017
7d9e9f8
fix
icancode23 Jul 22, 2017
ef597b2
fix
icancode23 Jul 22, 2017
742ab5c
fix
icancode23 Jul 22, 2017
a73774b
Merge pull request #75 from KuteGSOC/WorkflowFix
NickHub4017 Jul 22, 2017
45a03f5
added routes backend
icancode23 Aug 3, 2017
c75a11d
added routes backend
icancode23 Aug 3, 2017
c65ff11
Merge pull request #76 from KuteGSOC/routesBackend
NickHub4017 Aug 4, 2017
ba5d489
check
icancode23 Aug 13, 2017
f7c04e6
Majorly Complete
icancode23 Aug 21, 2017
64d2e67
Majorly Complete
icancode23 Aug 21, 2017
061a655
Added backend project
icancode23 Aug 21, 2017
b94523a
Added backend project
icancode23 Aug 21, 2017
f0a44f6
Added backend project
icancode23 Aug 21, 2017
e8360b0
Added Send Notification end point on server
icancode23 Aug 22, 2017
7e687e7
Added Send Notification end point on server
icancode23 Aug 22, 2017
67fed75
Merge pull request #77 from KuteGSOC/TripUI
NickHub4017 Aug 23, 2017
dec96c8
Beta Done and completed
icancode23 Aug 26, 2017
b68a026
Beta Done and completed
icancode23 Aug 26, 2017
512d728
Beta Backend
icancode23 Aug 26, 2017
07cd0a8
Beta Backend
icancode23 Aug 26, 2017
ddf5023
Merge pull request #78 from KuteGSOC/BetaComplete
NickHub4017 Aug 26, 2017
b123d3e
Merge branch 'master' into develop
NickHub4017 Nov 30, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Facebook profile extracted person registered as a user in firebase db
  • Loading branch information
icancode23 committed Jun 23, 2017
commit 5f86b1426ec72b9c1f77c2de22819b4fb308ece0
2 changes: 1 addition & 1 deletion kute-android-app/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ dependencies {
compile 'com.google.android.gms:play-services-location:10.0.1'
compile 'com.facebook.android:facebook-android-sdk:4.11.0'
compile 'com.android.volley:volley:1.0.0'
compile 'com.android.support:appcompat-v7:25.0.0'
compile 'com.android.support:appcompat-v7:25.1.1'
compile 'com.android.support:design:25.1.1'
compile 'de.hdodenhof:circleimageview:2.1.0'
testCompile 'junit:junit:4.12'
Expand Down
17 changes: 7 additions & 10 deletions kute-android-app/app/google-services.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,27 @@
{
"project_info": {
"project_number": "512059903778",
"firebase_url": "https://kutenew-c36c1.firebaseio.com",
"project_id": "kutenew-c36c1",
"storage_bucket": "kutenew-c36c1.appspot.com"
"project_number": "573930911497",
"firebase_url": "https://kute-ec351.firebaseio.com",
"project_id": "kute-ec351",
"storage_bucket": "kute-ec351.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:512059903778:android:e5312257f7c86a49",
"mobilesdk_app_id": "1:573930911497:android:e5312257f7c86a49",
"android_client_info": {
"package_name": "com.scorelab.kute.kute"
}
},
"oauth_client": [
{
"client_id": "512059903778-uto3b2anj6phigvs60t99bbb1sl0oe7d.apps.googleusercontent.com",
"client_id": "573930911497-ldk25q8n013dfb3mrtoorhguv010e9hj.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyDrROeYR1glcHf4yPmneck3KbcS3fK4LAo"
},
{
"current_key": "AIzaSyCSZ7SOif62k5h3JSO4J9hhkFMsvzjJzO8"
"current_key": "AIzaSyCIXYIx3kwTujl325ra11sz81DlbhHgsa8"
}
],
"services": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@


import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Bitmap;
import android.os.AsyncTask;
import android.os.Bundle;
Expand All @@ -21,6 +22,8 @@
import com.facebook.CallbackManager;
import com.facebook.FacebookCallback;
import com.facebook.FacebookException;
import com.facebook.Profile;
import com.facebook.ProfileTracker;
import com.facebook.login.LoginManager;
import com.facebook.login.LoginResult;
import com.facebook.login.widget.LoginButton;
Expand Down Expand Up @@ -185,6 +188,7 @@ public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {

Intent intentdone=new Intent(RegisterActivity.this, SplashActivity.class);
startActivity(intentdone);
finish();


} else {
Expand All @@ -202,15 +206,38 @@ public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {

mCallbackManager = CallbackManager.Factory.create();
LoginButton loginButton = (LoginButton) findViewById(R.id.connectWithFbButton);
loginButton.setReadPermissions("email", "public_profile");
loginButton.setReadPermissions("email", "public_profile","user_friends");

loginButton.registerCallback(mCallbackManager, new FacebookCallback<LoginResult>() {
private ProfileTracker mProfileTracker;
@Override
public void onSuccess(LoginResult loginResult) {
try {
Log.d(TAG, "facebook:onSuccess:" + loginResult);
//Saving Facebook Credentials of the user
if(Profile.getCurrentProfile() == null) {
mProfileTracker = new ProfileTracker() {
@Override
protected void onCurrentProfileChanged(Profile profile, Profile profile2) {
// profile2 is the new profile
Log.d("check",profile2.getCurrentProfile().toString());
saveFacebookProfile(profile2);
mProfileTracker.stopTracking();
}
};
mProfileTracker.startTracking();
// no need to call startTracking() on mProfileTracker
// because it is called by its constructor, internally.
}
else {
Log.d("check",Profile.getCurrentProfile().toString());
saveFacebookProfile(Profile.getCurrentProfile());
}

Log.d(TAG,"Facebook Login:Saved Credentials to Shared Prefs");
//Auth with Firebase
handleFacebookAccessToken(loginResult.getAccessToken());

}
catch (Exception e){
e.printStackTrace();
Expand Down Expand Up @@ -321,8 +348,19 @@ public void signOut() {
Toast.makeText(getApplicationContext(),"You have been Signout from the Kute",Toast.LENGTH_LONG).show();
//updateUI(null);
}
public void getImage(String url){
ImageRequest ir = new ImageRequest(url, new Response.Listener<Bitmap>() {
public void saveFacebookProfile(Profile pf)
{
SharedPreferences pref=getApplicationContext().getSharedPreferences("user_credentials",0);
SharedPreferences.Editor editor=pref.edit();
editor.putString("Login_Method","Facebook");
editor.putString("Name", pf.getName());
editor.putString("Id",pf.getId());
editor.putString("Profile_Image",pf.getProfilePictureUri(100,100).toString());
editor.commit();
}

public void getImage(String url){
ImageRequest ir = new ImageRequest(url, new Response.Listener<Bitmap>() {
@Override
public void onResponse(Bitmap response) {
ImageHandler.saveImageToprefrence(getSharedPreferences(ImageHandler.MainKey,MODE_PRIVATE),response);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
person_list=new ArrayList<Person>();
for(int i=0;i<4;++i)
{
Person temp=new Person("Nipun Arora");
Person temp=new Person("Nipun Arora","null","null");
person_list.add(temp);
}
/************** Initialise the views *********/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,30 @@
package com.scorelab.kute.kute.PrivateVehicles.App.Activities;

import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.design.widget.NavigationView;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.MenuItem;
import android.widget.TextView;

import com.google.android.gms.tasks.OnFailureListener;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.scorelab.kute.kute.PrivateVehicles.App.DataModels.Person;
import com.scorelab.kute.kute.PrivateVehicles.App.Fragments.HomeBaseFragment;
import com.scorelab.kute.kute.R;


public class Main extends AppCompatActivity
implements NavigationView.OnNavigationItemSelectedListener {
TextView route_request_number;
private final String TAG="MainPrivateVehicle";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Expand All @@ -37,9 +45,10 @@ protected void onCreate(Bundle savedInstanceState) {
/******************************* End Of Drawer Setup **************************/
/********************* Load Home Base Fragment**********/
getSupportFragmentManager().beginTransaction().replace(R.id.frameDrawer,new HomeBaseFragment()).commit();



SharedPreferences pref = getApplicationContext().getSharedPreferences("user_credentials", 0); // 0 - for private mode
Log.d("SharedPreference",pref.getString("Profile_Image",null));
//Register yourself to the firebase db
registerFirebaseDbSelf(pref);


}
Expand Down Expand Up @@ -82,4 +91,21 @@ public void onBackPressed() {
}
}
/********************* End of nav drawer functions *********************/
public void registerFirebaseDbSelf(SharedPreferences pref)
{
Person temp=new Person(pref.getString("Name",null),pref.getString("Id",null),pref.getString("Profile_Image",null));
DatabaseReference root= FirebaseDatabase.getInstance().getReference();
DatabaseReference users=root.child("Users");
Log.d(TAG,"Saving Self To db");
users.child(temp.id).setValue(temp).addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
Log.d(TAG,"Firebase Self Add Error:"+e.toString());
}
});




}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,30 @@
public class Person {
/***************** Defing Properties ***********/
//Add provision for vehicle
public String id,name,img_url,occupation;
public Boolean is_friend; // This will indicate whether the given person is users friend
//Make these variables private
public String id,name,img_url,occupation,other_details;
//Implement in some other way public Boolean is_friend; // This will indicate whether the given person is users friend
public ArrayList<Route> route_list;

/*********** Properties Defined *******/

/****************** This constructor will configure for the list item
****************** rest detail will be filled later when person detail activity is called *******/

public Person(String name) //Add id and img_url(Not being added right now because we dont have the backend for now)
public Person(String name,String id,String img_url) //Add id and img_url(Not being added right now because we dont have the backend for now)
{
this.name=name;
this.img_url=img_url;
this.id=id;
}

/************** This method will be invoked when we load personDetail Activity **********/

public void completePersonDetail(String occupation,boolean is_friend,ArrayList<Route>list)
public void completePersonDetail(String occupation,ArrayList<Route>list,String other_details)
{
this.occupation=occupation;
this.is_friend=is_friend;
this.route_list=list;
this.other_details=other_details;
}

}
1 change: 0 additions & 1 deletion kute-android-app/app/src/main/res/layout/app_bar_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.nipunarora.kuteui.Activities.Main"
android:orientation="vertical">

<android.support.design.widget.AppBarLayout
Expand Down
2 changes: 1 addition & 1 deletion kute-android-app/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<string name="navigation_drawer_close">Close navigation drawer</string>

<string name="action_settings">Settings</string>
<string name="facebook_app_id">put in your facebook app id here</string>
<string name="facebook_app_id">427052427666913</string>
<string name="googlemapApi">put in your google maps key here</string>

</resources>