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 15 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
1 change: 1 addition & 0 deletions kute-android-app/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ dependencies {
compile 'com.android.support:appcompat-v7:25.1.1'
compile 'com.android.support:design:25.1.1'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
}

Expand Down
39 changes: 21 additions & 18 deletions kute-android-app/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.scorelab.kute.kute">
package="com.scorelab.kute.kute">


<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.INTERNET" />
Expand All @@ -26,7 +27,7 @@
android:theme="@style/AppTheme">
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="@string/facebook_app_id" />
android:value="@string/facebook_app_id"/>
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="@string/googlemapApi"/>
Expand All @@ -37,39 +38,41 @@

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

</activity>

<activity android:name=".Activity.RegisterActivity" >

<activity android:name=".Activity.RegisterActivity">
</activity>

<activity
android:name="com.facebook.FacebookActivity"
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:label="@string/app_name"
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
android:theme="@android:style/Theme.Translucent.NoTitleBar"/>
<activity android:name=".Activity.MainActivity">

</activity>
<activity
android:name=".LandActivity"
android:label="@string/title_activity_land"
android:theme="@style/AppTheme">

</activity>
<activity android:name=".Activity.TaskSelection"></activity>
<activity android:name=".Activity.VehicleSelection" ></activity>
<service android:name=".Services.BacKService"
android:process=":backservice"></service>
<activity android:name=".Activity.SwitchPrivatePublicActivity" />
<activity android:name=".Activity.TaskSelection"/>
<activity android:name=".Activity.VehicleSelection"/>

<service
android:name=".Services.BacKService"
android:process=":backservice"/>

<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"/>
<activity android:name=".PrivateVehicles.App.Activities.ProfilePictureActivity"/><![CDATA[
>
]]>

<activity android:name=".PrivateVehicles.App.Activities.ProfilePictureActivity"/>
<activity android:name=".PrivateVehicles.App.Activities.InitialDetailDialogs">

</activity>

</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
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.InitialDetailDialogs;
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;
Expand All @@ -40,6 +41,7 @@ public class SwitchPrivatePublicActivity extends AppCompatActivity implements Vi
BroadcastReceiver sync_friend_service_receiver;
IntentFilter filter_sync_friend_receiver;
private final String Action = SyncFacebookFriendsToFirebase.class.getName() + "Complete";
SharedPreferences pref;

/***************** Overrides ***************/
@Override
Expand All @@ -51,7 +53,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
privateVeh = (ImageButton) findViewById(R.id.privateVehicle);
publicVeh.setOnClickListener(this);
privateVeh.setOnClickListener(this);
final SharedPreferences pref = getApplicationContext().getSharedPreferences("user_credentials", 0); // 0 - for private mode
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)) {
Expand Down Expand Up @@ -83,8 +85,7 @@ public void onClick(View v) {
startActivity(i);
break;
case R.id.privateVehicle:
Intent pvi = new Intent(this, Main.class);
startActivity(pvi);
handlePrivateVehicleClick();
break;
default:
Toast.makeText(this, "Not Clickable", Toast.LENGTH_SHORT).show();
Expand Down Expand Up @@ -150,4 +151,15 @@ public void onCompleted(GraphResponse response) {
Log.d(TAG, "Graph Request error" + e.toString());
}
}
//Handles the click on the private vehicle part
private void handlePrivateVehicleClick(){
if(pref.getBoolean("update_profile_done",false)){
Intent pvi = new Intent(this, Main.class);
startActivity(pvi);
}
else {
Intent pvi = new Intent(this, InitialDetailDialogs.class);
startActivity(pvi);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,43 @@
import android.util.Log;
import android.view.View;
import android.widget.ImageButton;
import android.widget.ProgressBar;

import com.scorelab.kute.kute.PrivateVehicles.App.Adapters.FriendRecyclerAdapter;
import com.scorelab.kute.kute.PrivateVehicles.App.AsyncTasks.LoadFirebaseFriends;
import com.scorelab.kute.kute.PrivateVehicles.App.DataModels.Person;
import com.scorelab.kute.kute.PrivateVehicles.App.Interfaces.AsyncTaskListener;
import com.scorelab.kute.kute.PrivateVehicles.App.Interfaces.RecyclerItemClick;
import com.scorelab.kute.kute.R;
import java.util.ArrayList;



public class CurrentFriendList extends AppCompatActivity implements RecyclerItemClick {
//We can optimize the loading of friends by restricting firebase content to return just two fields for each user and then retrieve detail only when specific persons detail activity is opened
public class CurrentFriendList extends AppCompatActivity implements RecyclerItemClick,AsyncTaskListener {
static String TAG = "CurrentFriendActivity";
ArrayList<Person> person_list;
ArrayList<String> person_list;
ArrayList<Person>person_detail_list;
RecyclerView friend_recycler;
FriendRecyclerAdapter recycler_adapter;
ImageButton back;
final int[] pastVisiblesItems = new int[1];
final int[] visibleItemCount = new int[1];
final int[] totalItemCount = new int[1];
int start_index_async,last_index_async,range;
ProgressBar progressBar;
boolean is_async_task_running=false;// A boolean created to prevent a new asynctask being created everytime we scroll down
LoadFirebaseFriends load_friends_async;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.current_friends_activity);
person_list = (ArrayList<Person>) getIntent().getSerializableExtra("FriendList");

person_list = (ArrayList<String>)getIntent().getSerializableExtra("FriendList");
person_detail_list=(ArrayList<Person>) getIntent().getSerializableExtra("FriendDetailList");
/************** Initialise the views *********/
//TODO get friends from facebook and google and get their images
Log.d(TAG,"The length of the person list is:"+Integer.toString(person_list.size()));
progressBar=(ProgressBar)findViewById(R.id.progressBar);
back = (ImageButton) findViewById(R.id.backNav);
back.setOnClickListener(new View.OnClickListener() {
@Override
Expand All @@ -36,11 +54,31 @@ public void onClick(View v) {
}
});
friend_recycler = (RecyclerView) findViewById(R.id.personRecycler);
recycler_adapter = new FriendRecyclerAdapter(person_list, this, this);
RecyclerView.LayoutManager mLayoutManager = new LinearLayoutManager(getApplicationContext());
recycler_adapter = new FriendRecyclerAdapter(person_detail_list, this, this);
final android.support.v7.widget.LinearLayoutManager mLayoutManager = new LinearLayoutManager(getApplicationContext());
friend_recycler.setLayoutManager(mLayoutManager);
friend_recycler.setItemAnimator(new DefaultItemAnimator());
friend_recycler.setAdapter(recycler_adapter);
friend_recycler.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrolled(RecyclerView recyclerView,
int dx, int dy) {
super.onScrolled(recyclerView, dx, dy);
visibleItemCount[0] = mLayoutManager.getChildCount();//Gives the number of children currently on the screen
totalItemCount[0] = mLayoutManager.getItemCount();//gives total items of recycler view
pastVisiblesItems[0] = mLayoutManager.findFirstVisibleItemPosition();//gives the index of item at the top of the screen
Log.d("Recycler",String.format("visible %d past visible %d total %d",visibleItemCount[0],pastVisiblesItems[0],totalItemCount[0]));
if ((visibleItemCount[0] + pastVisiblesItems[0]) >= totalItemCount[0]&& visibleItemCount[0]!=totalItemCount[0] ) {
if(mLayoutManager.findLastCompletelyVisibleItemPosition()==recycler_adapter.getItemCount()-1 /*&& recycleradapter.getItemCount()>5 You have your ofset values here*/){
//************************* Reached the End of recycler View ***********/
Log.d(TAG,"reached the Bottom");
//******************** Call The function to load more data *********//
loadRecyclerItems(recycler_adapter.getItemCount()-1);
}
}
}
});

}

@Override
Expand All @@ -51,4 +89,61 @@ public void onRecyclerItemClick(int position) {
i.putExtra("isAFriend", true);
startActivity(i);
}
//Asynctask Interacting interface
@Override
public void onTaskStarted(Object...attachments) {
//toggle the boolean to show that asynctask is running
is_async_task_running=true;
//get the index from asynctask
start_index_async=(int)attachments[0];
last_index_async=(int)attachments[1];
range=last_index_async-last_index_async+1;

}

@Override
public void onTaskCompleted(Object attachment) {
Log.d(TAG,"The start indice is "+Integer.toString(start_index_async));
Person temp=(Person)attachment;
person_detail_list.add(temp);
Log.d(TAG,"Received in test Friend name: "+temp.name);
if(start_index_async>=last_index_async) {
recycler_adapter.notifyItemRangeInserted(recycler_adapter.getItemCount(),range);
is_async_task_running=false;
Log.d(TAG,"Current Length Of Recycler is"+Integer.toString(recycler_adapter.getItemCount()-1));
progressBar.setVisibility(View.GONE);
}
++start_index_async;

}

/***************** Custom Function ******/
private void loadRecyclerItems(Integer current_length)
{
Log.d(TAG,"Current size is "+Integer.toString(recycler_adapter.getItemCount()));
if(person_list.size()==current_length){
//When we have loaded all the items
Log.d("check","Yes");
}
else {
//************** Set The visibility of progress bar as true *****/
progressBar.setVisibility(View.VISIBLE);
int difference = person_list.size() - current_length;
//we need to load more friends from facebook
if (!is_async_task_running) {
load_friends_async=new LoadFirebaseFriends(person_list,this);
if (difference < 9) {
load_friends_async.execute(current_length+1, (person_list.size()-1));
}else {
load_friends_async.execute(current_length+1,current_length+9);
}
}
}
}

@Override
protected void onStop() {
super.onStop();
load_friends_async.cancel(true);
}
}
Loading