├── php_files
├── sample
├── pic_01.png
├── pic_02.png
├── pic_03.png
├── pic_04.png
├── pic_05.png
├── pic_06.png
├── pic_07.png
├── pic_08.png
├── pic_09.png
├── pic_10.png
├── pic_11.png
├── forgotPass.php
├── proposeRide.php
├── pickUpPoints.php
├── login.php
├── proposalsList.php
├── foundRidesList.php
├── updateStatus.php
├── offeredRidesList.php
├── register.php
├── test.php
└── offerRide.php
├── app
├── .gitignore
├── src
│ ├── main
│ │ ├── res
│ │ │ ├── drawable
│ │ │ │ ├── bg.PNG
│ │ │ │ ├── ba.jpeg
│ │ │ │ ├── fpp.png
│ │ │ │ ├── home.png
│ │ │ │ ├── mpp.png
│ │ │ │ ├── pic.png
│ │ │ │ ├── capopic.png
│ │ │ │ ├── getcapo.png
│ │ │ │ ├── logout.png
│ │ │ │ ├── track.png
│ │ │ │ ├── letscapo.png
│ │ │ │ ├── myprofile.png
│ │ │ │ ├── backgrounds.jpg
│ │ │ │ ├── price.xml
│ │ │ │ ├── text_selector.xml
│ │ │ │ ├── ripple_effect.xml
│ │ │ │ ├── item_bg.xml
│ │ │ │ ├── side_nav_bar.xml
│ │ │ │ ├── image_bg.xml
│ │ │ │ └── loginbutton_selector.xml
│ │ │ ├── mipmap-hdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-mdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── menu
│ │ │ │ ├── main.xml
│ │ │ │ ├── get_capo.xml
│ │ │ │ ├── track.xml
│ │ │ │ ├── lets_capo.xml
│ │ │ │ ├── my_profile.xml
│ │ │ │ └── activity_main_drawer.xml
│ │ │ ├── drawable-v21
│ │ │ │ ├── ic_menu_send.xml
│ │ │ │ ├── ic_menu_slideshow.xml
│ │ │ │ ├── ic_menu_gallery.xml
│ │ │ │ ├── ic_menu_manage.xml
│ │ │ │ ├── ic_menu_camera.xml
│ │ │ │ └── ic_menu_share.xml
│ │ │ ├── values
│ │ │ │ ├── dimens.xml
│ │ │ │ ├── attrs.xml
│ │ │ │ ├── drawables.xml
│ │ │ │ ├── colors.xml
│ │ │ │ ├── styles.xml
│ │ │ │ └── strings.xml
│ │ │ ├── anim
│ │ │ │ ├── cycle.xml
│ │ │ │ ├── shake.xml
│ │ │ │ ├── right_out.xml
│ │ │ │ ├── left_out.xml
│ │ │ │ ├── left_enter.xml
│ │ │ │ ├── right_enter.xml
│ │ │ │ └── test.xml
│ │ │ └── layout
│ │ │ │ ├── fragment_my_found_ride_.xml
│ │ │ │ ├── activity_first.xml
│ │ │ │ ├── custom_toast.xml
│ │ │ │ ├── content_get_capo.xml
│ │ │ │ ├── content_lets_capo.xml
│ │ │ │ ├── fragment_get_capo__frag2.xml
│ │ │ │ ├── content_track.xml
│ │ │ │ ├── activity_get_capo.xml
│ │ │ │ ├── activity_main.xml
│ │ │ │ ├── activity_track.xml
│ │ │ │ ├── activity_lets_capo.xml
│ │ │ │ ├── activity_my_profile.xml
│ │ │ │ ├── content_main.xml
│ │ │ │ ├── activity_login_base.xml
│ │ │ │ ├── app_bar_track.xml
│ │ │ │ ├── app_bar_get_capo.xml
│ │ │ │ ├── app_bar_lets_capo.xml
│ │ │ │ ├── app_bar_main.xml
│ │ │ │ ├── app_bar_my_profile.xml
│ │ │ │ ├── fragment_main_found_.xml
│ │ │ │ ├── fragment_main_offered_.xml
│ │ │ │ ├── fragment_get_capo__frag1.xml
│ │ │ │ ├── fragment_lets_capo__frag2.xml
│ │ │ │ ├── nav_header_main.xml
│ │ │ │ ├── ride_item_found.xml
│ │ │ │ ├── forgotpassword_layout.xml
│ │ │ │ ├── ride_item.xml
│ │ │ │ ├── fragment_my_offered_rides_.xml
│ │ │ │ ├── login_layout.xml
│ │ │ │ ├── content_my_profile.xml
│ │ │ │ └── signup_layout.xml
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── example
│ │ │ │ └── dimpychhabra
│ │ │ │ └── capo
│ │ │ │ ├── SimpleFragmentPagerAdapter.java
│ │ │ │ ├── CustomToast.java
│ │ │ │ ├── RideAdapter.java
│ │ │ │ ├── RequestCapoAdapter.java
│ │ │ │ ├── FirstActivity.java
│ │ │ │ ├── RidesFoundAdapter.java
│ │ │ │ ├── LoginBaseActivity.java
│ │ │ │ ├── getCapo_Frag1.java
│ │ │ │ ├── letsCapo_Frag2.java
│ │ │ │ ├── getCapo_Frag2.java
│ │ │ │ ├── ForgotPassword_Fragment.java
│ │ │ │ ├── Ride.java
│ │ │ │ ├── BaseActivity.java
│ │ │ │ ├── MainActivity.java
│ │ │ │ ├── GetCapo.java
│ │ │ │ ├── LetsCapo.java
│ │ │ │ ├── MyProfile.java
│ │ │ │ ├── Track.java
│ │ │ │ └── Main_offered_Frag.java
│ │ └── AndroidManifest.xml
│ ├── test
│ │ └── java
│ │ │ └── com
│ │ │ └── example
│ │ │ └── dimpychhabra
│ │ │ └── capo
│ │ │ └── ExampleUnitTest.java
│ ├── release
│ │ └── res
│ │ │ └── values
│ │ │ └── google_maps_api.xml
│ └── androidTest
│ │ └── java
│ │ └── com
│ │ └── example
│ │ └── dimpychhabra
│ │ └── capo
│ │ └── ExampleInstrumentedTest.java
├── proguard-rules.pro
└── build.gradle
├── settings.gradle
├── .idea
├── copyright
│ └── profiles_settings.xml
├── encodings.xml
├── vcs.xml
├── modules.xml
├── runConfigurations.xml
├── compiler.xml
├── gradle.xml
└── misc.xml
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── .gitignore
├── README.md
├── gradle.properties
├── gradlew.bat
└── gradlew
/php_files/sample:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/php_files/pic_01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dimpy-chhabra/Capo/HEAD/php_files/pic_01.png
--------------------------------------------------------------------------------
/php_files/pic_02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dimpy-chhabra/Capo/HEAD/php_files/pic_02.png
--------------------------------------------------------------------------------
/php_files/pic_03.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dimpy-chhabra/Capo/HEAD/php_files/pic_03.png
--------------------------------------------------------------------------------
/php_files/pic_04.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dimpy-chhabra/Capo/HEAD/php_files/pic_04.png
--------------------------------------------------------------------------------
/php_files/pic_05.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dimpy-chhabra/Capo/HEAD/php_files/pic_05.png
--------------------------------------------------------------------------------
/php_files/pic_06.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dimpy-chhabra/Capo/HEAD/php_files/pic_06.png
--------------------------------------------------------------------------------
/php_files/pic_07.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dimpy-chhabra/Capo/HEAD/php_files/pic_07.png
--------------------------------------------------------------------------------
/php_files/pic_08.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dimpy-chhabra/Capo/HEAD/php_files/pic_08.png
--------------------------------------------------------------------------------
/php_files/pic_09.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dimpy-chhabra/Capo/HEAD/php_files/pic_09.png
--------------------------------------------------------------------------------
/php_files/pic_10.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dimpy-chhabra/Capo/HEAD/php_files/pic_10.png
--------------------------------------------------------------------------------
/php_files/pic_11.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dimpy-chhabra/Capo/HEAD/php_files/pic_11.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dimpy-chhabra/Capo/HEAD/app/src/main/res/drawable/bg.PNG
--------------------------------------------------------------------------------
/.idea/copyright/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ba.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dimpy-chhabra/Capo/HEAD/app/src/main/res/drawable/ba.jpeg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/fpp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dimpy-chhabra/Capo/HEAD/app/src/main/res/drawable/fpp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/home.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dimpy-chhabra/Capo/HEAD/app/src/main/res/drawable/home.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/mpp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dimpy-chhabra/Capo/HEAD/app/src/main/res/drawable/mpp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/pic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dimpy-chhabra/Capo/HEAD/app/src/main/res/drawable/pic.png
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dimpy-chhabra/Capo/HEAD/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/app/src/main/res/drawable/capopic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dimpy-chhabra/Capo/HEAD/app/src/main/res/drawable/capopic.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/getcapo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dimpy-chhabra/Capo/HEAD/app/src/main/res/drawable/getcapo.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/logout.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dimpy-chhabra/Capo/HEAD/app/src/main/res/drawable/logout.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/track.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dimpy-chhabra/Capo/HEAD/app/src/main/res/drawable/track.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/letscapo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dimpy-chhabra/Capo/HEAD/app/src/main/res/drawable/letscapo.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/myprofile.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dimpy-chhabra/Capo/HEAD/app/src/main/res/drawable/myprofile.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/backgrounds.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dimpy-chhabra/Capo/HEAD/app/src/main/res/drawable/backgrounds.jpg
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dimpy-chhabra/Capo/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dimpy-chhabra/Capo/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dimpy-chhabra/Capo/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dimpy-chhabra/Capo/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dimpy-chhabra/Capo/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dimpy-chhabra/Capo/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dimpy-chhabra/Capo/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dimpy-chhabra/Capo/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dimpy-chhabra/Capo/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dimpy-chhabra/Capo/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/workspace.xml
5 | /.idea/libraries
6 | .DS_Store
7 | /build
8 | /captures
9 | .externalNativeBuild
10 |
--------------------------------------------------------------------------------
/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Sun Mar 19 18:45:57 IST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/price.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/main.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v21/ic_menu_send.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/get_capo.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/track.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/text_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/lets_capo.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/my_profile.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 | 16dp
6 | 160dp
7 | 16dp
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ripple_effect.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 | -
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/cycle.xml:
--------------------------------------------------------------------------------
1 |
13 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Capo
2 | Capo is a car pool app (Under construction)
3 |
4 | So far it uses shared preferences to maintain a session.
5 |
6 | Intended to incorporate the following features:
7 | 1. work via Volley framework to fetch 'ride' details online.
8 | 2. Be able to track user's locations and present them on the map dynamically!
9 | 3. Also, send the riders and driver emails/sms for confirmations of their bookings!
10 | 4. Only when the driver approves of passenger can the fellow rider ride with them
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/item_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v21/ic_menu_slideshow.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/side_nav_bar.xml:
--------------------------------------------------------------------------------
1 |
3 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v21/ic_menu_gallery.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v21/ic_menu_manage.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
--------------------------------------------------------------------------------
/app/src/test/java/com/example/dimpychhabra/capo/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.example.dimpychhabra.capo;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/app/src/main/res/anim/shake.xml:
--------------------------------------------------------------------------------
1 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/image_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
8 |
9 |
12 |
17 |
--------------------------------------------------------------------------------
/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_my_found_ride_.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/right_out.xml:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/app/src/main/res/values/drawables.xml:
--------------------------------------------------------------------------------
1 |
2 | - @android:drawable/ic_menu_camera
3 | - @android:drawable/ic_menu_gallery
4 | - @android:drawable/ic_menu_slideshow
5 | - @android:drawable/ic_menu_manage
6 | - @android:drawable/ic_menu_share
7 | - @android:drawable/ic_menu_send
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/left_out.xml:
--------------------------------------------------------------------------------
1 |
13 |
15 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v21/ic_menu_camera.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/loginbutton_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | -
6 |
7 |
8 |
9 |
10 |
11 |
12 | -
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/left_enter.xml:
--------------------------------------------------------------------------------
1 |
13 |
15 |
16 |
22 |
23 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/right_enter.xml:
--------------------------------------------------------------------------------
1 |
13 |
14 |
16 |
20 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/test.xml:
--------------------------------------------------------------------------------
1 |
13 |
14 |
16 |
22 |
--------------------------------------------------------------------------------
/php_files/forgotPass.php:
--------------------------------------------------------------------------------
1 | connect_error) {
12 | die("Connection failed: " . $conn->connect_error);
13 | }
14 | $mob = $_POST['mob'];
15 | //$mob = "8586847364";
16 |
17 | $sql = "SELECT u_pass FROM user_details WHERE u_id = '$mob' ";
18 |
19 | $result = $conn->query($sql);
20 | if ($result->num_rows > 0) {
21 | while($row = $result->fetch_assoc()) {
22 | echo $row["u_pass"];
23 | }
24 | }else{
25 | echo "Err";
26 | }
27 |
28 |
29 | $conn->close();
30 | ?>
31 |
--------------------------------------------------------------------------------
/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v21/ic_menu_share.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_first.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | org.gradle.jvmargs=-Xmx1536m
13 |
14 | # When configured, Gradle will run in incubating parallel mode.
15 | # This option should only be used with decoupled projects. More details, visit
16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
17 | # org.gradle.parallel=true
18 |
--------------------------------------------------------------------------------
/php_files/proposeRide.php:
--------------------------------------------------------------------------------
1 |
27 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/custom_toast.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
20 |
21 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/content_get_capo.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
15 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/content_lets_capo.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
14 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/php_files/pickUpPoints.php:
--------------------------------------------------------------------------------
1 | connect_error) {
12 | die("Connection failed: " . $conn->connect_error);
13 | }
14 | $rideID= $_POST['rid'];
15 |
16 | $sql = "SELECT pick_point, pick_point_time, pick_price, _pp_id FROM ride_pick_points WHERE r_id = '".$rideID."' ";
17 | $result = $conn->query($sql);
18 | if ($result->num_rows > 0) {
19 |
20 | while($row[] = $result->fetch_assoc()) {
21 |
22 | $json = json_encode($row);
23 | }
24 | }else{
25 | echo "OfferedRides: ".$result->num_rows;
26 | }
27 | echo $json;
28 |
29 | $conn->close();
30 | ?>
--------------------------------------------------------------------------------
/app/src/release/res/values/google_maps_api.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
20 | YOUR_KEY_HERE
21 |
22 |
23 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/example/dimpychhabra/capo/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.example.dimpychhabra.capo;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumentation test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.example.dimpychhabra.capo", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/php_files/login.php:
--------------------------------------------------------------------------------
1 | connect_error) {
12 | die("Connection failed: " . $conn->connect_error);
13 | }
14 | $mob_no = $_POST['mob_no'];
15 | $password = $_POST['password'];
16 |
17 | $sql = "SELECT u_name, u_college, u_email, u_sex, u_enroll , u_id, u_enroll, u_fb FROM user_details WHERE u_id = '$mob_no' AND u_pass = '$password'";
18 | $result = $conn->query($sql);
19 |
20 | if ($result->num_rows > 0) {
21 | // output data of each row
22 | while($row = $result->fetch_assoc()) {
23 | echo " ". $row["u_name"]. " > " . $row["u_id"]. " > " . $row["u_college"]. " > " . $row["u_email"]. " > " . $row["u_sex"]. " > " . $row["u_enroll"]. " > " . $row["u_fb"]. "
";
24 | }
25 | } else {
26 | echo "NO_PROF" ;
27 | }
28 | $conn->close();
29 | ?>
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_get_capo__frag2.xml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
17 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in C:\Users\Dimpy Chhabra\AppData\Local\Android\Sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
19 | # Uncomment this to preserve the line number information for
20 | # debugging stack traces.
21 | #-keepattributes SourceFile,LineNumberTable
22 |
23 | # If you keep the line number information, uncomment this to
24 | # hide the original source file name.
25 | #-renamesourcefileattribute SourceFile
26 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFC107
4 | #FFA000
5 | #607D8B
6 | #616161
7 | #ffffff
8 | #71ffa000
9 | #FFECB3
10 | #212121
11 | #212121
12 | #757575
13 | #BDBDBD
14 | #17170447
15 | #66000000
16 | #009688
17 | #FFFFFF
18 | #000000
19 | #EEEEEE
20 | #9E9E9E
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/content_track.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
10 |
11 |
18 |
19 |
20 |
27 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_get_capo.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
15 |
16 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
16 |
17 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_track.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
16 |
17 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_lets_capo.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
15 |
16 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_my_profile.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
16 |
17 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dimpychhabra/capo/SimpleFragmentPagerAdapter.java:
--------------------------------------------------------------------------------
1 | package com.example.dimpychhabra.capo;
2 |
3 | import android.support.v4.app.Fragment;
4 | import android.support.v4.app.FragmentManager;
5 | /*
6 | *Project : CAPO, fully created by
7 | * Dimpy Chhabra, IGDTUW, BTech, IT
8 | * Second year (as of 2017)
9 | * Expected Class of 2019
10 | * Please do not circulate as your own
11 | * Criticism is appreciated to work on memory leaks and bugs
12 | * Contact Info : Find me on Linked in : linkedin.com/in/dimpy-chhabra
13 | *
14 | */
15 | import android.support.v4.app.FragmentPagerAdapter;
16 |
17 | /**
18 | * Created by Dimpy Chhabra on 3/26/2017.
19 | */
20 |
21 | public class SimpleFragmentPagerAdapter extends FragmentPagerAdapter {
22 |
23 | public SimpleFragmentPagerAdapter(FragmentManager fm) {
24 | super(fm);
25 | }
26 | @Override
27 | public Fragment getItem(int position) {
28 | if (position == 0) {
29 | return new Main_found_Frag();
30 | } else
31 | return new Main_offered_Frag();
32 | }
33 |
34 | @Override
35 | public int getCount() {
36 | return 2;
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/php_files/proposalsList.php:
--------------------------------------------------------------------------------
1 | connect_error) {
12 | die("Connection failed: " . $conn->connect_error);
13 | }
14 | $driverID = $_POST['driverID'];
15 | $ppID = $_POST['ppID'];
16 |
17 |
18 | $sql = "SELECT ride_pick_points. * , ride_info_offered. * , rides_proposals. * , user_details. * FROM ride_info_offered INNER JOIN ride_pick_points ON ride_info_offered.r_id = ride_pick_points.r_id LEFT JOIN rides_proposals ON rides_proposals._pp_id = ride_pick_points._pp_id AND ride_info_offered.dri_u_id = '$driverID' INNER JOIN user_details ON user_details.u_id = rides_proposals.rider_id WHERE ride_pick_points._pp_id = '$ppID' ";
19 |
20 |
21 | $result = $conn->query($sql);
22 | if ($result->num_rows > 0) {
23 |
24 | while($row[] = $result->fetch_assoc()) {
25 | $json = json_encode($row);
26 | }
27 | }else{
28 | echo "";
29 | }
30 | echo $json;
31 |
32 | $conn->close();
33 | ?>
34 |
--------------------------------------------------------------------------------
/php_files/foundRidesList.php:
--------------------------------------------------------------------------------
1 | connect_error) {
12 | die("Connection failed: " . $conn->connect_error);
13 | }
14 | $college = $_POST['college'];
15 | $rider = $_POST['rider'];
16 | //$college="IGDTU";
17 |
18 | //works in GET CAPO
19 |
20 | $sql = "SELECT ride_pick_points. * , ride_info_offered. * ,
21 | status FROM ride_info_offered
22 | INNER JOIN ride_pick_points ON ride_info_offered.r_id = ride_pick_points.r_id
23 | LEFT JOIN rides_proposals ON rides_proposals._pp_id = ride_pick_points._pp_id
24 | AND rides_proposals.rider_id = '$rider'
25 | WHERE ride_info_offered.to_college = '$college' ";
26 |
27 |
28 |
29 | $result = $conn->query($sql);
30 | if ($result->num_rows > 0) {
31 | while($row[] = $result->fetch_assoc()) {
32 | $json = json_encode($row);
33 | }
34 | }else{
35 | //echo "FoundRides: ".$result->num_rows;
36 | }
37 | echo $json;
38 |
39 | $conn->close();
40 | ?>
41 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/content_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
17 |
18 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_login_base.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
24 |
25 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/php_files/updateStatus.php:
--------------------------------------------------------------------------------
1 | connect_error) {
11 | die("Connection failed: " . $connection->connect_error);
12 | }
13 |
14 | $ride_id = $_POST["ride_id"];
15 | $pro_id = $_POST["pro_id"];
16 | $rider_id = $_POST["rider_id"];
17 | $statis = $_POST["stat"];
18 |
19 | //$ride_id = "1";
20 | //$pro_id = "2";
21 | //$rider_id = "9999999999";
22 | //$statis = "-1";
23 |
24 |
25 | $queryInsert = "UPDATE rides_proposals SET status = '$statis' WHERE r_id='$ride_id' AND rider_id='$rider_id' AND _pp_id='$pro_id' ";
26 | mysqli_query($connection,$queryInsert) or
27 | die("0");
28 | echo "We Capo-ed!" ;
29 |
30 | if($statis == '2'){
31 | $sql = "UPDATE ride_info_offered SET num_seats=num_seats-1 WHERE r_id='$ride_id'";
32 | mysqli_query($connection,$sql) or
33 | die("0");
34 | echo "We Capo-ed!" ;
35 | }
36 | if($statis == '-1'){
37 | $sql = "UPDATE ride_info_offered SET num_seats=num_seats+1 WHERE r_id='$ride_id'";
38 | mysqli_query($connection,$sql) or
39 | die("0");
40 | echo "We Capo-ed!" ;
41 | }
42 |
43 | ?>
44 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
15 |
16 |
17 |
18 |
19 |
20 |
27 |
28 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/activity_main_drawer.xml:
--------------------------------------------------------------------------------
1 |
2 |
41 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/app_bar_track.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
20 |
21 |
22 |
23 |
24 |
25 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/app_bar_get_capo.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
20 |
21 |
22 |
23 |
24 |
25 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/app_bar_lets_capo.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
20 |
21 |
22 |
23 |
24 |
25 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/app_bar_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
21 |
22 |
23 |
24 |
25 |
26 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/app_bar_my_profile.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
20 |
21 |
22 |
23 |
24 |
25 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/php_files/offeredRidesList.php:
--------------------------------------------------------------------------------
1 | connect_error) {
12 | die("Connection failed: " . $conn->connect_error);
13 | }
14 | $mob_no = $_POST['mob_no'];
15 | //$mob_no = " 999999999";
16 |
17 | //$sql = "SELECT ride_pick_points. * , ride_info_offered. * ,
18 | //status, rider_id FROM ride_info_offered
19 | //INNER JOIN ride_pick_points ON ride_info_offered.r_id = ride_pick_points.r_id
20 | //INNER JOIN rides_proposals ON rides_proposals.r_id = ride_info_offered.r_id
21 | //WHERE ride_info_offered.dri_u_id = '$mob_no' ";
22 |
23 | $sql = "SELECT DISTINCT ride_pick_points. * , ride_info_offered. * ,
24 | status FROM ride_info_offered
25 | INNER JOIN ride_pick_points ON ride_info_offered.r_id = ride_pick_points.r_id
26 | LEFT JOIN rides_proposals ON rides_proposals._pp_id = ride_pick_points._pp_id
27 | AND ride_info_offered.dri_u_id = '$mob_no' ";
28 |
29 | //$sql = "SELECT * FROM ride_info_offered WHERE dri_u_id = '$mob_no' ";
30 |
31 | $result = $conn->query($sql);
32 | if ($result->num_rows > 0) {
33 |
34 | while($row[] = $result->fetch_assoc()) {
35 |
36 | $json = json_encode($row);
37 | }
38 | }else{
39 | //echo "OfferedRides: ".$result->num_rows;
40 | }
41 | echo $json;
42 |
43 | $conn->close();
44 | ?>
45 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 | /*
3 | *Project : CAPO, fully created by
4 | * Dimpy Chhabra, IGDTUW, BTech, IT
5 | * Second year (as of 2017)
6 | * Expected Class of 2019
7 | * Please do not circulate as your own
8 | * Criticism is appreciated to work on memory leaks and bugs
9 | * Contact Info : Find me on Linked in : linkedin.com/in/dimpy-chhabra
10 | *
11 | */
12 | android {
13 | compileSdkVersion 25
14 | buildToolsVersion "25.0.2"
15 | defaultConfig {
16 | applicationId "com.example.dimpychhabra.capo"
17 | minSdkVersion 19
18 | targetSdkVersion 25
19 | versionCode 1
20 | versionName "1.0"
21 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
22 | }
23 | buildTypes {
24 | release {
25 | minifyEnabled false
26 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
27 | }
28 | }
29 | }
30 |
31 | dependencies {
32 | compile fileTree(dir: 'libs', include: ['*.jar'])
33 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
34 | exclude group: 'com.android.support', module: 'support-annotations'
35 | })
36 | compile 'com.android.support:appcompat-v7:25.1.0'
37 | compile 'com.android.support:design:25.1.0'
38 | compile 'com.android.support.constraint:constraint-layout:1.0.2'
39 | compile 'com.android.support:support-v4:25.1.0'
40 | compile 'com.android.volley:volley:1.0.0'
41 | testCompile 'junit:junit:4.12'
42 | }
43 |
--------------------------------------------------------------------------------
/php_files/register.php:
--------------------------------------------------------------------------------
1 |
43 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_main_found_.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
18 |
19 |
30 |
31 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_main_offered_.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
18 |
19 |
30 |
31 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_get_capo__frag1.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
20 |
21 |
30 |
31 |
40 |
49 |
50 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_lets_capo__frag2.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
20 |
21 |
30 |
31 |
40 |
49 |
50 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/nav_header_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
15 |
16 |
23 |
24 |
33 |
34 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dimpychhabra/capo/CustomToast.java:
--------------------------------------------------------------------------------
1 | package com.example.dimpychhabra.capo;
2 |
3 | /**
4 | * Created by Dimpy Chhabra on 3/20/2017.
5 | */
6 |
7 | import android.content.Context;
8 | import android.view.Gravity;
9 | import android.view.LayoutInflater;
10 | import android.view.View;
11 | /*
12 | *Project : CAPO, fully created by
13 | * Dimpy Chhabra, IGDTUW, BTech, IT
14 | * Second year (as of 2017)
15 | * Expected Class of 2019
16 | * Please do not circulate as your own
17 | * Criticism is appreciated to work on memory leaks and bugs
18 | * Contact Info : Find me on Linked in : linkedin.com/in/dimpy-chhabra
19 | *
20 | */
21 | import android.view.ViewGroup;
22 | import android.widget.TextView;
23 | import android.widget.Toast;
24 |
25 |
26 | /**
27 | * Created by Dimpy Chhabra on 3/20/2017.
28 | */
29 |
30 | public class CustomToast {
31 |
32 | // Custom Toast Method
33 | public void Show_Toast(Context context, View view, String error) {
34 |
35 | // Layout Inflater for inflating custom view
36 | LayoutInflater inflater = (LayoutInflater) context
37 | .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
38 |
39 | // inflate the layout over view
40 | View layout = inflater.inflate(R.layout.custom_toast,
41 | (ViewGroup) view.findViewById(R.id.toast_root));
42 |
43 | // Get TextView id and set error
44 | TextView text = (TextView) layout.findViewById(R.id.toast_error);
45 | text.setText(error);
46 |
47 | Toast toast = new Toast(context);// Get Toast Context
48 | toast.setGravity(Gravity.TOP | Gravity.FILL_HORIZONTAL, 0, 0);// Set
49 | // Toast
50 | // gravity
51 | // and
52 | // Fill
53 | // Horizoontal
54 |
55 | toast.setDuration(Toast.LENGTH_SHORT);// Set Duration
56 | toast.setView(layout); // Set Custom View over toast
57 |
58 | toast.show();// Finally show toast
59 | }
60 |
61 | }
62 |
--------------------------------------------------------------------------------
/php_files/test.php:
--------------------------------------------------------------------------------
1 | connect_error) {
12 | die("Connection failed: " . $conn->connect_error);
13 | }
14 | //$college ="8586847364";
15 | $college =$_POST['user'];
16 |
17 | //$sql = "SELECT ride_pick_points . * , ride_info_offered . * ,
18 | //status FROM ride_info_offered
19 | //INNER JOIN ride_pick_points ON ride_info_offered.r_id = ride_pick_points.r_id
20 | //INNER JOIN rides_proposals ON rides_proposals.r_id = ride_info_offered.r_id
21 | //WHERE rides_proposals.rider_id = '$college' AND rides_proposals.status = '1'";
22 |
23 | $sql = "SELECT ride_pick_points . * , ride_info_offered . * ,
24 | status FROM ride_info_offered
25 | INNER JOIN rides_proposals ON rides_proposals.r_id = ride_info_offered.r_id
26 | INNER JOIN ride_pick_points ON rides_proposals._pp_id = ride_pick_points._pp_id
27 | WHERE rides_proposals.rider_id = '$college' AND (rides_proposals.status = '1' OR rides_proposals.status = '2' OR rides_proposals.status = '-1')";
28 |
29 |
30 |
31 | //$sql = "SELECT ride_pick_points.pick_point, ride_pick_points.pick_point_time, ride_pick_points.pick_price, ride_info_offered.r_date, ride_info_offered.from_loc, ride_info_offered.to_college, ride_info_offered.from_time, ride_info_offered.reach_time, ride_info_offered.num_seats, rides_proposals.status FROM ride_info_offered INNER JOIN rides_proposals ON rides_proposals.r_id=ride_info_offered.r_id LEFT JOIN ride_pick_points ON ride_pick_points._pp_id = rides_proposals._pp_id WHERE rides_proposals.rider_id = `$u_id`";
32 |
33 |
34 |
35 | $result = $conn->query($sql);
36 | if ($result->num_rows > 0) {
37 | while($row[] = $result->fetch_assoc()) {
38 | $json = json_encode($row);
39 | }
40 | }else{
41 | //echo "FoundRides: ".$result->num_rows;
42 | }
43 | echo $json;
44 |
45 | $conn->close();
46 | ?>
47 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dimpychhabra/capo/RideAdapter.java:
--------------------------------------------------------------------------------
1 | package com.example.dimpychhabra.capo;
2 |
3 | import android.content.Context;
4 | import android.support.annotation.NonNull;
5 | import android.support.v4.content.ContextCompat;
6 | import android.view.LayoutInflater;
7 | import android.view.View;
8 | /*
9 | *Project : CAPO, fully created by
10 | * Dimpy Chhabra, IGDTUW, BTech, IT
11 | * Second year (as of 2017)
12 | * Expected Class of 2019
13 | * Please do not circulate as your own
14 | * Criticism is appreciated to work on memory leaks and bugs
15 | * Contact Info : Find me on Linked in : linkedin.com/in/dimpy-chhabra
16 | *
17 | */
18 | import android.view.ViewGroup;
19 | import android.widget.ArrayAdapter;
20 | import android.widget.ImageView;
21 | import android.widget.TextClock;
22 | import android.widget.TextView;
23 |
24 | import org.w3c.dom.Text;
25 |
26 | import java.util.ArrayList;
27 |
28 | /**
29 | * Created by Dimpy Chhabra on 3/26/2017.
30 | */
31 |
32 | public class RideAdapter extends ArrayAdapter {
33 |
34 | public RideAdapter(Context context, ArrayList ridesArrayList){
35 | super(context, 0, ridesArrayList);
36 |
37 | }
38 |
39 | @NonNull
40 | @Override
41 | public View getView(int position, View convertView, ViewGroup parent) {
42 | View listItemView = convertView;
43 | //getting the view into a variable listItemView
44 | if(listItemView == null){
45 | listItemView = LayoutInflater.from(getContext())
46 | .inflate(R.layout.ride_item_found, parent, false);
47 | }
48 | //This is to ensure the reusablity of a view
49 |
50 | Ride currentRide = getItem(position);
51 |
52 | TextView fromTo = (TextView) listItemView.findViewById(R.id.textViewDirections);
53 | fromTo.setText(currentRide.getPp() + " TO " + currentRide.getDesti_loc());
54 |
55 | TextView price = (TextView) listItemView.findViewById(R.id.textClock);
56 | price.setText("PickUpTime@ " + (currentRide.getPp_time()));
57 |
58 | TextView pricetag = (TextView) listItemView.findViewById(R.id.pricetag);
59 | pricetag.setText("Rs. " + currentRide.getPp_price());
60 |
61 | return listItemView;
62 | }
63 | }
64 |
65 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dimpychhabra/capo/RequestCapoAdapter.java:
--------------------------------------------------------------------------------
1 | package com.example.dimpychhabra.capo;
2 |
3 | import android.content.Context;
4 | import android.support.annotation.NonNull;
5 | import android.support.v4.content.ContextCompat;
6 | import android.view.LayoutInflater;
7 | import android.view.View;
8 | /*
9 | *Project : CAPO, fully created by
10 | * Dimpy Chhabra, IGDTUW, BTech, IT
11 | * Second year (as of 2017)
12 | * Expected Class of 2019
13 | * Please do not circulate as your own
14 | * Criticism is appreciated to work on memory leaks and bugs
15 | * Contact Info : Find me on Linked in : linkedin.com/in/dimpy-chhabra
16 | *
17 | */
18 | import android.view.ViewGroup;
19 | import android.widget.ArrayAdapter;
20 | import android.widget.ImageView;
21 | import android.widget.TextClock;
22 | import android.widget.TextView;
23 |
24 | import org.w3c.dom.Text;
25 |
26 | import java.util.ArrayList;
27 |
28 | /**
29 | * Created by Dimpy Chhabra on 3/26/2017.
30 | */
31 |
32 | public class RequestCapoAdapter extends ArrayAdapter {
33 |
34 | public RequestCapoAdapter(Context context, ArrayList ridesArrayList){
35 | super(context, 0, ridesArrayList);
36 |
37 | }
38 |
39 | @NonNull
40 | @Override
41 | public View getView(int position, View convertView, ViewGroup parent) {
42 | View listItemView = convertView;
43 | //getting the view into a variable listItemView
44 | if(listItemView == null){
45 | listItemView = LayoutInflater.from(getContext())
46 | .inflate(R.layout.ride_item_found, parent, false);
47 | }
48 | //This is to ensure the reusablity of a view
49 |
50 | Ride currentRide = getItem(position);
51 |
52 | TextView fromTo = (TextView) listItemView.findViewById(R.id.textViewDirections);
53 | fromTo.setText("pickuppoint ID: "+currentRide.getPp_id());
54 |
55 | TextView price = (TextView) listItemView.findViewById(R.id.textClock);
56 | price.setText("RideId@ " + (currentRide.getR_id()));
57 |
58 | TextView pricetag = (TextView) listItemView.findViewById(R.id.pricetag);
59 | pricetag.setText("RiderId: " + currentRide.getRider_id());
60 |
61 | return listItemView;
62 | }
63 | }
64 |
65 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/ride_item_found.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
12 |
18 |
19 |
20 |
31 |
32 |
42 |
43 |
44 |
45 |
52 |
53 |
59 |
60 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dimpychhabra/capo/FirstActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.dimpychhabra.capo;
2 |
3 |
4 | import android.content.Context;
5 | import android.content.Intent;
6 | import android.content.SharedPreferences;
7 | /*
8 | *Project : CAPO, fully created by
9 | * Dimpy Chhabra, IGDTUW, BTech, IT
10 | * Second year (as of 2017)
11 | * Expected Class of 2019
12 | * Please do not circulate as your own
13 | * Criticism is appreciated to work on memory leaks and bugs
14 | * Contact Info : Find me on Linked in : linkedin.com/in/dimpy-chhabra
15 | *
16 | */
17 | import android.support.v7.app.AppCompatActivity;
18 | import android.os.Bundle;
19 | import android.util.Log;
20 | import android.view.View;
21 | import android.widget.ImageButton;
22 | import android.widget.Toast;
23 |
24 | /**
25 | * An example full-screen activity that shows and hides the system UI (i.e.
26 | * status bar and navigation/system bar) with user interaction.
27 | */
28 | public class FirstActivity extends AppCompatActivity {
29 | ImageButton ib1;
30 |
31 | @Override
32 | protected void onCreate(Bundle savedInstanceState) {
33 | super.onCreate(savedInstanceState);
34 | setContentView(R.layout.activity_first);
35 | ib1=(ImageButton)findViewById(R.id.dummy_button);
36 | SharedPreferences spref = getSharedPreferences(BaseActivity.MyPref, Context.MODE_PRIVATE);
37 | final String a = spref.getString(BaseActivity.Name, null); // getting String
38 | final String b = spref.getString(BaseActivity.Phone, null);
39 | final String c = spref.getString(BaseActivity.IS_LOGIN, "false");
40 |
41 |
42 | ib1.setOnClickListener(new View.OnClickListener() {
43 | @Override
44 | public void onClick(View v) {
45 |
46 |
47 | Log.e("in FullScreen Activity ","name : "+a+" phone : "+b+" isloggedin? : "+c);
48 | if(c.equals("true")){
49 | Toast.makeText(FirstActivity.this, "Welcome Fellow User", Toast.LENGTH_SHORT).show();
50 | Log.e("in Activity in if","name : "+a+" phone : "+b+" isloggedin? : "+c);
51 | Intent i = new Intent(FirstActivity.this, MainActivity.class);
52 | startActivity(i);
53 | finish();
54 | }else {
55 | Toast.makeText(FirstActivity.this, "Start Saving money with Capo TODAY!", Toast.LENGTH_SHORT).show();
56 | Intent i = new Intent(FirstActivity.this, LoginBaseActivity.class);
57 | startActivity(i);
58 | finish();
59 | }
60 |
61 | }
62 | });
63 | }
64 | }
65 |
66 |
67 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dimpychhabra/capo/RidesFoundAdapter.java:
--------------------------------------------------------------------------------
1 | package com.example.dimpychhabra.capo;
2 |
3 | import android.content.Context;
4 | import android.support.annotation.NonNull;
5 | import android.support.v4.content.ContextCompat;
6 | import android.view.LayoutInflater;
7 | import android.view.View;
8 | /*
9 | *Project : CAPO, fully created by
10 | * Dimpy Chhabra, IGDTUW, BTech, IT
11 | * Second year (as of 2017)
12 | * Expected Class of 2019
13 | * Please do not circulate as your own
14 | * Criticism is appreciated to work on memory leaks and bugs
15 | * Contact Info : Find me on Linked in : linkedin.com/in/dimpy-chhabra
16 | *
17 | */
18 | import android.view.ViewGroup;
19 | import android.widget.ArrayAdapter;
20 | import android.widget.ImageView;
21 | import android.widget.TextClock;
22 | import android.widget.TextView;
23 |
24 | import org.w3c.dom.Text;
25 |
26 | import java.util.ArrayList;
27 |
28 | /**
29 | * Created by Dimpy Chhabra on 3/26/2017.
30 | */
31 |
32 | public class RidesFoundAdapter extends ArrayAdapter{
33 |
34 | public RidesFoundAdapter(Context context, ArrayList ridesArrayList){
35 | super(context, 0, ridesArrayList);
36 |
37 | }
38 |
39 | @NonNull
40 | @Override
41 | public View getView(int position, View convertView, ViewGroup parent) {
42 | View listItemView = convertView;
43 | //getting the view into a variable listItemView
44 | if(listItemView == null){
45 | listItemView = LayoutInflater.from(getContext())
46 | .inflate(R.layout.ride_item, parent, false);
47 | }
48 | //This is to ensure the reusablity of a view
49 |
50 | Ride currentRide = getItem(position);
51 |
52 | TextView fromTo = (TextView) listItemView.findViewById(R.id.textViewDirections);
53 | fromTo.setText(currentRide.getStart_loc() + " TO " + currentRide.getDesti_loc());
54 |
55 | TextView price = (TextView) listItemView.findViewById(R.id.Seats);
56 | price.setText("Seats: " + (currentRide.getNo_seats()) );
57 |
58 | TextView tc = (TextView) listItemView.findViewById(R.id.StartingTime);
59 | tc.setText("at:" + currentRide.getStart_time());
60 |
61 | TextView extras = (TextView) listItemView.findViewById(R.id.Extra);
62 | extras.setText("Date:" + currentRide.getDateORide());
63 |
64 | TextView pricetag = (TextView) listItemView.findViewById(R.id.pricetag);
65 | pricetag.setText("Reach by " + currentRide.getExp_desti_time());
66 |
67 | return listItemView;
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/forgotpassword_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
16 |
17 |
33 |
34 |
38 |
39 |
43 |
44 |
55 |
56 |
67 |
68 |
69 |
--------------------------------------------------------------------------------
/php_files/offerRide.php:
--------------------------------------------------------------------------------
1 | connect_error) {
12 | die("Connection failed: " . $conn->connect_error);
13 | }
14 |
15 | //print((string)$con);
16 | $u_id = $_POST['u_id'];
17 | $From = $_POST['from'];
18 | $Date = $_POST['date'];
19 | $FromTime = $_POST['fromTime'];
20 | $To = $_POST['to'];
21 | $ToTime = $_POST['toTime'];
22 | $Seats = $_POST['seats'];
23 | $Extras = $_POST['extra'];
24 |
25 | $Pp1 = $_POST['Pp1'];
26 | $Pp1Time =$_POST['Pp1Time'];
27 | $Pp1Price =$_POST['Pp1Price'];
28 |
29 | $Pp2 = $_POST['Pp2'];
30 | $Pp2Time = $_POST['Pp2Time'];
31 | $Pp2Price = $_POST['Pp2Price'];
32 |
33 | $Pp3 = $_POST['Pp3'];
34 | $Pp3Time = $_POST['Pp3Time'];
35 | $Pp3Price = $_POST['Pp3Price'];
36 |
37 | $r_id = "9999";
38 |
39 | if(!isset($u_id)){echo 'id is blank.NO INPUT' ; die;}
40 | if(!isset($Seats)){echo 'Seats is blank' ; die;}
41 | if(!isset($From)){echo 'From is blank' ; die;}
42 |
43 | $Sql_Query_1 = "INSERT INTO ride_info_offered(dri_u_id, r_date, from_loc, to_college, from_time, reach_time, num_seats, extras) VALUES ('$u_id' , '$Date' , '$From' , '$To', '$FromTime' , '$ToTime' , '$Seats' , '$Extras' )";
44 |
45 | mysqli_query($conn, $Sql_Query_1) or
46 | die(" Data Not added!") ;
47 | $r_id = mysqli_insert_id($conn);
48 | echo " Ride Id:";
49 | echo $r_id;
50 |
51 | $Sql_Query_2 = "insert into ride_pick_points(r_id, pick_point, pick_point_time, pick_price)values ( '$r_id', '$Pp1', '$Pp1Time', '$Pp1Price')";
52 | mysqli_query($conn, $Sql_Query_2) or
53 | die(" PickUpPoint 1 Not added!") ;
54 | $_pp_id = mysqli_insert_id($conn);
55 | echo " PP1 :";
56 | echo $_pp_id;
57 |
58 | if(isset($Pp2)){
59 | $Sql_Query_3 = "insert into ride_pick_points(r_id, pick_point, pick_point_time, pick_price)values ( '$r_id', '$Pp2', '$Pp2Time', '$Pp2Price')";
60 | mysqli_query($conn, $Sql_Query_3) or
61 | die(" PickUpPoint 2 Not added!") ;
62 | $_pp_id = mysqli_insert_id($conn);
63 | echo " PP2 :";
64 | echo $_pp_id;
65 | }
66 | if(isset($Pp3)){
67 | $Sql_Query_4 = "insert into ride_pick_points(r_id, pick_point, pick_point_time, pick_price)values ( '$r_id', '$Pp3', '$Pp3Time', '$Pp3Price')";
68 | mysqli_query($conn, $Sql_Query_4) or
69 | die(" PickUpPoint 3 Not added!") ;
70 | $_pp_id = mysqli_insert_id($conn);
71 | echo " PP3 :";
72 | echo $_pp_id;
73 | }
74 |
75 | mysqli_close($conn);
76 | ?>
77 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/ride_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
12 |
18 |
19 |
20 |
31 |
32 |
42 |
43 |
44 |
45 |
52 |
53 |
60 |
61 |
68 |
69 |
76 |
77 |
78 |
79 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
31 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
45 |
49 |
53 |
57 |
61 |
62 |
63 |
64 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dimpychhabra/capo/LoginBaseActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.dimpychhabra.capo;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.app.Fragment;
5 | import android.support.v4.app.FragmentManager;
6 | import android.support.v7.app.AppCompatActivity;
7 | import android.view.View;
8 | /*
9 | *Project : CAPO, fully created by
10 | * Dimpy Chhabra, IGDTUW, BTech, IT
11 | * Second year (as of 2017)
12 | * Expected Class of 2019
13 | * Please do not circulate as your own
14 | * Criticism is appreciated to work on memory leaks and bugs
15 | * Contact Info : Find me on Linked in : linkedin.com/in/dimpy-chhabra
16 | *
17 | */
18 | import android.view.View.OnClickListener;
19 |
20 | public class LoginBaseActivity extends AppCompatActivity {
21 | private static FragmentManager fragmentManager;
22 |
23 |
24 | @Override
25 | protected void onCreate(Bundle savedInstanceState) {
26 | super.onCreate(savedInstanceState);
27 | setContentView(R.layout.activity_login_base);
28 | fragmentManager = getSupportFragmentManager();
29 |
30 | // If savedinstnacestate is null then replace login fragment
31 | if (savedInstanceState == null) {
32 | fragmentManager .beginTransaction()
33 | .replace(R.id.frameContainer, new Login_Fragment(), BaseActivity.Login_Fragment)
34 | .commit();
35 | }
36 |
37 | // On close icon click finish activity
38 | findViewById(R.id.close_activity).setOnClickListener(
39 | new OnClickListener() {
40 |
41 | @Override
42 | public void onClick(View arg0) {
43 | finish();
44 |
45 | }
46 | });
47 |
48 | }
49 |
50 | // Replace Login Fragment with animation
51 | protected void replaceLoginFragment() {
52 | fragmentManager
53 | .beginTransaction()
54 | .setCustomAnimations(R.anim.left_enter, R.anim.right_out)
55 | .replace(R.id.frameContainer, new Login_Fragment(),
56 | BaseActivity.Login_Fragment).commit();
57 | }
58 |
59 | @Override
60 | public void onBackPressed() {
61 |
62 | // Find the tag of signup and forgot password fragment
63 | Fragment SignUp_Fragment = fragmentManager
64 | .findFragmentByTag(BaseActivity.SignUp_Fragment);
65 | Fragment ForgotPassword_Fragment = fragmentManager
66 | .findFragmentByTag(BaseActivity.ForgotPassword_Fragment);
67 |
68 | // Check if both are null or not
69 | // If both are not null then replace login fragment else do backpressed
70 | // task
71 |
72 | if (SignUp_Fragment != null)
73 | replaceLoginFragment();
74 | else if (ForgotPassword_Fragment != null)
75 | replaceLoginFragment();
76 | else
77 | super.onBackPressed();
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Capo
3 |
4 | Open navigation drawer
5 | Close navigation drawer
6 |
7 | Settings
8 | MyProfile
9 | LetsCapo
10 | GetCapo
11 |
12 | Share Using
13 | Sign in
14 |
15 |
16 | Email
17 | Password (optional)
18 | Sign in or register
19 | Sign in
20 | This email address is invalid
21 | This password is too short
22 | This password is incorrect
23 | This field is required
24 | "Contacts permissions are needed for providing email
25 | completions."
26 |
27 |
28 | FirstActivity
29 |
30 | FullscreenActivity
31 | Dummy Button
32 | DUMMY\nCONTENT
33 | Hello world!
34 | Email Id
35 | Password
36 | LOGIN
37 | Show Password
38 | Hide Password
39 | Forgot password?
40 | Close Button for Activity
41 | Not a Member yet? Sign Up here.
42 | Full Name
43 | Mobile Number
44 | College
45 | Confirm Password
46 | By clicking SignUp you agree all the Terms and Conditions.
47 | SIGN UP
48 | Already have Account? Login here.
49 | Please enter your Registered Email Id below:
50 | SUBMIT
51 | BACK
52 | MainActivity
53 |
54 |
55 | Hello blank fragment
56 | Track~
57 |
58 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dimpychhabra/capo/getCapo_Frag1.java:
--------------------------------------------------------------------------------
1 | package com.example.dimpychhabra.capo;
2 |
3 | import android.content.Context;
4 | import android.content.Intent;
5 | import android.net.Uri;
6 | import android.os.Bundle;
7 | import android.support.v4.app.Fragment;
8 | import android.support.v4.app.FragmentManager;
9 | import android.util.Log;
10 | /*
11 | *Project : CAPO, fully created by
12 | * Dimpy Chhabra, IGDTUW, BTech, IT
13 | * Second year (as of 2017)
14 | * Expected Class of 2019
15 | * Please do not circulate as your own
16 | * Criticism is appreciated to work on memory leaks and bugs
17 | * Contact Info : Find me on Linked in : linkedin.com/in/dimpy-chhabra
18 | *
19 | */
20 | import android.view.LayoutInflater;
21 | import android.view.View;
22 | import android.view.ViewGroup;
23 | import android.widget.Button;
24 | import android.widget.EditText;
25 |
26 | public class getCapo_Frag1 extends Fragment {
27 |
28 | private static View view;
29 | private static Button button;
30 | private static EditText to, from, fromTime;
31 | private static FragmentManager fragmentManager;
32 |
33 | public getCapo_Frag1() {
34 | // Required empty public constructor
35 | }
36 |
37 | @Override
38 | public void onCreate(Bundle savedInstanceState) {
39 | super.onCreate(savedInstanceState);
40 | }
41 |
42 | @Override
43 | public View onCreateView(LayoutInflater inflater, ViewGroup container,
44 | Bundle savedInstanceState) {
45 | // Inflate the layout for this fragment
46 | view = inflater.inflate(R.layout.fragment_get_capo__frag1, container, false);
47 | initViews();
48 |
49 | button.setOnClickListener(new View.OnClickListener() {
50 | @Override
51 | public void onClick(View v) {
52 |
53 | String To, From, FromTime;
54 | To = to.getText().toString();
55 | From = from.getText().toString();
56 | FromTime = from.getText().toString();
57 |
58 | if (To.equals("") || FromTime.equals("") || From.equals("")) {
59 | Log.e("in lets capo frag1", " equals null");
60 | new CustomToast().Show_Toast(getActivity(), view, "Please enter All details in order to proceed.");
61 | } else {
62 |
63 | fragmentManager
64 | .beginTransaction()
65 | .setCustomAnimations(R.anim.right_enter, R.anim.left_out)
66 | .replace(R.id.frameContainer, new getCapo_Frag2(),
67 | BaseActivity.getCapo_Frag2)
68 |
69 | .commit();
70 | }
71 | }
72 | });
73 |
74 |
75 | return view;
76 | }
77 |
78 | private void initViews() {
79 | fragmentManager = getActivity().getSupportFragmentManager();
80 | button = (Button) view.findViewById(R.id.b1);
81 | to = (EditText) view.findViewById(R.id.to);
82 | from = (EditText) view.findViewById(R.id.from);
83 | fromTime = (EditText) view.findViewById(R.id.fromTime);
84 | }
85 |
86 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dimpychhabra/capo/letsCapo_Frag2.java:
--------------------------------------------------------------------------------
1 | package com.example.dimpychhabra.capo;
2 |
3 | import android.content.Context;
4 | import android.content.Intent;
5 | import android.net.Uri;
6 | import android.os.Bundle;
7 | import android.support.v4.app.Fragment;
8 | import android.support.v4.app.FragmentManager;
9 | import android.util.Log;
10 | /*
11 | *Project : CAPO, fully created by
12 | * Dimpy Chhabra, IGDTUW, BTech, IT
13 | * Second year (as of 2017)
14 | * Expected Class of 2019
15 | * Please do not circulate as your own
16 | * Criticism is appreciated to work on memory leaks and bugs
17 | * Contact Info : Find me on Linked in : linkedin.com/in/dimpy-chhabra
18 | *
19 | */
20 | import android.view.LayoutInflater;
21 | import android.view.View;
22 | import android.view.ViewGroup;
23 | import android.widget.Button;
24 | import android.widget.EditText;
25 |
26 |
27 |
28 | public class letsCapo_Frag2 extends Fragment implements View.OnClickListener{
29 |
30 | private static View view;
31 | private static Button button;
32 | private static EditText to, from, fromTime;
33 | private static FragmentManager fragmentManager;
34 |
35 | public letsCapo_Frag2() {
36 | // Required empty public constructor
37 | }
38 |
39 | @Override
40 | public void onCreate(Bundle savedInstanceState) {
41 | super.onCreate(savedInstanceState);
42 | }
43 |
44 | @Override
45 | public View onCreateView(LayoutInflater inflater, ViewGroup container,
46 | Bundle savedInstanceState) {
47 | view = inflater.inflate(R.layout.fragment_lets_capo__frag2, container, false);
48 | initViews();
49 | setListeners();
50 | return view;
51 | }
52 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////
53 |
54 | private void initViews() {
55 | fragmentManager = getActivity().getSupportFragmentManager();
56 | button = (Button) view.findViewById(R.id.b1);
57 | to = (EditText)view.findViewById(R.id.to);
58 | from = (EditText)view.findViewById(R.id.from);
59 | fromTime = (EditText)view.findViewById(R.id.fromTime);
60 | }
61 |
62 | private void setListeners() {
63 | button.setOnClickListener(this);
64 | }
65 |
66 | @Override
67 | public void onClick(View v) {
68 | switch (v.getId()) {
69 | case R.id.b1:
70 | if(to.getText().toString().equals("") || fromTime.getText().toString().equals("") || from.getText().toString().equals("") )
71 | { Log.e("in lets capo frag1"," equals null");
72 | new CustomToast().Show_Toast(getActivity(), view,"Please enter All details in order to proceed.");}
73 | else {
74 |
75 | new CustomToast().Show_Toast(getActivity(), view, " Awesome! We got your data! Will let you know when we get something!");
76 |
77 | Intent i = new Intent(getActivity(), MainActivity.class);
78 | startActivity(i);
79 |
80 | }break;
81 | case R.id.to:
82 | Log.e("ablah ", " ablhad ");
83 | break;
84 | }
85 | }
86 | }
87 |
88 |
89 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dimpychhabra/capo/getCapo_Frag2.java:
--------------------------------------------------------------------------------
1 | package com.example.dimpychhabra.capo;
2 |
3 | import android.content.Context;
4 | import android.content.Intent;
5 | import android.net.Uri;
6 | import android.os.Bundle;
7 | import android.support.v4.app.Fragment;
8 | import android.support.v4.app.FragmentManager;
9 | import android.util.Log;
10 | /*
11 | *Project : CAPO, fully created by
12 | * Dimpy Chhabra, IGDTUW, BTech, IT
13 | * Second year (as of 2017)
14 | * Expected Class of 2019
15 | * Please do not circulate as your own
16 | * Criticism is appreciated to work on memory leaks and bugs
17 | * Contact Info : Find me on Linked in : linkedin.com/in/dimpy-chhabra
18 | *
19 | */
20 | import android.view.LayoutInflater;
21 | import android.view.View;
22 | import android.view.ViewGroup;
23 | import android.widget.Button;
24 | import android.widget.EditText;
25 | import android.widget.TextView;
26 | import android.widget.Toast;
27 |
28 | import org.w3c.dom.Text;
29 |
30 |
31 | public class getCapo_Frag2 extends Fragment implements View.OnClickListener{
32 | private static View view;
33 | private static TextView tv1;
34 | private static Button b1;
35 | private static FragmentManager fragmentManager;
36 | String data;
37 |
38 | public getCapo_Frag2() {
39 | // Required empty public constructor
40 | }
41 |
42 | @Override
43 | public void onCreate(Bundle savedInstanceState) {
44 | super.onCreate(savedInstanceState);
45 | }
46 |
47 | @Override
48 | public View onCreateView(LayoutInflater inflater, ViewGroup container,
49 | Bundle savedInstanceState) {
50 | // Inflate the layout for this fragment
51 | view = inflater.inflate(R.layout.fragment_get_capo__frag2, container, false);
52 | initViews();
53 | setListeners();
54 |
55 | final Bundle bdl = getArguments();
56 |
57 | String str = "";
58 | try {
59 | str = bdl.getString("rideId");
60 | } catch (final Exception e) {
61 | Log.e("!!!!!!!!!!!!!!!", " errrrr" + str);
62 | }
63 |
64 | //Bundle args = getArguments();
65 | //String value = args.getString("rideId");
66 | Log.e("!!!!!!!!!!!!!!!", "" + str);
67 | Toast.makeText(getActivity().getApplicationContext(), " >>>>>> " + str, Toast.LENGTH_SHORT).show();
68 | return view;
69 | }
70 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////
71 |
72 | private void initViews() {
73 | fragmentManager = getActivity().getSupportFragmentManager();
74 | tv1 = (TextView)view.findViewById(R.id.tv1);
75 | b1 = (Button)view.findViewById(R.id.b1);
76 | }
77 |
78 | private void setListeners() {
79 | b1.setOnClickListener(this);
80 | }
81 |
82 | @Override
83 | public void onClick(View v) {
84 | switch (v.getId()) {
85 | case R.id.b1:
86 | Intent i = new Intent(getActivity(), MainActivity.class);
87 | startActivity(i);
88 | break;
89 | case R.id.tv1:
90 | Log.e("ablah ", " ablhad ");
91 | break;
92 | }
93 | }
94 | }
95 |
96 |
97 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_my_offered_rides_.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
15 |
16 |
25 |
26 |
33 |
34 |
44 |
45 |
52 |
53 |
63 |
64 |
71 |
72 |
82 |
83 |
89 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dimpychhabra/capo/ForgotPassword_Fragment.java:
--------------------------------------------------------------------------------
1 | package com.example.dimpychhabra.capo;
2 |
3 | /**
4 | * Created by Dimpy Chhabra on 3/20/2017.
5 | */
6 | import java.util.regex.Matcher;
7 | import java.util.regex.Pattern;
8 | import android.content.res.ColorStateList;
9 | import android.content.res.XmlResourceParser;
10 | import android.os.Bundle;
11 | /*
12 | *Project : CAPO, fully created by
13 | * Dimpy Chhabra, IGDTUW, BTech, IT
14 | * Second year (as of 2017)
15 | * Expected Class of 2019
16 | * Please do not circulate as your own
17 | * Criticism is appreciated to work on memory leaks and bugs
18 | * Contact Info : Find me on Linked in : linkedin.com/in/dimpy-chhabra
19 | *
20 | */
21 | import android.support.v4.app.Fragment;
22 | import android.view.LayoutInflater;
23 | import android.view.View;
24 | import android.view.View.OnClickListener;
25 | import android.view.ViewGroup;
26 | import android.widget.Button;
27 | import android.widget.EditText;
28 | import android.widget.TextView;
29 | import android.widget.Toast;
30 |
31 | public class ForgotPassword_Fragment extends Fragment implements
32 | OnClickListener {
33 | private static View view;
34 |
35 | private static EditText emailId;
36 | private static TextView submit, back;
37 |
38 | public ForgotPassword_Fragment() {
39 |
40 | }
41 |
42 | @Override
43 | public View onCreateView(LayoutInflater inflater, ViewGroup container,
44 | Bundle savedInstanceState) {
45 | view = inflater.inflate(R.layout.forgotpassword_layout, container,
46 | false);
47 | initViews();
48 | setListeners();
49 | return view;
50 | }
51 |
52 | // Initialize the views
53 | private void initViews() {
54 | emailId = (EditText) view.findViewById(R.id.registered_emailid);
55 | submit = (TextView) view.findViewById(R.id.forgot_button);
56 | back = (TextView) view.findViewById(R.id.backToLoginBtn);
57 |
58 | // Setting text selector over textviews
59 | XmlResourceParser xrp = getResources().getXml(R.drawable.text_selector);
60 | try {
61 | ColorStateList csl = ColorStateList.createFromXml(getResources(),
62 | xrp);
63 |
64 | back.setTextColor(csl);
65 | submit.setTextColor(csl);
66 |
67 | } catch (Exception e) {
68 | }
69 |
70 | }
71 |
72 | // Set Listeners over buttons
73 | private void setListeners() {
74 | back.setOnClickListener(this);
75 | submit.setOnClickListener(this);
76 | }
77 |
78 | @Override
79 | public void onClick(View v) {
80 | switch (v.getId()) {
81 | case R.id.backToLoginBtn:
82 |
83 | // Replace Login Fragment on Back Presses
84 | new LoginBaseActivity().replaceLoginFragment();
85 | break;
86 |
87 | case R.id.forgot_button:
88 |
89 | // Call Submit button task
90 | submitButtonTask();
91 | break;
92 |
93 | }
94 |
95 | }
96 |
97 | private void submitButtonTask() {
98 | String getEmailId = emailId.getText().toString();
99 |
100 | // Pattern for email id validation
101 | Pattern p = Pattern.compile(BaseActivity.regEx);
102 |
103 | // Match the pattern
104 | Matcher m = p.matcher(getEmailId);
105 |
106 | // First check if email id is not null else show error toast
107 | if (getEmailId.equals("") || getEmailId.length() == 0)
108 |
109 | new CustomToast().Show_Toast(getActivity(), view,
110 | "Please enter your Email Id.");
111 |
112 | // Check if email id is valid or not
113 | else if (!m.find())
114 | new CustomToast().Show_Toast(getActivity(), view,
115 | "Your Email Id is Invalid.");
116 |
117 | // Else submit email id and fetch passwod or do your stuff
118 | else
119 | Toast.makeText(getActivity(), "Get Forgot Password.",
120 | Toast.LENGTH_SHORT).show();
121 | }
122 | }
--------------------------------------------------------------------------------
/app/src/main/res/layout/login_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
13 |
14 |
23 |
24 |
40 |
41 |
45 |
46 |
61 |
62 |
68 |
69 |
77 |
78 |
88 |
89 |
90 |
101 |
102 |
103 |
115 |
116 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/content_my_profile.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
10 |
19 |
20 |
21 |
30 |
31 |
44 |
45 |
57 |
58 |
70 |
71 |
83 |
84 |
96 |
97 |
109 |
110 |
111 |
114 |
115 |
116 |
117 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dimpychhabra/capo/Ride.java:
--------------------------------------------------------------------------------
1 | package com.example.dimpychhabra.capo;
2 |
3 | import android.content.Context;
4 | import android.content.SharedPreferences;
5 | import android.preference.PreferenceManager;
6 | /*
7 | *Project : CAPO, fully created by
8 | * Dimpy Chhabra, IGDTUW, BTech, IT
9 | * Second year (as of 2017)
10 | * Expected Class of 2019
11 | * Please do not circulate as your own
12 | * Criticism is appreciated to work on memory leaks and bugs
13 | * Contact Info : Find me on Linked in : linkedin.com/in/dimpy-chhabra
14 | *
15 | */
16 | import java.util.ArrayList;
17 | import java.util.HashMap;
18 |
19 | /**
20 | * Created by Dimpy Chhabra on 3/25/2017.
21 | */
22 |
23 | public class Ride {
24 |
25 | private String r_id;
26 | private String driver_id;
27 | private String start_loc;
28 | private String desti_loc;
29 | private String start_time ;
30 | private String exp_desti_time ;
31 | private String no_seats ;
32 | private String no_seats_occ ;
33 | private String price;
34 | private String extras;
35 | private String dateORide;
36 | private String rider_id;
37 |
38 | private String pp;
39 | private String pp_time;
40 | private String pp_price;
41 | private String pp_id;
42 |
43 | //(pp, pp_time, pp_price, pp_id, college, r_id);
44 | // private Context context;
45 | public Ride(){
46 | }
47 |
48 | public Ride(String PP, String PP_time, String PP_price, String PP_id, String college, String rid) {
49 | pp = PP;
50 | pp_time = PP_time;
51 | pp_price = PP_price;
52 | pp_id = PP_id;
53 | desti_loc = college;
54 | r_id = rid;
55 | }
56 |
57 | //r_id, rider_id, _pp_id, college
58 | public Ride(String R_ID, String RIDER_ID, String PP_ID, String col) {
59 | r_id = R_ID;
60 | rider_id = RIDER_ID;
61 | pp_id = PP_ID;
62 | desti_loc = col;
63 | }
64 |
65 |
66 | // public Ride(String startLoc, String DestiLoc, String seats, String stTime, String DestiTime, String Price) {
67 | // start_loc = startLoc;
68 | // desti_loc = DestiLoc;
69 | // no_seats = seats;
70 | // start_time = stTime;
71 | // exp_desti_time = DestiTime;
72 | // price = Price;
73 | // }
74 |
75 |
76 | public Ride(String startLoc, String DestiLoc, String seats, String stTime, String DestiTime, String DateOride, String R_id) {
77 | start_loc = startLoc;
78 | desti_loc = DestiLoc;
79 | no_seats = seats;
80 | start_time = stTime;
81 | exp_desti_time = DestiTime;
82 | dateORide = DateOride;
83 | r_id = R_id;
84 | }
85 |
86 | public String getR_id( String mobNo){
87 | return r_id;
88 | }
89 |
90 | public String getStart_loc() {
91 | return start_loc;
92 | }
93 |
94 | public String getDesti_loc() {
95 | return desti_loc;
96 | }
97 |
98 | public String getRider_id() {
99 | return rider_id;
100 | }
101 |
102 | public String getStart_time() {
103 | return start_time;
104 | }
105 |
106 | public String getExp_desti_time() {
107 | return exp_desti_time;
108 | }
109 |
110 | public String getNo_seats() {
111 | return no_seats;
112 | }
113 |
114 | public String getNo_seats_occ() {
115 | return no_seats_occ;
116 | }
117 |
118 | public String getExtras() {
119 | return extras;
120 | }
121 |
122 | public String getPrice() {
123 | return price;
124 | }
125 |
126 | public String getR_id() {
127 | return r_id;
128 | }
129 |
130 | public String getDateORide() {
131 | return dateORide;
132 | }
133 |
134 | public String getPp() {
135 | return pp;
136 | }
137 |
138 | public String getPp_time() {
139 | return pp_time;
140 | }
141 |
142 | public String getPp_price() {
143 | return pp_price;
144 | }
145 |
146 | public String getPp_id() {
147 | return pp_id;
148 | }
149 |
150 |
151 | public void putDriver_id( String mobNo){
152 | driver_id = mobNo;
153 | }
154 | public void putR_id( String mobNo, String R_ID){
155 | r_id = R_ID;
156 | }
157 | public void putStart_loc( String mobNo, String Start_LOC){
158 | start_loc = Start_LOC;
159 | }
160 | public void putDesti_loc( String mobNo, String Desti_lo){
161 | desti_loc = Desti_lo;
162 | }
163 | public void putStart_time( String mobNo, String Start_Time){
164 | start_time = Start_Time;
165 | }
166 | public void putExp_desti_time( String mobNo, String Exp_Desti_Time){
167 | exp_desti_time = Exp_Desti_Time;
168 | }
169 | public void putNo_seats( String mobNo, String No_Of_Seats){
170 | no_seats = No_Of_Seats;
171 | }
172 | public void putNo_seats_occ( String mobNo, String No_Seats_OCCUPIED){
173 | no_seats_occ = No_Seats_OCCUPIED;
174 | }
175 | public void putExtras( String mobNo, String Extras){
176 | extras = Extras;
177 | }
178 |
179 |
180 |
181 |
182 |
183 | }
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # Attempt to set APP_HOME
46 | # Resolve links: $0 may be a link
47 | PRG="$0"
48 | # Need this for relative symlinks.
49 | while [ -h "$PRG" ] ; do
50 | ls=`ls -ld "$PRG"`
51 | link=`expr "$ls" : '.*-> \(.*\)$'`
52 | if expr "$link" : '/.*' > /dev/null; then
53 | PRG="$link"
54 | else
55 | PRG=`dirname "$PRG"`"/$link"
56 | fi
57 | done
58 | SAVED="`pwd`"
59 | cd "`dirname \"$PRG\"`/" >/dev/null
60 | APP_HOME="`pwd -P`"
61 | cd "$SAVED" >/dev/null
62 |
63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64 |
65 | # Determine the Java command to use to start the JVM.
66 | if [ -n "$JAVA_HOME" ] ; then
67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68 | # IBM's JDK on AIX uses strange locations for the executables
69 | JAVACMD="$JAVA_HOME/jre/sh/java"
70 | else
71 | JAVACMD="$JAVA_HOME/bin/java"
72 | fi
73 | if [ ! -x "$JAVACMD" ] ; then
74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
75 |
76 | Please set the JAVA_HOME variable in your environment to match the
77 | location of your Java installation."
78 | fi
79 | else
80 | JAVACMD="java"
81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82 |
83 | Please set the JAVA_HOME variable in your environment to match the
84 | location of your Java installation."
85 | fi
86 |
87 | # Increase the maximum file descriptors if we can.
88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89 | MAX_FD_LIMIT=`ulimit -H -n`
90 | if [ $? -eq 0 ] ; then
91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92 | MAX_FD="$MAX_FD_LIMIT"
93 | fi
94 | ulimit -n $MAX_FD
95 | if [ $? -ne 0 ] ; then
96 | warn "Could not set maximum file descriptor limit: $MAX_FD"
97 | fi
98 | else
99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100 | fi
101 | fi
102 |
103 | # For Darwin, add options to specify how the application appears in the dock
104 | if $darwin; then
105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106 | fi
107 |
108 | # For Cygwin, switch paths to Windows format before running java
109 | if $cygwin ; then
110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112 | JAVACMD=`cygpath --unix "$JAVACMD"`
113 |
114 | # We build the pattern for arguments to be converted via cygpath
115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116 | SEP=""
117 | for dir in $ROOTDIRSRAW ; do
118 | ROOTDIRS="$ROOTDIRS$SEP$dir"
119 | SEP="|"
120 | done
121 | OURCYGPATTERN="(^($ROOTDIRS))"
122 | # Add a user-defined pattern to the cygpath arguments
123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125 | fi
126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
127 | i=0
128 | for arg in "$@" ; do
129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131 |
132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134 | else
135 | eval `echo args$i`="\"$arg\""
136 | fi
137 | i=$((i+1))
138 | done
139 | case $i in
140 | (0) set -- ;;
141 | (1) set -- "$args0" ;;
142 | (2) set -- "$args0" "$args1" ;;
143 | (3) set -- "$args0" "$args1" "$args2" ;;
144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150 | esac
151 | fi
152 |
153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154 | function splitJvmOpts() {
155 | JVM_OPTS=("$@")
156 | }
157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
159 |
160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
161 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dimpychhabra/capo/BaseActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.dimpychhabra.capo;
2 |
3 | import android.os.Bundle;
4 | import android.support.design.widget.FloatingActionButton;
5 | import android.support.design.widget.Snackbar;
6 | import android.view.View;
7 | /*
8 | *Project : CAPO, fully created by
9 | * Dimpy Chhabra, IGDTUW, BTech, IT
10 | * Second year (as of 2017)
11 | * Expected Class of 2019
12 | * Please do not circulate as your own
13 | * Criticism is appreciated to work on memory leaks and bugs
14 | * Contact Info : Find me on Linked in : linkedin.com/in/dimpy-chhabra
15 | *
16 | */
17 | import android.support.design.widget.NavigationView;
18 | import android.support.v4.view.GravityCompat;
19 | import android.support.v4.widget.DrawerLayout;
20 | import android.support.v7.app.ActionBarDrawerToggle;
21 | import android.support.v7.app.AppCompatActivity;
22 | import android.support.v7.widget.Toolbar;
23 | import android.view.Menu;
24 | import android.view.MenuItem;
25 |
26 |
27 | public class BaseActivity extends AppCompatActivity
28 | implements NavigationView.OnNavigationItemSelectedListener {
29 |
30 | private String Dets = "F, 19, IGDTU, dimpy@gmail.com, wefwefwwfwff";
31 | public static final String regEx = "\\b[A-Za-z0-9._%+-] + @[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}\\b";
32 |
33 | //Fragments Tags
34 | public static final String Login_Fragment = "Login_Fragment";
35 | public static final String SignUp_Fragment = "SignUp_Fragment";
36 | public static final String ForgotPassword_Fragment = "ForgotPassword_Fragment";
37 | public static final String letsCapo_Frag1 = "letsCapo_Frag1";
38 | public static final String letsCapo_Frag2 = "letsCapo_Frag2";
39 | public static final String getCapo_Frag1 = "getCapo_Frag1";
40 | public static final String getCapo_Frag2 = "getCapo_Frag2";
41 | public static final String offered_rides_Frag = "Main_offered_Frag";
42 | public static final String found_rides_Frag = "Main_found_Frag";
43 | public static final String my_offered_ride_Frag = "My_offered_rides_Frag";
44 | public static final String my_found_ride_Frag = "My_found_ride_Frag";
45 |
46 |
47 | //Shared Pref Column Names
48 | public static final String MyPref = "MPref";
49 | public static final String Name = "nameKey";
50 | public static final String Phone ="phoneKey";
51 | public static final String IS_LOGIN = "is_loged";
52 | public static final String displaypic = "picKey";
53 | public static final String College = "collegeKey";
54 | public static final String Email = "emailKey";
55 | public static final String Enroll = "enrollmentKey";
56 | public static final String fb_link = "fbLinkKey";
57 | public static final String Extras = "extrasKey";
58 |
59 | @Override
60 | protected void onCreate(Bundle savedInstanceState) {
61 | super.onCreate(savedInstanceState);
62 | setContentView(R.layout.activity_main);
63 | Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
64 | setSupportActionBar(toolbar);
65 |
66 | FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
67 | fab.setOnClickListener(new View.OnClickListener() {
68 | @Override
69 | public void onClick(View view) {
70 | Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
71 | .setAction("Action", null).show();
72 | }
73 | });
74 |
75 | DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
76 | ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
77 | this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
78 | drawer.setDrawerListener(toggle);
79 | toggle.syncState();
80 |
81 | NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
82 | navigationView.setNavigationItemSelectedListener(this);
83 | }
84 |
85 | @Override
86 | public void onBackPressed() {
87 | DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
88 | if (drawer.isDrawerOpen(GravityCompat.START)) {
89 | drawer.closeDrawer(GravityCompat.START);
90 | } else {
91 |
92 |
93 | super.onBackPressed();
94 | }
95 | }
96 |
97 | @Override
98 | public boolean onCreateOptionsMenu(Menu menu) {
99 | // Inflate the menu; this adds items to the action bar if it is present.
100 | getMenuInflater().inflate(R.menu.main, menu);
101 | return true;
102 | }
103 |
104 | @Override
105 | public boolean onOptionsItemSelected(MenuItem item) {
106 | // Handle action bar item clicks here. The action bar will
107 | // automatically handle clicks on the Home/Up button, so long
108 | // as you specify a parent activity in AndroidManifest.xml.
109 | int id = item.getItemId();
110 |
111 | //noinspection SimplifiableIfStatement
112 | if (id == R.id.action_settings) {
113 | return true;
114 | }
115 |
116 | return super.onOptionsItemSelected(item);
117 | }
118 |
119 | @SuppressWarnings("StatementWithEmptyBody")
120 | @Override
121 | public boolean onNavigationItemSelected(MenuItem item) {
122 | // Handle navigation view item clicks here.
123 | int id = item.getItemId();
124 |
125 | if (id == R.id.nav_home) {
126 |
127 | } else if (id == R.id.nav_profile) {
128 |
129 | } else if (id == R.id.nav_get_capo) {
130 |
131 | } else if (id == R.id.nav_lets_capo) {
132 |
133 | } else if (id == R.id.nav_track) {
134 |
135 | } else if (id == R.id.nav_share) {
136 |
137 | } else if (id == R.id.nav_logout) {
138 |
139 | }
140 |
141 | DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
142 | drawer.closeDrawer(GravityCompat.START);
143 | return true;
144 | }
145 | }
146 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dimpychhabra/capo/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.dimpychhabra.capo;
2 |
3 | import android.content.Context;
4 | import android.content.Intent;
5 | import android.content.SharedPreferences;
6 | import android.os.Bundle;
7 | import android.support.design.widget.FloatingActionButton;
8 | import android.support.design.widget.Snackbar;
9 | import android.support.v4.view.ViewPager;
10 | /*
11 | *Project : CAPO, fully created by
12 | * Dimpy Chhabra, IGDTUW, BTech, IT
13 | * Second year (as of 2017)
14 | * Expected Class of 2019
15 | * Please do not circulate as your own
16 | * Criticism is appreciated to work on memory leaks and bugs
17 | * Contact Info : Find me on Linked in : linkedin.com/in/dimpy-chhabra
18 | *
19 | */
20 | import android.view.View;
21 | import android.support.design.widget.NavigationView;
22 | import android.support.v4.view.GravityCompat;
23 | import android.support.v4.widget.DrawerLayout;
24 | import android.support.v7.app.ActionBarDrawerToggle;
25 | import android.support.v7.widget.Toolbar;
26 | import android.view.Menu;
27 | import android.view.MenuItem;
28 |
29 | public class MainActivity extends BaseActivity {
30 |
31 | @Override
32 | protected void onCreate(Bundle savedInstanceState) {
33 | super.onCreate(savedInstanceState);
34 | setContentView(R.layout.activity_main);
35 | Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
36 | setSupportActionBar(toolbar);
37 |
38 | FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
39 | fab.setOnClickListener(new View.OnClickListener() {
40 | @Override
41 | public void onClick(View view) {
42 | Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
43 | .setAction("Action", null).show();
44 | }
45 | });
46 |
47 | DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
48 | ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
49 | this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
50 | drawer.setDrawerListener(toggle);
51 | toggle.syncState();
52 |
53 | NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
54 | navigationView.setNavigationItemSelectedListener(this);
55 |
56 |
57 |
58 | }
59 |
60 | @Override
61 | public void onBackPressed() {
62 | DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
63 | if (drawer.isDrawerOpen(GravityCompat.START)) {
64 | drawer.closeDrawer(GravityCompat.START);
65 | } else {
66 |
67 |
68 | super.onBackPressed();
69 | }
70 | }
71 |
72 | @Override
73 | public boolean onCreateOptionsMenu(Menu menu) {
74 | // Inflate the menu; this adds items to the action bar if it is present.
75 | getMenuInflater().inflate(R.menu.main, menu);
76 | return true;
77 | }
78 |
79 | @Override
80 | public boolean onOptionsItemSelected(MenuItem item) {
81 | // Handle action bar item clicks here. The action bar will
82 | // automatically handle clicks on the Home/Up button, so long
83 | // as you specify a parent activity in AndroidManifest.xml.
84 | int id = item.getItemId();
85 |
86 | //noinspection SimplifiableIfStatement
87 | if (id == R.id.action_settings) {
88 | return true;
89 | }
90 |
91 | return super.onOptionsItemSelected(item);
92 | }
93 |
94 | @SuppressWarnings("StatementWithEmptyBody")
95 | @Override
96 | public boolean onNavigationItemSelected(MenuItem item) {
97 | // Handle navigation view item clicks here.
98 | int id = item.getItemId();
99 |
100 | if (id == R.id.nav_home) {
101 |
102 | } else if (id == R.id.nav_profile) {
103 | Intent i = new Intent(MainActivity.this, MyProfile.class);
104 | startActivity(i);
105 | finish();
106 |
107 | } else if (id == R.id.nav_get_capo) {
108 | Intent i = new Intent(MainActivity.this, Track.class);
109 | startActivity(i);
110 | finish();
111 |
112 |
113 | } else if (id == R.id.nav_lets_capo) {
114 | Intent i = new Intent(MainActivity.this, LetsCapo.class);
115 | startActivity(i);
116 | finish();
117 | finish();
118 |
119 | }
120 | else if (id == R.id.nav_track) {
121 | Intent i = new Intent(MainActivity.this, Track.class);
122 | startActivity(i);
123 | finish();
124 | }
125 | else if (id == R.id.nav_share) {
126 |
127 | String shareBody = "This is an invite by your dear friend to come and join this community where people care and are making a change!" +
128 | "Install Capo today from ... ";
129 | Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);
130 | sharingIntent.setType("text/plain");
131 | sharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Greeting from Capo");
132 | sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, shareBody);
133 | startActivity(Intent.createChooser(sharingIntent, getResources().getString(R.string.share_using)));
134 |
135 | } else if (id == R.id.nav_logout) {
136 | SharedPreferences preferences = getSharedPreferences(MyPref, Context.MODE_PRIVATE);
137 | SharedPreferences.Editor editor = preferences.edit();
138 | editor.putString(Name, "null" );
139 | editor.putString(IS_LOGIN, "false");
140 | editor.putString(Phone, "null" );
141 | editor.putString(College, "null" );
142 | editor.putString(Email, "null" );
143 | editor.putString(displaypic, "null" );
144 |
145 | editor.commit();
146 |
147 | Intent i = new Intent(MainActivity.this,LoginBaseActivity.class);
148 | startActivity(i);
149 | finish();
150 |
151 | }
152 |
153 | DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
154 | drawer.closeDrawer(GravityCompat.START);
155 | return true;
156 | }
157 | }
158 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dimpychhabra/capo/GetCapo.java:
--------------------------------------------------------------------------------
1 | package com.example.dimpychhabra.capo;
2 |
3 | import android.content.Context;
4 | import android.content.Intent;
5 | import android.content.SharedPreferences;
6 | import android.os.Bundle;
7 | /*
8 | *Project : CAPO, fully created by
9 | * Dimpy Chhabra, IGDTUW, BTech, IT
10 | * Second year (as of 2017)
11 | * Expected Class of 2019
12 | * Please do not circulate as your own
13 | * Criticism is appreciated to work on memory leaks and bugs
14 | * Contact Info : Find me on Linked in : linkedin.com/in/dimpy-chhabra
15 | *
16 | */
17 | import android.support.design.widget.FloatingActionButton;
18 | import android.support.design.widget.Snackbar;
19 | import android.support.v4.app.FragmentManager;
20 | import android.view.View;
21 | import android.support.design.widget.NavigationView;
22 | import android.support.v4.view.GravityCompat;
23 | import android.support.v4.widget.DrawerLayout;
24 | import android.support.v7.app.ActionBarDrawerToggle;
25 | import android.support.v7.app.AppCompatActivity;
26 | import android.support.v7.widget.Toolbar;
27 | import android.view.Menu;
28 | import android.view.MenuItem;
29 |
30 | public class GetCapo extends BaseActivity {
31 |
32 | private static FragmentManager fragmentManager;
33 |
34 | @Override
35 | protected void onCreate(Bundle savedInstanceState) {
36 | super.onCreate(savedInstanceState);
37 | setContentView(R.layout.activity_get_capo);
38 |
39 | fragmentManager = getSupportFragmentManager();
40 |
41 | // If savedinstnacestate is null then replace login fragment
42 | if (savedInstanceState == null) {
43 |
44 | fragmentManager .beginTransaction()
45 | .replace(R.id.frameContainer, new getCapo_Frag1(), BaseActivity.getCapo_Frag1)
46 | .commit();
47 | }
48 |
49 | Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
50 | setSupportActionBar(toolbar);
51 |
52 | FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
53 | fab.setOnClickListener(new View.OnClickListener() {
54 | @Override
55 | public void onClick(View view) {
56 | Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
57 | .setAction("Action", null).show();
58 | }
59 | });
60 |
61 | DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
62 | ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
63 | this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
64 | drawer.setDrawerListener(toggle);
65 | toggle.syncState();
66 |
67 | NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
68 | navigationView.setNavigationItemSelectedListener(this);
69 |
70 |
71 |
72 | //int id1 = getResources().getIdentifier(dpres, "drawable", getPackageName());
73 |
74 | }
75 |
76 | @Override
77 | public void onBackPressed() {
78 | DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
79 | if (drawer.isDrawerOpen(GravityCompat.START)) {
80 | drawer.closeDrawer(GravityCompat.START);
81 | } else {
82 | super.onBackPressed();
83 | }
84 | }
85 |
86 | @Override
87 | public boolean onCreateOptionsMenu(Menu menu) {
88 | // Inflate the menu; this adds items to the action bar if it is present.
89 | getMenuInflater().inflate(R.menu.get_capo, menu);
90 | return true;
91 | }
92 |
93 | @Override
94 | public boolean onOptionsItemSelected(MenuItem item) {
95 | // Handle action bar item clicks here. The action bar will
96 | // automatically handle clicks on the Home/Up button, so long
97 | // as you specify a parent activity in AndroidManifest.xml.
98 | int id = item.getItemId();
99 |
100 | //noinspection SimplifiableIfStatement
101 | if (id == R.id.action_settings) {
102 | return true;
103 | }
104 |
105 | return super.onOptionsItemSelected(item);
106 | }
107 |
108 | @SuppressWarnings("StatementWithEmptyBody")
109 | @Override
110 | public boolean onNavigationItemSelected(MenuItem item) {
111 | // Handle navigation view item clicks here.
112 | int id = item.getItemId();
113 |
114 | if (id == R.id.nav_home) {
115 | Intent i = new Intent(GetCapo.this, MainActivity.class);
116 | startActivity(i);
117 | finish();
118 |
119 | } else if (id == R.id.nav_profile) {
120 | Intent i = new Intent(GetCapo.this, MyProfile.class);
121 | startActivity(i);
122 | finish();
123 |
124 | } else if (id == R.id.nav_get_capo) {
125 |
126 |
127 | } else if (id == R.id.nav_lets_capo) {
128 | Intent i = new Intent(GetCapo.this, LetsCapo.class);
129 | startActivity(i);
130 | finish();
131 |
132 | } else if (id == R.id.nav_track) {
133 | Intent i = new Intent(GetCapo.this, Track.class);
134 | startActivity(i);
135 | finish();
136 | } else if (id == R.id.nav_share) {
137 | String shareBody = "This is an invite by your dear friend to come and join this community where people care and are making a change!" +
138 | "Install Capo today from ... ";
139 | Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);
140 | sharingIntent.setType("text/plain");
141 | sharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Greeting from Capo");
142 | sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, shareBody);
143 | startActivity(Intent.createChooser(sharingIntent, getResources().getString(R.string.share_using)));
144 |
145 | } else if (id == R.id.nav_logout) {
146 | SharedPreferences preferences = getSharedPreferences(MyPref, Context.MODE_PRIVATE);
147 | SharedPreferences.Editor editor = preferences.edit();
148 | editor.putString(Name, "null" );
149 | editor.putString(IS_LOGIN, "false");
150 | editor.putString(Phone, "null" );
151 | editor.putString(College, "null" );
152 | editor.putString(Email, "null" );
153 | editor.putString(displaypic, "null" );
154 |
155 | editor.commit();
156 |
157 | Intent i = new Intent(GetCapo.this,LoginBaseActivity.class);
158 | startActivity(i);
159 | finish();
160 |
161 | }
162 |
163 | DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
164 | drawer.closeDrawer(GravityCompat.START);
165 | return true;
166 | }
167 | }
168 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dimpychhabra/capo/LetsCapo.java:
--------------------------------------------------------------------------------
1 | package com.example.dimpychhabra.capo;
2 |
3 | import android.content.Context;
4 | import android.content.Intent;
5 | import android.content.SharedPreferences;
6 | import android.os.Bundle;
7 | import android.support.design.widget.FloatingActionButton;
8 | import android.support.design.widget.Snackbar;
9 | import android.support.v4.app.FragmentManager;
10 | import android.view.View;
11 | /*
12 | *Project : CAPO, fully created by
13 | * Dimpy Chhabra, IGDTUW, BTech, IT
14 | * Second year (as of 2017)
15 | * Expected Class of 2019
16 | * Please do not circulate as your own
17 | * Criticism is appreciated to work on memory leaks and bugs
18 | * Contact Info : Find me on Linked in : linkedin.com/in/dimpy-chhabra
19 | *
20 | */
21 | import android.support.design.widget.NavigationView;
22 | import android.support.v4.view.GravityCompat;
23 | import android.support.v4.widget.DrawerLayout;
24 | import android.support.v7.app.ActionBarDrawerToggle;
25 | import android.support.v7.app.AppCompatActivity;
26 | import android.support.v7.widget.Toolbar;
27 | import android.view.Menu;
28 | import android.view.MenuItem;
29 |
30 | public class LetsCapo extends BaseActivity {
31 |
32 | private static FragmentManager fragmentManager;
33 |
34 | public Ride currentRideLetsCapo = new Ride();
35 |
36 | @Override
37 | protected void onCreate(Bundle savedInstanceState) {
38 | super.onCreate(savedInstanceState);
39 | setContentView(R.layout.activity_lets_capo);
40 |
41 |
42 | fragmentManager = getSupportFragmentManager();
43 |
44 | // If savedinstnacestate is null then replace login fragment
45 | if (savedInstanceState == null) {
46 |
47 | SharedPreferences spref = getSharedPreferences(BaseActivity.MyPref, Context.MODE_PRIVATE);
48 | currentRideLetsCapo.putDriver_id(spref.getString(BaseActivity.Phone, null));
49 | fragmentManager .beginTransaction()
50 | .replace(R.id.frameContainer, new letsCapo_Frag1(), BaseActivity.letsCapo_Frag1)
51 | .commit();
52 | }
53 |
54 | Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
55 | setSupportActionBar(toolbar);
56 |
57 | FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
58 | fab.setOnClickListener(new View.OnClickListener() {
59 | @Override
60 | public void onClick(View view) {
61 | Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
62 | .setAction("Action", null).show();
63 | }
64 | });
65 |
66 | DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
67 | ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
68 | this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
69 | drawer.setDrawerListener(toggle);
70 | toggle.syncState();
71 |
72 | NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
73 | navigationView.setNavigationItemSelectedListener(this);
74 |
75 | SharedPreferences spref = getSharedPreferences(BaseActivity.MyPref, Context.MODE_PRIVATE);
76 | String a = spref.getString(BaseActivity.Name, null); // getting String
77 | String b = spref.getString(BaseActivity.Phone, null);
78 | String c = spref.getString(BaseActivity.IS_LOGIN, "false");
79 | String dp = spref.getString(BaseActivity.displaypic, "null");
80 | int id1 = getResources().getIdentifier( dp , "drawable", getPackageName());
81 |
82 | }
83 |
84 | @Override
85 | public void onBackPressed() {
86 | DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
87 | if (drawer.isDrawerOpen(GravityCompat.START)) {
88 | drawer.closeDrawer(GravityCompat.START);
89 | } else {
90 | super.onBackPressed();
91 | }
92 | }
93 |
94 | @Override
95 | public boolean onCreateOptionsMenu(Menu menu) {
96 | // Inflate the menu; this adds items to the action bar if it is present.
97 | getMenuInflater().inflate(R.menu.lets_capo, menu);
98 | return true;
99 | }
100 |
101 | @Override
102 | public boolean onOptionsItemSelected(MenuItem item) {
103 | // Handle action bar item clicks here. The action bar will
104 | // automatically handle clicks on the Home/Up button, so long
105 | // as you specify a parent activity in AndroidManifest.xml.
106 | int id = item.getItemId();
107 |
108 | //noinspection SimplifiableIfStatement
109 | if (id == R.id.action_settings) {
110 | return true;
111 | }
112 |
113 | return super.onOptionsItemSelected(item);
114 | }
115 |
116 | @SuppressWarnings("StatementWithEmptyBody")
117 | @Override
118 | public boolean onNavigationItemSelected(MenuItem item) {
119 | // Handle navigation view item clicks here.
120 | int id = item.getItemId();
121 |
122 | if (id == R.id.nav_home) {
123 | Intent i = new Intent(LetsCapo.this, MainActivity.class);
124 | startActivity(i);
125 | finish();
126 |
127 | } else if (id == R.id.nav_profile) {
128 | Intent i = new Intent(LetsCapo.this, MyProfile.class);
129 | startActivity(i);
130 | finish();
131 |
132 | } else if (id == R.id.nav_get_capo) {
133 | Intent i = new Intent(LetsCapo.this, Track.class);
134 | startActivity(i);
135 | finish();
136 |
137 | } else if (id == R.id.nav_lets_capo) {
138 |
139 | }else if (id == R.id.nav_track){
140 | Intent i = new Intent(LetsCapo.this, Track.class);
141 | startActivity(i);
142 | finish();
143 |
144 | } else if (id == R.id.nav_share) {
145 | String shareBody = "This is an invite by your dear friend to come and join this community where people care and are making a change!" +
146 | "Install Capo today from ... ";
147 | Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);
148 | sharingIntent.setType("text/plain");
149 | sharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Greeting from Capo");
150 | sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, shareBody);
151 | startActivity(Intent.createChooser(sharingIntent, getResources().getString(R.string.share_using)));
152 |
153 | } else if (id == R.id.nav_logout) {
154 | SharedPreferences preferences = getSharedPreferences(MyPref, Context.MODE_PRIVATE);
155 | SharedPreferences.Editor editor = preferences.edit();
156 | editor.putString(Name, "null" );
157 | editor.putString(IS_LOGIN, "false");
158 | editor.putString(Phone, "null" );
159 | editor.putString(College, "null" );
160 | editor.putString(Email, "null" );
161 | editor.putString(displaypic, "null" );
162 |
163 | editor.commit();
164 |
165 | Intent i = new Intent(LetsCapo.this,LoginBaseActivity.class);
166 | startActivity(i);
167 | finish();
168 | }
169 |
170 | DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
171 | drawer.closeDrawer(GravityCompat.START);
172 | return true;
173 |
174 |
175 | }
176 |
177 |
178 |
179 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dimpychhabra/capo/MyProfile.java:
--------------------------------------------------------------------------------
1 | package com.example.dimpychhabra.capo;
2 |
3 | import android.content.Context;
4 | import android.content.Intent;
5 | import android.content.SharedPreferences;
6 | import android.os.Bundle;
7 | import android.support.design.widget.FloatingActionButton;
8 | import android.support.design.widget.Snackbar;
9 | import android.support.v4.content.ContextCompat;
10 | import android.util.Log;
11 | /*
12 | *Project : CAPO, fully created by
13 | * Dimpy Chhabra, IGDTUW, BTech, IT
14 | * Second year (as of 2017)
15 | * Expected Class of 2019
16 | * Please do not circulate as your own
17 | * Criticism is appreciated to work on memory leaks and bugs
18 | * Contact Info : Find me on Linked in : linkedin.com/in/dimpy-chhabra
19 | *
20 | */
21 | import android.view.View;
22 | import android.support.design.widget.NavigationView;
23 | import android.support.v4.view.GravityCompat;
24 | import android.support.v4.widget.DrawerLayout;
25 | import android.support.v7.app.ActionBarDrawerToggle;
26 | import android.support.v7.app.AppCompatActivity;
27 | import android.support.v7.widget.Toolbar;
28 | import android.view.Menu;
29 | import android.view.MenuItem;
30 | import android.widget.ImageView;
31 | import android.widget.TextView;
32 |
33 | import org.w3c.dom.Text;
34 |
35 | public class MyProfile extends BaseActivity {
36 |
37 | TextView tvName, tvEmail, tvMobile, tvCardets, tvCollege, tvEnroll;
38 | ImageView dp;
39 | String id ;
40 | String name;
41 | String dets;
42 | String email;
43 | String college;
44 | String enroll;
45 | String dpres;
46 |
47 | @Override
48 | protected void onCreate(Bundle savedInstanceState) {
49 | super.onCreate(savedInstanceState);
50 | setContentView(R.layout.activity_my_profile);
51 | Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
52 | setSupportActionBar(toolbar);
53 |
54 | FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
55 | fab.setVisibility(View.INVISIBLE);
56 |
57 | /*
58 | fab.setOnClickListener(new View.OnClickListener() {
59 | @Override
60 | public void onClick(View view) {
61 | Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
62 | .setAction("Action", null).show();
63 | }
64 | });
65 | */
66 |
67 |
68 | DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
69 | ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
70 | this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
71 | drawer.setDrawerListener(toggle);
72 | toggle.syncState();
73 |
74 | NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
75 | navigationView.setNavigationItemSelectedListener(this);
76 | //////////////////////////////////////////////////Code begins
77 | SharedPreferences spref = getSharedPreferences(BaseActivity.MyPref, Context.MODE_PRIVATE);
78 | name = spref.getString(BaseActivity.Name, null); // getting String
79 | id = spref.getString(BaseActivity.Phone, null);
80 | email = spref.getString(BaseActivity.Email, null);
81 | college = spref.getString(BaseActivity.College, null);
82 | enroll = spref.getString(BaseActivity.Enroll, null);
83 | if (spref.getString(BaseActivity.displaypic, null).trim().equals("F")) {
84 | dpres = "@drawable/fpp";
85 | } else {
86 | dpres = "@drawable/mpp";
87 | }
88 | dets = spref.getString(BaseActivity.Extras, null);
89 |
90 |
91 |
92 | tvName = (TextView)findViewById(R.id.tvName);
93 | tvEmail = (TextView)findViewById(R.id.tvEmail);
94 | tvMobile = (TextView)findViewById(R.id.tvMobile);
95 | tvCardets = (TextView)findViewById(R.id.tvCar);
96 | tvCollege = (TextView) findViewById(R.id.tvCollege);
97 | tvEnroll = (TextView) findViewById(R.id.tvEnroll);
98 | dp = (ImageView)findViewById(R.id.iv1);
99 | int id1 = getResources().getIdentifier(dpres, "drawable", getPackageName());
100 | dp.setImageResource(id1);
101 | tvName.setText(name);
102 | Log.e("Name : ","name "+name);
103 | tvEmail.setText(email);
104 | tvMobile.setText(id);
105 | tvCollege.setText(college);
106 | tvCardets.setText(dets);
107 | tvEnroll.setText(enroll);
108 |
109 | }
110 |
111 | @Override
112 | public void onBackPressed() {
113 | DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
114 | if (drawer.isDrawerOpen(GravityCompat.START)) {
115 | drawer.closeDrawer(GravityCompat.START);
116 | } else {
117 | super.onBackPressed();
118 | }
119 | }
120 |
121 | @Override
122 | public boolean onCreateOptionsMenu(Menu menu) {
123 | // Inflate the menu; this adds items to the action bar if it is present.
124 | getMenuInflater().inflate(R.menu.my_profile, menu);
125 | return true;
126 | }
127 |
128 | @Override
129 | public boolean onOptionsItemSelected(MenuItem item) {
130 | // Handle action bar item clicks here. The action bar will
131 | // automatically handle clicks on the Home/Up button, so long
132 | // as you specify a parent activity in AndroidManifest.xml.
133 | int id = item.getItemId();
134 |
135 | //noinspection SimplifiableIfStatement
136 | if (id == R.id.action_settings) {
137 | return true;
138 | }
139 |
140 | return super.onOptionsItemSelected(item);
141 | }
142 |
143 | @SuppressWarnings("StatementWithEmptyBody")
144 | @Override
145 | public boolean onNavigationItemSelected(MenuItem item) {
146 | // Handle navigation view item clicks here.
147 | int id = item.getItemId();
148 |
149 | if (id == R.id.nav_home) {
150 |
151 | Intent i = new Intent(MyProfile.this, MainActivity.class);
152 | startActivity(i);
153 | finish();
154 |
155 | } else if (id == R.id.nav_profile) {
156 |
157 | } else if (id == R.id.nav_get_capo) {
158 | Intent i = new Intent(MyProfile.this, Track.class);
159 | startActivity(i);
160 | finish();
161 |
162 |
163 | } else if (id == R.id.nav_lets_capo) {
164 | Intent i = new Intent(MyProfile.this, LetsCapo.class);
165 | startActivity(i);
166 | finish();
167 |
168 | } else if (id == R.id.nav_track) {
169 | Intent i = new Intent(MyProfile.this, Track.class);
170 | startActivity(i);
171 | finish();
172 |
173 | } else if (id == R.id.nav_share) {
174 | String shareBody = "This is an invite by your dear friend to come and join this community where people care and are making a change!" +
175 | "Install Capo today from ... ";
176 | Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);
177 | sharingIntent.setType("text/plain");
178 | sharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Greeting from Capo");
179 | sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, shareBody);
180 | startActivity(Intent.createChooser(sharingIntent, getResources().getString(R.string.share_using)));
181 |
182 | } else if (id == R.id.nav_logout) {
183 | SharedPreferences preferences = getSharedPreferences(MyPref, Context.MODE_PRIVATE);
184 | SharedPreferences.Editor editor = preferences.edit();
185 | editor.putString(Name, "null" );
186 | editor.putString(IS_LOGIN, "false");
187 | editor.putString(Phone, "null" );
188 | editor.putString(College, "null" );
189 | editor.putString(Email, "null" );
190 | editor.putString(displaypic, "null" );
191 |
192 | editor.commit();
193 |
194 | Intent i = new Intent(MyProfile.this,LoginBaseActivity.class);
195 | startActivity(i);
196 | finish();
197 |
198 | }
199 |
200 | DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
201 | drawer.closeDrawer(GravityCompat.START);
202 | return true;
203 | }
204 | }
205 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dimpychhabra/capo/Track.java:
--------------------------------------------------------------------------------
1 | package com.example.dimpychhabra.capo;
2 |
3 | import android.content.Context;
4 | import android.content.Intent;
5 | import android.content.SharedPreferences;
6 | /*
7 | *Project : CAPO, fully created by
8 | * Dimpy Chhabra, IGDTUW, BTech, IT
9 | * Second year (as of 2017)
10 | * Expected Class of 2019
11 | * Please do not circulate as your own
12 | * Criticism is appreciated to work on memory leaks and bugs
13 | * Contact Info : Find me on Linked in : linkedin.com/in/dimpy-chhabra
14 | *
15 | */
16 | import android.support.design.widget.FloatingActionButton;
17 | import android.support.design.widget.NavigationView;
18 | import android.support.design.widget.Snackbar;
19 | import android.support.v4.app.Fragment;
20 | import android.support.v4.app.FragmentManager;
21 | import android.support.v4.view.GravityCompat;
22 | import android.support.v4.widget.DrawerLayout;
23 | import android.support.v7.app.ActionBarDrawerToggle;
24 | import android.os.Bundle;
25 | import android.support.v7.widget.Toolbar;
26 | import android.view.Menu;
27 | import android.view.MenuItem;
28 | import android.view.View;
29 |
30 | public class Track extends BaseActivity {
31 | FragmentManager fragmentManager;
32 |
33 | @Override
34 | protected void onCreate(Bundle savedInstanceState) {
35 | super.onCreate(savedInstanceState);
36 | setContentView(R.layout.activity_track);
37 | Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
38 | setSupportActionBar(toolbar);
39 |
40 | FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
41 | fab.setOnClickListener(new View.OnClickListener() {
42 | @Override
43 | public void onClick(View view) {
44 | Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
45 | .setAction("Action", null).show();
46 | }
47 | });
48 |
49 | DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
50 | ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
51 | this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
52 | drawer.setDrawerListener(toggle);
53 | toggle.syncState();
54 |
55 | NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
56 | navigationView.setNavigationItemSelectedListener(this);
57 |
58 | fragmentManager = getSupportFragmentManager();
59 |
60 | // If savedinstnacestate is null then replace login fragment
61 | if (savedInstanceState == null) {
62 | fragmentManager.beginTransaction()
63 | .replace(R.id.frameContainerTrack, new Main_found_Frag(), BaseActivity.found_rides_Frag)
64 | .commit();
65 | }
66 | }
67 |
68 | // Replace Login Fragment with animation
69 | /* protected void replaceFoundRidesFragment() {
70 | fragmentManager
71 | .beginTransaction()
72 | .setCustomAnimations(R.anim.left_enter, R.anim.right_out)
73 | .replace(R.id.frameContainerTrack, new Main_offered_Frag(),
74 | BaseActivity.offered_rides_Frag).commit();
75 | }
76 | protected void replaceOfferedRidesFragment() {
77 | fragmentManager
78 | .beginTransaction()
79 | .setCustomAnimations(R.anim.left_enter, R.anim.right_out)
80 | .replace(R.id.frameContainerTrack, new Main_found_Frag(),
81 | BaseActivity.found_rides_Frag).commit();
82 | }
83 | */
84 | @Override
85 | public void onBackPressed() {
86 |
87 | /* Fragment Main_found_Frag = fragmentManager
88 | .findFragmentByTag(BaseActivity.found_rides_Frag);
89 | Fragment Main_offered_Frag = fragmentManager
90 | .findFragmentByTag(BaseActivity.offered_rides_Frag);
91 | */
92 | Fragment My_offered_rides_frag = fragmentManager
93 | .findFragmentByTag(BaseActivity.my_offered_ride_Frag);
94 | Fragment My_found_ride_Frag = fragmentManager
95 | .findFragmentByTag(BaseActivity.my_found_ride_Frag);
96 |
97 | DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
98 | if (drawer.isDrawerOpen(GravityCompat.START)) {
99 | drawer.closeDrawer(GravityCompat.START);
100 | } else if (My_offered_rides_frag != null) {
101 | fragmentManager
102 | .beginTransaction()
103 | .replace(R.id.frameContainerTrack, new Main_offered_Frag(), BaseActivity.offered_rides_Frag)
104 | .commit();
105 | } else if (My_found_ride_Frag != null) {
106 | fragmentManager
107 | .beginTransaction()
108 | .replace(R.id.frameContainerTrack, new Main_found_Frag(), BaseActivity.found_rides_Frag)
109 | .commit();
110 | } else {
111 | Intent i = new Intent(Track.this, MainActivity.class);
112 | startActivity(i);
113 | finish();
114 |
115 | }
116 | }
117 |
118 | /////////////////// ///////////
119 |
120 | @Override
121 | public boolean onCreateOptionsMenu(Menu menu) {
122 | // Inflate the menu; this adds items to the action bar if it is present.
123 | getMenuInflater().inflate(R.menu.my_profile, menu);
124 | return true;
125 | }
126 |
127 | @Override
128 | public boolean onOptionsItemSelected(MenuItem item) {
129 | // Handle action bar item clicks here. The action bar will
130 | // automatically handle clicks on the Home/Up button, so long
131 | // as you specify a parent activity in AndroidManifest.xml.
132 | int id = item.getItemId();
133 |
134 | //noinspection SimplifiableIfStatement
135 | if (id == R.id.action_settings) {
136 | return true;
137 | }
138 |
139 | return super.onOptionsItemSelected(item);
140 | }
141 |
142 | @SuppressWarnings("StatementWithEmptyBody")
143 | @Override
144 | public boolean onNavigationItemSelected(MenuItem item) {
145 | // Handle navigation view item clicks here.
146 | int id = item.getItemId();
147 |
148 | if (id == R.id.nav_home) {
149 |
150 | Intent i = new Intent(Track.this, MainActivity.class);
151 | startActivity(i);
152 | finish();
153 |
154 | } else if (id == R.id.nav_profile) {
155 | Intent i = new Intent(Track.this, MyProfile.class);
156 | startActivity(i);
157 | finish();
158 | } else if (id == R.id.nav_get_capo) {
159 |
160 |
161 | } else if (id == R.id.nav_lets_capo) {
162 | Intent i = new Intent(Track.this, LetsCapo.class);
163 | startActivity(i);
164 | finish();
165 |
166 | } else if (id == R.id.nav_track) {
167 |
168 |
169 | } else if (id == R.id.nav_share) {
170 | String shareBody = "This is an invite by your dear friend to come and join this community where people care and are making a change!" +
171 | "Install Capo today from ... ";
172 | Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);
173 | sharingIntent.setType("text/plain");
174 | sharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Greeting from Capo");
175 | sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, shareBody);
176 | startActivity(Intent.createChooser(sharingIntent, getResources().getString(R.string.share_using)));
177 |
178 | } else if (id == R.id.nav_logout) {
179 | SharedPreferences preferences = getSharedPreferences(MyPref, Context.MODE_PRIVATE);
180 | SharedPreferences.Editor editor = preferences.edit();
181 | editor.putString(Name, "null");
182 | editor.putString(IS_LOGIN, "false");
183 | editor.putString(Phone, "null");
184 | editor.putString(College, "null");
185 | editor.putString(Email, "null");
186 | editor.putString(displaypic, "null");
187 |
188 | editor.commit();
189 |
190 | Intent i = new Intent(Track.this, LoginBaseActivity.class);
191 | startActivity(i);
192 | finish();
193 | }
194 | DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
195 | drawer.closeDrawer(GravityCompat.START);
196 | return true;
197 | }
198 | }
199 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dimpychhabra/capo/Main_offered_Frag.java:
--------------------------------------------------------------------------------
1 | package com.example.dimpychhabra.capo;
2 |
3 | import android.content.Context;
4 | import android.content.SharedPreferences;
5 | import android.net.Uri;
6 | import android.os.Bundle;
7 | import android.support.v4.app.Fragment;
8 | import android.support.v4.app.FragmentManager;
9 | import android.util.Log;
10 | import android.view.LayoutInflater;
11 | import android.view.View;
12 | /*
13 | *Project : CAPO, fully created by
14 | * Dimpy Chhabra, IGDTUW, BTech, IT
15 | * Second year (as of 2017)
16 | * Expected Class of 2019
17 | * Please do not circulate as your own
18 | * Criticism is appreciated to work on memory leaks and bugs
19 | * Contact Info : Find me on Linked in : linkedin.com/in/dimpy-chhabra
20 | *
21 | */
22 | import android.view.ViewGroup;
23 | import android.widget.AdapterView;
24 | import android.widget.Button;
25 | import android.widget.EditText;
26 | import android.widget.ListView;
27 | import android.widget.TextView;
28 | import android.widget.Toast;
29 |
30 | import com.android.volley.DefaultRetryPolicy;
31 | import com.android.volley.Request;
32 | import com.android.volley.RequestQueue;
33 | import com.android.volley.Response;
34 | import com.android.volley.VolleyError;
35 | import com.android.volley.toolbox.StringRequest;
36 | import com.android.volley.toolbox.Volley;
37 |
38 | import org.json.JSONArray;
39 | import org.json.JSONException;
40 | import org.json.JSONObject;
41 |
42 | import java.util.ArrayList;
43 | import java.util.HashMap;
44 | import java.util.Map;
45 |
46 |
47 | public class Main_offered_Frag extends Fragment {
48 |
49 |
50 | View view;
51 | Button button;
52 | EditText to, from, fromTime;
53 | FragmentManager fragmentManager;
54 | TextView tv11, tv22;
55 | RequestQueue requestQueue;
56 | StringRequest stringRequest;
57 | String res = "dummy";
58 |
59 | private static String DataParseUrl = "http://impycapo.esy.es/offeredRidesList.php";
60 |
61 | public Main_offered_Frag() {
62 | // Required empty public constructor
63 | }
64 |
65 | @Override
66 | public void onCreate(Bundle savedInstanceState) {
67 | super.onCreate(savedInstanceState);
68 | }
69 |
70 | @Override
71 | public View onCreateView(LayoutInflater inflater, ViewGroup container,
72 | Bundle savedInstanceState) {
73 | // Inflate the layout for this fragment
74 | view = inflater.inflate(R.layout.fragment_main_offered_, container, false);
75 | fragmentManager = getActivity().getSupportFragmentManager();
76 | tv11 = (TextView) view.findViewById(R.id.tv11);
77 |
78 | tv11.setOnClickListener(new View.OnClickListener() {
79 | @Override
80 | public void onClick(View v) {
81 | fragmentManager
82 | .beginTransaction()
83 | .setCustomAnimations(R.anim.right_out, R.anim.left_enter)
84 | .replace(R.id.frameContainerTrack, new Main_found_Frag(),
85 | BaseActivity.found_rides_Frag).commit();
86 | }
87 | });
88 |
89 | //here we will fetch data from database via volley --> make an object --> set adapter and work accordingly
90 | volleyToFetchResponse();
91 |
92 | //final ArrayList ridesArrayList = new ArrayList<>(); //Max Pric
93 | final ArrayList ridesArrayList = extractRides(res);
94 |
95 | //ridesArrayList.add(new Ride("Rajiv Chownk", "IGDTU", " 3 seats ", " 10:00 am ", "12:00 pm ", " 120", "ride001"));
96 | //ridesArrayList.add(new Ride("Pitampura", "DTU", " 2 seats ", " 09:00 am ", "10:00 am ", " 120", "ride002"));
97 | //ridesArrayList.add(new Ride("Rohini", "NSIT", " 3 seats ", " 07:00 am ", "08:00 am ", " 120", "ride003"));
98 | //ridesArrayList.add(new Ride("NSP", "IIITD", " 1 seat ", " 10:00 am ", "11:00 am ", " 120", "ride004"));
99 |
100 | RidesFoundAdapter rideAdapter = new RidesFoundAdapter(getActivity(), ridesArrayList);
101 | ListView listView = (ListView) view.findViewById(R.id.list);
102 | listView.setAdapter(rideAdapter);
103 |
104 | listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
105 | @Override
106 | public void onItemClick(AdapterView> parent, View view, int position, long id) {
107 |
108 | Ride ride = ridesArrayList.get(position);
109 | Log.e("onItem Click ", " " + ride.getR_id());
110 | /*
111 | YourNewFragment ldf = new YourNewFragment ();
112 | Bundle args = new Bundle();
113 | args.putString("YourKey", "YourValue");
114 | ldf.setArguments(args);
115 | //Inflate the fragment
116 | getFragmentManager().beginTransaction().add(R.id.container, ldf).commit();
117 | */
118 | My_offered_rides_Frag frag = new My_offered_rides_Frag();
119 | Bundle args = new Bundle();
120 | args.putString("rideId", "" + ride.getR_id());
121 | frag.setArguments(args);
122 |
123 | fragmentManager
124 | .beginTransaction()
125 | .replace(R.id.frameContainerTrack, frag,
126 | BaseActivity.offered_rides_Frag).commit();
127 | }
128 | });
129 |
130 | return view;
131 | }
132 |
133 | private ArrayList extractRides(String res) {
134 | ArrayList ridesAL = new ArrayList<>();
135 | try {
136 | JSONArray baseArray = new JSONArray(res);
137 | for (int i = 0; i < baseArray.length(); i++) {
138 | JSONObject currentRide = baseArray.getJSONObject(i);
139 | String from = currentRide.getString("from_loc");
140 | String to = currentRide.getString("to_college");
141 | String seats = currentRide.getString("num_seats");
142 | String ftime = currentRide.getString("from_time");
143 | String rtime = currentRide.getString("reach_time");
144 | String rdate = currentRide.getString("r_date");
145 | String r_id = currentRide.getString("r_id");
146 |
147 | Ride ride = new Ride(from, to, seats, ftime, rtime, rdate, r_id);
148 | ridesAL.add(ride);
149 | }
150 |
151 |
152 | } catch (JSONException e) {
153 | Log.e("in ExtractRides : ", "JSON TRY CATCH ERR!");
154 | }
155 | return ridesAL;
156 | }
157 |
158 | private void volleyToFetchResponse() {
159 | stringRequest = new StringRequest(Request.Method.POST, DataParseUrl, new Response.Listener() {
160 | @Override
161 | public void onResponse(String response) {
162 | if (response != null && response.length() > 0) {
163 | Toast.makeText(getContext(), response, Toast.LENGTH_LONG).show();
164 | res = response;
165 | } else {
166 | Toast.makeText(getContext(), "You didnt offer no rides!", Toast.LENGTH_LONG).show();
167 | }
168 | }
169 | },
170 | new Response.ErrorListener() {
171 | @Override
172 | public void onErrorResponse(VolleyError error) {
173 | if (error != null && error.toString().length() > 0) {
174 | Toast.makeText(getContext(), error.toString(), Toast.LENGTH_LONG).show();
175 | Log.e(" in main_Offered_Frag", " error in parsing data");
176 | }
177 | else
178 | Toast.makeText(getContext(), "Something went terribly wrong! ", Toast.LENGTH_LONG).show();
179 |
180 | }
181 | }) {
182 | @Override
183 | protected Map getParams() {
184 | Map params = new HashMap<>();
185 | SharedPreferences spref = getActivity().getSharedPreferences(BaseActivity.MyPref, Context.MODE_PRIVATE);
186 | final String dr_id = spref.getString(BaseActivity.Phone, null); // getting String
187 | params.put("driver", dr_id);
188 | return params;
189 | }
190 | };
191 | stringRequest.setRetryPolicy(new DefaultRetryPolicy(40000, DefaultRetryPolicy.DEFAULT_MAX_RETRIES, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));
192 | requestQueue = Volley.newRequestQueue(getActivity().getApplicationContext());
193 | requestQueue.add(stringRequest);
194 | }
195 |
196 | }
--------------------------------------------------------------------------------
/app/src/main/res/layout/signup_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
17 |
18 |
34 |
35 |
39 |
40 |
56 |
57 |
61 |
62 |
78 |
79 |
83 |
84 |
100 |
101 |
105 |
106 |
122 |
123 |
127 |
128 |
144 |
145 |
149 |
150 |
166 |
167 |
171 |
172 |
180 |
181 |
189 |
190 |
198 |
199 |
210 |
211 |
222 |
223 |
--------------------------------------------------------------------------------