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 6 commits
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
Binary file removed .DS_Store
Binary file not shown.
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@

*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
/app/src/main/res/values/keyfile.xml
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
2 changes: 2 additions & 0 deletions kute-android-app/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
<activity android:name=".Activity.SwitchPrivatePublicActivity" />
<activity android:name=".PrivateVehicles.App.Activities.Main"/>
<activity android:name=".PrivateVehicles.App.Activities.CurrentFriendList"/>
<service android:name=".PrivateVehicles.App.Services.SyncFacebookFriendsToFirebase"/>
<activity android:name=".PrivateVehicles.App.Activities.PersonDetail"/>
</application>

</manifest>
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,21 @@ 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.putBoolean("Register_db",true);
editor.putBoolean("Sync_Friends_db",true);
editor.apply();
}

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
@@ -1,55 +1,153 @@
package com.scorelab.kute.kute.Activity;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.ImageButton;
import android.widget.Toast;

import com.facebook.AccessToken;
import com.facebook.GraphRequest;
import com.facebook.GraphResponse;
import com.facebook.HttpMethod;
import com.google.android.gms.tasks.OnFailureListener;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.scorelab.kute.kute.LandActivity;
import com.scorelab.kute.kute.PrivateVehicles.App.Activities.Main;
import com.scorelab.kute.kute.PrivateVehicles.App.DataModels.Person;
import com.scorelab.kute.kute.PrivateVehicles.App.Services.SyncFacebookFriendsToFirebase;
import com.scorelab.kute.kute.R;

import org.json.JSONArray;
import org.json.JSONObject;

/**
* Created by nipunarora on 19/06/17.
*/

public class SwitchPrivatePublicActivity extends AppCompatActivity implements View.OnClickListener {
ImageButton publicVeh,privateVeh;
ImageButton publicVeh, privateVeh;
private final String TAG = "SwitchActivity";
BroadcastReceiver sync_friend_service_receiver;
IntentFilter filter_sync_friend_receiver;
private final String Action = SyncFacebookFriendsToFirebase.class.getName() + "Complete";

/***************** Overrides ***************/
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.switch_public_private_activity_layout);
/************* Initialise Views *************************/

publicVeh=(ImageButton)findViewById(R.id.publicVehicle);
privateVeh=(ImageButton)findViewById(R.id.privateVehicle);
publicVeh = (ImageButton) findViewById(R.id.publicVehicle);
privateVeh = (ImageButton) findViewById(R.id.privateVehicle);
publicVeh.setOnClickListener(this);
privateVeh.setOnClickListener(this);

final SharedPreferences pref = getApplicationContext().getSharedPreferences("user_credentials", 0); // 0 - for private mode
/****************** Sync Data For First Timers to the app *********/
/******************* Register to Firebase for new User ********/
if (pref.getBoolean("Register_db", true)) {
registerFirebaseDbSelf(pref);
pref.edit().putBoolean("Register_db", false).apply();
}
if (pref.getBoolean("Sync_Friends_db", true)) {
syncFacebookFriendsDb();
//Boolean will be inverted at the end of service
}
//Initialising Broadcast receiver with its intent filter
sync_friend_service_receiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
Log.d(TAG, "Returned From SyncFacebookFriendsToFirebase Service");
//TODO alter the friend fragment to show up friends
Boolean x = pref.getBoolean("Sync_Friends_db", true);
Log.d(TAG, "onReceive Broadcast" + x.toString());
}
};
filter_sync_friend_receiver = new IntentFilter(Action);
}

@Override
public void onClick(View v) {
switch(v.getId())
{
switch (v.getId()) {
case R.id.publicVehicle:
Intent i=new Intent(this, LandActivity.class);
Intent i = new Intent(this, LandActivity.class);
startActivity(i);
break;
case R.id.privateVehicle:
Intent pvi=new Intent(this, Main.class);
Intent pvi = new Intent(this, Main.class);
startActivity(pvi);
break;
default:
Toast.makeText(this,"Not Clickable",Toast.LENGTH_SHORT).show();
Toast.makeText(this, "Not Clickable", Toast.LENGTH_SHORT).show();
break;

}
}

/*************** End Of overrides ***********/
/**************** Custom Functions Invoked only once on app installation *******/

public void registerFirebaseDbSelf(final 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());
//reinvert the boolean if saving the user details face an error
pref.edit().putBoolean("Register_db", true).apply();
}
});
}

@Override
protected void onResume() {
super.onResume();
registerReceiver(sync_friend_service_receiver, filter_sync_friend_receiver);
}

@Override
protected void onPause() {
super.onPause();
unregisterReceiver(sync_friend_service_receiver);
}

/***************** Other Custom Functions ***********/
private void syncFacebookFriendsDb() {
try {
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"/me/friends",
null,
HttpMethod.GET,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
/* handle the result */
JSONObject x = response.getJSONObject();
Person temp;
try {
JSONArray dta = x.getJSONArray("data");
Log.d("friend json", dta.toString());
Intent start_friend_sync_service = new Intent(getApplicationContext(), SyncFacebookFriendsToFirebase.class);
start_friend_sync_service.putExtra("FriendArray", dta.toString());
startService(start_friend_sync_service);
Log.d(TAG, "Friend Sync Service Intent Sent");
} catch (Exception e) {
Log.d(TAG, "Graph Request Callback error" + e.toString());
}
}
}).executeAsync();
} catch (Exception e) {
Log.d(TAG, "Graph Request error" + e.toString());
}
}
}
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
package com.scorelab.kute.kute.Activity;

import android.app.Activity;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.Toast;

import com.scorelab.kute.kute.R;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import android.app.Activity;
import android.app.Fragment;

import android.app.FragmentManager;
import android.app.FragmentTransaction;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
Expand All @@ -15,7 +13,6 @@
import android.os.Bundle;
import android.os.Handler;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v4.app.ActivityCompat;
import android.support.v4.os.ResultReceiver;
import android.view.View;
Expand All @@ -35,12 +32,10 @@
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.MapFragment;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.Marker;
import com.google.android.gms.maps.model.MarkerOptions;
import com.scorelab.kute.kute.Activity.FragmentUI.PublishFragment;
import com.scorelab.kute.kute.Activity.FragmentUI.TrackFragment;
import com.scorelab.kute.kute.Activity.TaskSelection;
import com.scorelab.kute.kute.Services.BacKService;
import com.scorelab.kute.kute.Util.ImageHandler;
Expand Down
Loading