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
Support for base64 in recycler
  • Loading branch information
icancode23 committed Jul 21, 2017
commit 4139a2c7fec626e5de268e828a8eba19a87e7de6
37 changes: 6 additions & 31 deletions kute-android-app/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,10 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.scorelab.kute.kute">

<<<<<<< HEAD

<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"></uses-permission>
=======
<uses-permission android:name="android.permission.GET_ACCOUNTS"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
>>>>>>> ProfilePictureUpdate
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-feature
Expand Down Expand Up @@ -38,11 +33,11 @@
android:value="@string/googlemapApi"/>

<activity android:name=".SplashActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<<<<<<< HEAD

=======
>>>>>>> ProfilePictureUpdate
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".Activity.RegisterActivity">
</activity>
Expand Down Expand Up @@ -72,32 +67,12 @@
<service android:name=".PrivateVehicles.App.Services.SyncFacebookFriendsToFirebase"/>

<activity android:name=".PrivateVehicles.App.Activities.PersonDetail"/>
<<<<<<< HEAD
<activity android:name=".PrivateVehicles.App.Activities.ProfilePictureActivity"/>
<activity android:name=".PrivateVehicles.App.Activities.Test">
<activity android:name=".PrivateVehicles.App.Activities.test">
</activity>
<activity android:name=".PrivateVehicles.App.Activities.InitialDetailDialogs">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
=======
<activity
android:name=".PrivateVehicles.App.Activities.test"
android:label="@string/title_activity_test"
android:theme="@style/AppTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>

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

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

>>>>>>> ProfilePictureUpdate
</activity>
</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -355,11 +355,8 @@ public void saveFacebookProfile(Profile pf)
editor.putString("Login_Method","Facebook");
editor.putString("Name", pf.getName());
editor.putString("Id",pf.getId());
<<<<<<< HEAD
editor.putString("Profile_Image","null");
=======
editor.putString("Profile_Image","null"); //It would contain some value when user sets a custom profile image
>>>>>>> ProfilePictureUpdate

editor.putBoolean("Register_db",true);
editor.putBoolean("Sync_Friends_db",true);
editor.apply();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,13 @@ public class CurrentFriendList extends AppCompatActivity implements RecyclerItem
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.current_friends_activity);
<<<<<<< HEAD
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);
>>>>>>> ProfilePictureUpdate
back = (ImageButton) findViewById(R.id.backNav);
back.setOnClickListener(new View.OnClickListener() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ private void handleFragmentNavigation(int nav_direction)
break;
case 3:
Intent pvi = new Intent(this, Main.class);
pref.edit().putBoolean("update_profile_done",true).apply();
startActivity(pvi);
updateProfileOnDb();
finish();
Expand Down Expand Up @@ -194,12 +195,14 @@ private void handleMailFromVehicleFragment(String action,Object attachment){
//Handle updating user profile on firebase after filling the details dialog activity
private void updateProfileOnDb(){
DatabaseReference m= FirebaseDatabase.getInstance().getReference().child("Users/"+pref.getString("Id","null"));
pref.edit().putString("Contact",contact).apply();
m.child("contact_phone").setValue(contact).addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
Log.d(TAG, "Firebase conatct update error Error:" + e.toString());
}
});;
pref.edit().putString("Vehicle",vehicle_name).apply();
m.child("vehicle").setValue(vehicle_name).addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import com.android.volley.toolbox.ImageLoader;
import com.scorelab.kute.kute.PrivateVehicles.App.DataModels.Person;
import com.scorelab.kute.kute.PrivateVehicles.App.Fragments.PlaceHolderFragment;
import com.scorelab.kute.kute.PrivateVehicles.App.Fragments.FrameFragments.PlaceHolderFragment;
import com.scorelab.kute.kute.PrivateVehicles.App.RoundedImageView;
import com.scorelab.kute.kute.PrivateVehicles.App.Utils.VolleySingleton;
import com.scorelab.kute.kute.R;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,9 @@ public class ProfilePictureActivity extends AppCompatActivity implements View.On
CoordinatorLayout cl;
String yourBase64String;
String TAG ="ProfilePictureActivity";
<<<<<<< HEAD

Boolean did_profile_image_change=false;
final int PROFILE_PICTURE_ACTIVITY_CODE=01;
=======
>>>>>>> ProfilePictureUpdate
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Expand Down Expand Up @@ -97,7 +95,6 @@ public void onClick(View v) {
break;
case R.id.update:
String base_64=convertToBase64(current_image);
<<<<<<< HEAD
did_profile_image_change=true;
saveNewImageToDb(base_64);
break;
Expand All @@ -108,11 +105,6 @@ public void onClick(View v) {
i.putExtra("ImageBase64String",yourBase64String);
}
setResult(PROFILE_PICTURE_ACTIVITY_CODE,i);
=======
saveNewImageToDb(base_64);
break;
case R.id.backNav:
>>>>>>> ProfilePictureUpdate
finish();
break;
}
Expand Down Expand Up @@ -194,20 +186,13 @@ protected void onRestoreInstanceState(Bundle savedInstanceState) {
/******************** Custom Functions *************************/
private void setupProfileImage()
{
<<<<<<< HEAD

String Base64=pref.getString("Profile_Image",null);
if(!(pref.getString("Profile_Image",null).equals("null"))){
//Get the Image from base64 string stored in the prefs
//This is the case when the user has a custom profile image
Log.d(TAG,"User has custom profile image");
base64ToBitmap(Base64);

=======
if(pref.getString("Profile_Image",null)!="null"){
//Get the Image from base64 string stored in the prefs
//This is the case when the user has a custom profile image
>>>>>>> ProfilePictureUpdate

}
else {
String img_url = String.format("https://graph.facebook.com/%s/picture?type=large", pref.getString("Id", "null"));
Expand Down Expand Up @@ -328,32 +313,20 @@ private void base64ToBitmap(String base64)
{
byte []imageBytes = Base64.decode(base64, Base64.DEFAULT);
Bitmap decodedImage = BitmapFactory.decodeByteArray(imageBytes, 0, imageBytes.length);
<<<<<<< HEAD
profile_image.setImageBitmap(decodedImage);
=======
>>>>>>> ProfilePictureUpdate
//imageView.setImageBitmap(decodedImage);
}
private void saveNewImageToDb(String base_64)
{
<<<<<<< HEAD
DatabaseReference db_ref= FirebaseDatabase.getInstance().getReference("Users").child(pref.getString("Id","null")).child("img_base64");
db_ref.setValue(base_64).addOnFailureListener(new OnFailureListener() {
=======
DatabaseReference db_ref= FirebaseDatabase.getInstance().getReference("Users").child(pref.getString("Id","null"));
db_ref.setValue(new Person(pref.getString("Name","null"),pref.getString("Id","null"),base_64)).addOnFailureListener(new OnFailureListener() {
>>>>>>> ProfilePictureUpdate
@Override
public void onFailure(@NonNull Exception e) {
Log.d(TAG,"Update profile Image Firebase:"+e.toString());
}
});
//Change the Shared Preference Value
<<<<<<< HEAD
pref.edit().putString("Profile_Image",base_64).apply();
=======
pref.edit().putString("Profile_Image",base_64).commit();
>>>>>>> ProfilePictureUpdate
Log.d(TAG,"Update Profile Image:Done");
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
package com.scorelab.kute.kute.PrivateVehicles.App.Adapters;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.support.v7.widget.RecyclerView;
import android.util.Base64;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand Down Expand Up @@ -100,10 +103,19 @@ private void configureGeneralItem(PersonItemViewHolder vh, int position) {
/********* Test ******/
RoundedImageView person_image = vh.profile_pic;
mImageLoader = VolleySingleton.getInstance(mcontext).getImageLoader();
String img_url = String.format("https://graph.facebook.com/%s/picture?type=normal", p.id);
//Log.d(TAG,"Image Url for ImageLoader is"+img_url);
mImageLoader.get(img_url, ImageLoader.getImageListener(person_image,
R.drawable.ic_person_black_36dp, R.drawable.ic_person_black_36dp));
if(p.img_base64.equals("null")){
String img_url = String.format("https://graph.facebook.com/%s/picture?type=normal", p.id);
//Log.d(TAG,"Image Url for ImageLoader is"+img_url);
mImageLoader.get(img_url, ImageLoader.getImageListener(person_image,
R.drawable.ic_person_black_36dp, R.drawable.ic_person_black_36dp));
}else {
//TODO This task of converting base64 to bitmap can be offloaded to a handler Thread
Bitmap bm=base64ToBitmap(p.img_base64);
person_image.setImageBitmap(bm);
}



/******** End of Test Data ********/
}

Expand All @@ -112,5 +124,13 @@ private void configureRecyclerHead(HeaderRecyclerViewHolder vh) {
vh.head_image.setBackgroundResource(R.drawable.community);
}
/******** End of Configuring of view holders ***************/
//Method to convert Base64 to bitmap
private Bitmap base64ToBitmap(String base64)
{
byte []imageBytes = Base64.decode(base64, Base64.DEFAULT);
Bitmap decodedImage = BitmapFactory.decodeByteArray(imageBytes, 0, imageBytes.length);
return decodedImage;
//imageView.setImageBitmap(decodedImage);
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import android.content.Intent;
import android.content.IntentFilter;
import android.nfc.Tag;
import android.os.AsyncTask;
import android.util.Log;

Expand Down Expand Up @@ -50,11 +51,16 @@ protected Void doInBackground(Integer... params) {
get_friend.addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
Person p = dataSnapshot.getChildren().iterator().next().getValue(Person.class);
if(async_task_listener!=null){
//Check if the weak reference still exists
Log.v(TAG,"Retrieved Friend "+p.name);
taskListener.onTaskCompleted(p);
try {
//Added a a try except just to prevent finding those friends who does not exist now
Person p = dataSnapshot.getChildren().iterator().next().getValue(Person.class);
if (async_task_listener != null) {
//Check if the weak reference still exists
Log.v(TAG, "Retrieved Friend " + p.name);
taskListener.onTaskCompleted(p);
}
}catch (Exception e){
Log.i(TAG,"Error Receiving particular person details from firebase Person Might not Exist");
}
}
@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.scorelab.kute.kute.PrivateVehicles.App.Fragments;
package com.scorelab.kute.kute.PrivateVehicles.App.Fragments.FrameFragments;

import android.content.Intent;
import android.graphics.Bitmap;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.scorelab.kute.kute.PrivateVehicles.App.Fragments;
package com.scorelab.kute.kute.PrivateVehicles.App.Fragments.FrameFragments;

import android.os.Bundle;
import android.support.annotation.Nullable;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.scorelab.kute.kute.PrivateVehicles.App.Fragments;
package com.scorelab.kute.kute.PrivateVehicles.App.Fragments.FrameFragments;

import android.os.Bundle;
import android.support.annotation.Nullable;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.scorelab.kute.kute.PrivateVehicles.App.Fragments;
package com.scorelab.kute.kute.PrivateVehicles.App.Fragments.FrameFragments;

import android.os.Bundle;
import android.support.annotation.Nullable;
Expand Down
Loading