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

Onboarding Activity Completed #76

Open
wants to merge 35 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
2e2d6d7
Merge pull request #1 from UdacityAndroidBasicsScholarship/master
mantyshah Apr 19, 2018
0526a94
test push
mantyshah Apr 19, 2018
1ada4a4
Splash Screen Created. Added App Logo. Added Punch Line.
mantyshah Apr 20, 2018
394078b
Changed Layout to RelativeLayout.
mantyshah Apr 20, 2018
39b2a0f
colorTextSplashScreen Added.
mantyshah Apr 20, 2018
95c4ae3
colorTextSplashScreen Added.
mantyshah Apr 20, 2018
2243ec7
Removed android:orientation from RelativeLayout.
mantyshah Apr 20, 2018
a44ec84
Merge branch 'development' of https://github.com/UdacityAndroidBasics…
mantyshah Apr 24, 2018
5ff2521
removed AppTeme.NoActionBar.
mantyshah Apr 25, 2018
22c9fdb
Merge branch 'development' of https://github.com/UdacityAndroidBasics…
mantyshah Apr 27, 2018
07d3cf3
Build.gradle commit.
mantyshah Apr 27, 2018
e788060
1) Designed Activity for Sign In, Sign Up, Forgot Password.
mantyshah Apr 27, 2018
0884fcd
Merge branch 'development' of https://github.com/UdacityAndroidBasics…
mantyshah May 3, 2018
8feb041
Merge branch 'development' of https://github.com/UdacityAndroidBasics…
mantyshah May 7, 2018
88f1c14
Merge branch 'development' of https://github.com/UdacityAndroidBasics…
mantyshah May 7, 2018
dfa2cbd
Merge branch 'development' of https://github.com/UdacityAndroidBasics…
mantyshah May 7, 2018
440a32a
Merge branch 'development' of https://github.com/UdacityAndroidBasics…
mantyshah May 8, 2018
633b3a7
Designed On Boarding screens and added colors and dimensions and stri…
mantyshah May 10, 2018
9bf657a
Merge branch 'development' into development
mantyshah May 10, 2018
3c4998c
Mergind with upstream development branch.
mantyshah May 10, 2018
1f9444c
Completed designing layout of fragment_fake_call, fragment_sos, fragm…
mantyshah May 11, 2018
2ec4934
Merge branch 'development' of https://github.com/UdacityAndroidBasics…
mantyshah May 14, 2018
7786efa
Merge branch 'development' of https://github.com/UdacityAndroidBasics…
mantyshah May 14, 2018
b9af10e
Merge branch 'development' of https://github.com/UdacityAndroidBasics…
mantyshah May 14, 2018
ff1cc6d
Merge branch 'development' of https://github.com/UdacityAndroidBasics…
mantyshah May 14, 2018
05ccf40
Added translation for strings in gujarati, hindi, punjabi and tamil.
mantyshah May 14, 2018
1f6c234
Merged AndroidMainfest.xml from https://github.com/UdacityAndroidBasi…
mantyshah May 14, 2018
5596e15
Merged fragment_track_user.xml from https://github.com/UdacityAndroid…
mantyshah May 14, 2018
7f8799f
changed tools:context in fragment_fake_call.xml.
mantyshah May 14, 2018
1a7826f
changed tools:context in fragment_sos.xml.
mantyshah May 14, 2018
78054dd
Merge branch 'development' into development
mantyshah May 15, 2018
cbcef38
Merge branch 'development' of https://github.com/UdacityAndroidBasics…
mantyshah May 15, 2018
2bd3298
Merge remote-tracking branch 'origin/development' into development
mantyshah May 15, 2018
87be8e2
Merge branch 'development' of https://github.com/UdacityAndroidBasics…
mantyshah May 15, 2018
e9b76ce
Merge branch 'development' of https://github.com/UdacityAndroidBasics…
mantyshah May 15, 2018
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
5 changes: 4 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ android {
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.generatedDensities = ['hdpi', 'xxhdpi']
vectorDrawables.generatedDensities = ['hdpi', 'xxhdpi']
}
buildTypes {
release {
Expand Down Expand Up @@ -54,8 +54,11 @@ dependencies {
releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.4'
implementation 'com.google.firebase:firebase-messaging:15.0.2'
implementation files('libs/YouTubeAndroidPlayerApi.jar')
implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation "com.google.android.gms:play-services-location:15.0.1"
}


apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.gms.google-services'

24 changes: 24 additions & 0 deletions app/src/debug/res/values/google_maps_api.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<resources>
<!--
TODO: Before you run your application, you need a Google Maps API key.

To get one, follow this link, follow the directions and press "Create" at the end:

https://console.developers.google.com/flows/enableapi?apiid=maps_android_backend&keyType=CLIENT_SIDE_ANDROID&r=AC:DB:F6:74:77:1D:F2:DF:2A:C8:F4:A7:C0:ED:9C:F7:C1:B5:28:8F%3Bin.paperwrk.safetycollabproject

You can also add your credentials to an existing key, using these values:

Package name:
AC:DB:F6:74:77:1D:F2:DF:2A:C8:F4:A7:C0:ED:9C:F7:C1:B5:28:8F

SHA-1 certificate fingerprint:
AC:DB:F6:74:77:1D:F2:DF:2A:C8:F4:A7:C0:ED:9C:F7:C1:B5:28:8F

Alternatively, follow the directions here:
https://developers.google.com/maps/documentation/android/start#get-key

Once you have your key (it starts with "AIza"), replace the "google_maps_key"
string in this file.
-->
<string name="google_maps_key" templateMergeStrategy="preserve" translatable="false">AIzaSyCLN5U22uZvhQy0qZo0TGx4mH4TuGzT-VE</string>
</resources>
47 changes: 36 additions & 11 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
xmlns:tools="http://schemas.android.com/tools"
package="in.paperwrk.safetycollabproject">

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
Expand All @@ -14,8 +15,15 @@
android:smallScreens="false"
android:xlargeScreens="true" />

<!--
The ACCESS_COARSE/FINE_LOCATION permissions are not required to use
Google Maps Android API v2, but you must specify either coarse or fine
location permissions for the 'MyLocation' functionality.
-->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

<application
android:name=".SafetyApplication"
android:name=".SafetyApplication"
android:allowBackup="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
Expand All @@ -31,24 +39,32 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".activities.HomeActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name=".activities.HomeActivity"/>
<activity android:name=".accounts.SignupActivity" />
<activity android:name=".accounts.SigninActivity" />
<activity android:name=".accounts.ForgotPasswordActivity" />
<activity
android:name=".activities.PageIntroActivity"
android:theme="@style/AppTheme.NoActionBar" />
android:theme="@style/AppTheme.NoActionBar"/>

<activity android:name=".activities.AboutActivity" />
<activity android:name=".activities.SettingsActivity" />
<activity android:name=".activities.TrustedContactsActivity" />
<activity android:name=".accounts.ManageAccountActivity" />
<activity android:name=".activities.SirenSoundActivity" />
<activity android:name=".activities.ExploreActivity"/>

<!--
The API key for Google Maps-based APIs is defined as a string resource.
(See the file "res/values/google_maps_api.xml").
Note that the API key is linked to the encryption key used to sign the APK.
You need a different API key for each encryption key, including the release key that is used to
sign the APK for publishing.
You can define the keys for the debug and release targets in src/debug/ and src/release/.
-->
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="@string/google_maps_key" />
<service android:name=".notification.MyFirbaseInstanceIDService"
android:exported="false">
<intent-filter>
Expand All @@ -61,13 +77,22 @@
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<activity android:name=".activities.ExploreActivity"/>

<activity android:name=".activities.PlayerActivity"
android:screenOrientation="landscape"
android:configChanges="orientation|screenSize"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"/>

<!--
The API key for Google Maps-based APIs is defined as a string resource.
(See the file "res/values/google_maps_api.xml").
Note that the API key is linked to the encryption key used to sign the APK.
You need a different API key for each encryption key, including the release key that is used to
sign the APK for publishing.
You can define the keys for the debug and release targets in src/debug/ and src/release/.
-->
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="@string/google_maps_key" />
</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -120,16 +120,18 @@ private void doSignIn() {
String email = mEmailText.getText().toString();
String password = mPasswordText.getText().toString();

if (email.isEmpty()) {
mHelpers.showAlertDialog(getString(R.string.email_required_msg), getString(R.string.enter_email_msg)).show();
return;
}

if (password.isEmpty()) {
mHelpers.showAlertDialog(getString(R.string.password_required_msg), getString(R.string.enter_password_msg)).show();
return;
}
loginWithFirebaseEmailPassword(email, password);
// if (email.isEmpty()) {
// mHelpers.showAlertDialog(getString(R.string.email_required_msg), getString(R.string.enter_email_msg)).show();
// return;
// }
//
// if (password.isEmpty()) {
// mHelpers.showAlertDialog(getString(R.string.password_required_msg), getString(R.string.enter_password_msg)).show();
// return;
// }
// loginWithFirebaseEmailPassword(email, password);

navigateToHome();
}

private void navigateToHome() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public boolean onItemClick(View view, int position, IDrawerItem drawerItem) {
@Override
public boolean onItemClick(View view, int position, IDrawerItem drawerItem) {
if (mFirebaseUser != null) {
mGoogleSignInClient.signOut();
mFirebaseAuth.signOut();
mFirebaseAuth.signOut();
}
navigateToHome();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,4 +181,4 @@ public void destroyItem(ViewGroup container, int position, Object object) {
container.removeView(view);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ public void onBackPressed() {
finish();
}

}
}
Original file line number Diff line number Diff line change
@@ -1,19 +1,44 @@
package in.paperwrk.safetycollabproject.fragments;


import android.Manifest;
import android.content.pm.PackageManager;
import android.location.Location;
import android.os.Build;
import android.os.Bundle;
import android.support.v4.app.ActivityCompat;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.google.android.gms.location.FusedLocationProviderClient;
import com.google.android.gms.location.LocationServices;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MarkerOptions;
import com.google.android.gms.tasks.OnSuccessListener;

import in.paperwrk.safetycollabproject.R;


/**
* A simple {@link Fragment} subclass.
*/
public class TrackUserFragment extends Fragment {
public class TrackUserFragment extends Fragment implements OnMapReadyCallback {


SupportMapFragment mMapFragment;
private GoogleMap mMap;
double latitude;
double longitude;
private FusedLocationProviderClient mFusedLocationClient;


public TrackUserFragment() {
Expand All @@ -25,7 +50,89 @@ public TrackUserFragment() {
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_track_user, container, false);
View v = inflater.inflate(R.layout.fragment_track_user, container, false);
mMapFragment = (SupportMapFragment) getChildFragmentManager().findFragmentById(R.id.mapView);
mFusedLocationClient = LocationServices.getFusedLocationProviderClient(getActivity());
if (mMapFragment == null) {
FragmentManager fragmentManager = getFragmentManager();
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
mMapFragment = SupportMapFragment.newInstance();
fragmentTransaction.replace(R.id.mapView, mMapFragment).commit();
}

mMapFragment.getMapAsync(this);
return v;
}


@Override
public void onMapReady(GoogleMap googleMap) {

mMap = googleMap;
onPermissionCheck();

}

private void onPermissionCheck() {

if (Build.VERSION.SDK_INT < 23) {
if (ActivityCompat.checkSelfPermission(getActivity(), android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(getActivity(), android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {

ActivityCompat.requestPermissions(getActivity(), new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION}, 1);
ActivityCompat.requestPermissions(getActivity(), new String[]{android.Manifest.permission.ACCESS_COARSE_LOCATION}, 1);
}
mFusedLocationClient.getLastLocation()
.addOnSuccessListener(getActivity(), new OnSuccessListener<Location>() {
@Override
public void onSuccess(Location location) {
if (location != null) {
latitude = location.getLatitude();
longitude = location.getLongitude();
LatLng cureentLocation = new LatLng(location.getLatitude(), location.getLongitude());
mMap.addMarker(new MarkerOptions().position(cureentLocation)
.title("Current Location")
.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_GREEN)));
mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(cureentLocation, 15));
}

}
});
} else {
if (ActivityCompat.checkSelfPermission(getActivity(), android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(getActivity(), android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(getActivity(), new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, 1);
mFusedLocationClient.getLastLocation()
.addOnSuccessListener(getActivity(), new OnSuccessListener<Location>() {
@Override
public void onSuccess(Location location) {

if (location != null) {
latitude = location.getLatitude();
longitude = location.getLongitude();
LatLng cureentLocation = new LatLng(location.getLatitude(), location.getLongitude());
mMap.addMarker(new MarkerOptions().position(cureentLocation).title("Current Location"));
mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(cureentLocation, 15));
}

}
});

} else {
mFusedLocationClient.getLastLocation()
.addOnSuccessListener(getActivity(), new OnSuccessListener<Location>() {
@Override
public void onSuccess(Location location) {

if (location != null) {
latitude = location.getLatitude();
longitude = location.getLongitude();
LatLng cureentLocation = new LatLng(location.getLatitude(), location.getLongitude());
mMap.addMarker(new MarkerOptions().position(cureentLocation).title("Current Location"));
mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(cureentLocation, 15));
}

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

import android.content.Intent;

import com.google.firebase.iid.FirebaseInstanceIdService;
import com.google.firebase.messaging.FirebaseMessagingService;
import com.google.firebase.messaging.RemoteMessage;

Expand Down
7 changes: 7 additions & 0 deletions app/src/main/res/anim/animdowntoup.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:duration="3000"
android:fromYDelta="100%p"
android:toYDelta="0%p" />
</set>
7 changes: 7 additions & 0 deletions app/src/main/res/anim/animlefttoright.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:duration="2000"
android:fromXDelta="-100%p"
android:toXDelta="0%p" />
</set>
12 changes: 12 additions & 0 deletions app/src/main/res/anim/scaleup.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<scale
android:duration="1000"
android:fromXScale="0"
android:fromYScale="0"
android:pivotX="50%"
android:pivotY="50%"
android:toXScale="0.8"
android:toYScale="0.8" />

</set>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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/googleicon.png
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/ic_email_black_18dp.png
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/ic_lock_black_18dp.png
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/ic_person_black_18dp.png
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/ic_phone_black_18dp.png
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/onboarding_image_1.png
Binary file added app/src/main/res/drawable/onboarding_image_2.png
Binary file added app/src/main/res/drawable/onboarding_image_4.png
Binary file added app/src/main/res/drawable/women.png
Loading