├── nano.save ├── app ├── .gitignore ├── justgo.apk ├── src │ ├── main │ │ ├── ic_launcher-web.png │ │ ├── res │ │ │ ├── drawable │ │ │ │ ├── bus.jpg │ │ │ │ ├── d1.png │ │ │ │ ├── logo.png │ │ │ │ ├── ln_logo.png │ │ │ │ ├── spinner.gif │ │ │ │ ├── background.jpg │ │ │ │ ├── nav_image.jpg │ │ │ │ ├── ic_edit_white_24dp.png │ │ │ │ ├── ic_person_black_24dp.png │ │ │ │ ├── ic_history_black_24dp.png │ │ │ │ ├── ic_attach_money_black_24dp.png │ │ │ │ ├── ic_directions_car_black_36dp.png │ │ │ │ ├── ic_shopping_cart_black_24dp.png │ │ │ │ ├── button_green_border.xml │ │ │ │ ├── button_grey_border.xml │ │ │ │ ├── side_nav_bar.xml │ │ │ │ ├── ic_star_black.xml │ │ │ │ ├── ic_person_name.xml │ │ │ │ ├── ic_edit_profile.xml │ │ │ │ ├── ic_event_seat_black_24dp.xml │ │ │ │ ├── ic_email_black.xml │ │ │ │ ├── ic_wallet.xml │ │ │ │ ├── ic_location_on_black.xml │ │ │ │ ├── input_box.xml │ │ │ │ └── ic_phone_black.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 │ │ │ ├── layout │ │ │ │ ├── item_divider.xml │ │ │ │ ├── content_book.xml │ │ │ │ ├── fragment_history.xml │ │ │ │ ├── content_main.xml │ │ │ │ ├── activity_main.xml │ │ │ │ ├── activity_book.xml │ │ │ │ ├── app_bar_main.xml │ │ │ │ ├── recyclerview_item.xml │ │ │ │ ├── splash_screen.xml │ │ │ │ ├── nav_header_main.xml │ │ │ │ ├── fragment_book.xml │ │ │ │ ├── info_dialog.xml │ │ │ │ ├── error_dialog.xml │ │ │ │ ├── activity_order_details.xml │ │ │ │ ├── activity_confirm_order.xml │ │ │ │ ├── activity_profile.xml │ │ │ │ ├── book_row.xml │ │ │ │ ├── order_input_dialog.xml │ │ │ │ ├── book_row2.xml │ │ │ │ ├── fragment_select_route.xml │ │ │ │ ├── activity_sign_in.xml │ │ │ │ ├── orders_row.xml │ │ │ │ └── activity_signup.xml │ │ │ ├── values │ │ │ │ ├── colors.xml │ │ │ │ ├── drawables.xml │ │ │ │ ├── dimens.xml │ │ │ │ ├── styles.xml │ │ │ │ └── strings.xml │ │ │ └── menu │ │ │ │ ├── main.xml │ │ │ │ ├── menu_book.xml │ │ │ │ ├── menu_confirm_order.xml │ │ │ │ └── activity_main_drawer.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── codephillip │ │ │ │ └── app │ │ │ │ └── busticket │ │ │ │ ├── provider │ │ │ │ ├── base │ │ │ │ │ ├── BaseModel.java │ │ │ │ │ ├── AbstractContentValues.java │ │ │ │ │ └── AbstractCursor.java │ │ │ │ ├── locations │ │ │ │ │ ├── LocationsModel.java │ │ │ │ │ ├── LocationsCursor.java │ │ │ │ │ ├── LocationsColumns.java │ │ │ │ │ ├── LocationsContentValues.java │ │ │ │ │ └── LocationsSelection.java │ │ │ │ ├── orders │ │ │ │ │ ├── OrdersModel.java │ │ │ │ │ ├── OrdersColumns.java │ │ │ │ │ ├── OrdersCursor.java │ │ │ │ │ └── OrdersContentValues.java │ │ │ │ ├── BusTicketSQLiteOpenHelperCallbacks.java │ │ │ │ ├── routes │ │ │ │ │ ├── RoutesModel.java │ │ │ │ │ ├── RoutesColumns.java │ │ │ │ │ ├── RoutesCursor.java │ │ │ │ │ └── RoutesContentValues.java │ │ │ │ ├── BusTicketSQLiteOpenHelper.java │ │ │ │ └── BusTicketProvider.java │ │ │ │ ├── Constants.java │ │ │ │ ├── mymodels │ │ │ │ ├── Orders.java │ │ │ │ ├── routeobject │ │ │ │ │ ├── Routes.java │ │ │ │ │ ├── Bus.java │ │ │ │ │ ├── Route.java │ │ │ │ │ └── BusCompany.java │ │ │ │ ├── Customers.java │ │ │ │ ├── Locations.java │ │ │ │ ├── Location.java │ │ │ │ ├── Order.java │ │ │ │ └── Customer.java │ │ │ │ ├── retrofit │ │ │ │ ├── ApiClient.java │ │ │ │ └── ApiInterface.java │ │ │ │ ├── BookActivity.java │ │ │ │ ├── ProfileFragment.java │ │ │ │ ├── broadcasts │ │ │ │ └── MyReceiver.java │ │ │ │ ├── SplashActivity.java │ │ │ │ ├── OrdersFragment.java │ │ │ │ ├── HistoryFragment.java │ │ │ │ ├── adapters │ │ │ │ ├── BookAdapter.java │ │ │ │ ├── OrdersAdapter.java │ │ │ │ └── SeatGridAdapter.java │ │ │ │ ├── BookFragment.java │ │ │ │ ├── MainActivity.java │ │ │ │ ├── SelectRouteFragment.java │ │ │ │ └── OrderDetailsActivity.java │ │ └── AndroidManifest.xml │ ├── androidTest │ │ └── java │ │ │ └── com │ │ │ └── codephillip │ │ │ └── app │ │ │ └── busticket │ │ │ └── ExampleInstrumentedTest.java │ └── test │ │ └── java │ │ └── com │ │ └── codephillip │ │ └── app │ │ └── busticket │ │ ├── RegexValidatorTest.java │ │ └── GeneralUnitTest.java ├── proguard-rules.pro └── build.gradle ├── settings.gradle ├── device-2017-05-11-201458.png ├── device-2017-05-11-201543.png ├── .idea ├── copyright │ └── profiles_settings.xml ├── vcs.xml ├── modules.xml ├── runConfigurations.xml ├── gradle.xml ├── compiler.xml └── misc.xml ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── README.md ├── gradle.properties ├── gradlew.bat └── gradlew /nano.save: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /app/justgo.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codephillip/Bus-Ticket-app/HEAD/app/justgo.apk -------------------------------------------------------------------------------- /device-2017-05-11-201458.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codephillip/Bus-Ticket-app/HEAD/device-2017-05-11-201458.png -------------------------------------------------------------------------------- /device-2017-05-11-201543.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codephillip/Bus-Ticket-app/HEAD/device-2017-05-11-201543.png -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /app/src/main/ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codephillip/Bus-Ticket-app/HEAD/app/src/main/ic_launcher-web.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/bus.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codephillip/Bus-Ticket-app/HEAD/app/src/main/res/drawable/bus.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable/d1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codephillip/Bus-Ticket-app/HEAD/app/src/main/res/drawable/d1.png -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codephillip/Bus-Ticket-app/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/drawable/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codephillip/Bus-Ticket-app/HEAD/app/src/main/res/drawable/logo.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ln_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codephillip/Bus-Ticket-app/HEAD/app/src/main/res/drawable/ln_logo.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/spinner.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codephillip/Bus-Ticket-app/HEAD/app/src/main/res/drawable/spinner.gif -------------------------------------------------------------------------------- /app/src/main/res/drawable/background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codephillip/Bus-Ticket-app/HEAD/app/src/main/res/drawable/background.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable/nav_image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codephillip/Bus-Ticket-app/HEAD/app/src/main/res/drawable/nav_image.jpg -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codephillip/Bus-Ticket-app/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codephillip/Bus-Ticket-app/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codephillip/Bus-Ticket-app/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_edit_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codephillip/Bus-Ticket-app/HEAD/app/src/main/res/drawable/ic_edit_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codephillip/Bus-Ticket-app/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codephillip/Bus-Ticket-app/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_person_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codephillip/Bus-Ticket-app/HEAD/app/src/main/res/drawable/ic_person_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codephillip/Bus-Ticket-app/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/codephillip/Bus-Ticket-app/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_history_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codephillip/Bus-Ticket-app/HEAD/app/src/main/res/drawable/ic_history_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codephillip/Bus-Ticket-app/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/codephillip/Bus-Ticket-app/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/codephillip/Bus-Ticket-app/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/java/com/codephillip/app/busticket/provider/base/BaseModel.java: -------------------------------------------------------------------------------- 1 | package com.codephillip.app.busticket.provider.base; 2 | 3 | public interface BaseModel { 4 | } 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_attach_money_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codephillip/Bus-Ticket-app/HEAD/app/src/main/res/drawable/ic_attach_money_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_directions_car_black_36dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codephillip/Bus-Ticket-app/HEAD/app/src/main/res/drawable/ic_directions_car_black_36dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_shopping_cart_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codephillip/Bus-Ticket-app/HEAD/app/src/main/res/drawable/ic_shopping_cart_black_24dp.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/ 11 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/java/com/codephillip/app/busticket/Constants.java: -------------------------------------------------------------------------------- 1 | package com.codephillip.app.busticket; 2 | 3 | /** 4 | * Created by codephillip on 19/10/17. 5 | */ 6 | 7 | public class Constants { 8 | public static final String HAS_BOOKED = "has_booked"; 9 | 10 | } 11 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sat Oct 28 02:19:04 EAT 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-4.1-all.zip 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Bus-Ticket-app 2 | Android app that allows users to book bus tickets 3 | 4 | Libraries 5 | 6 | Content provider generator 7 | https://github.com/BoD/android-contentprovider-generator 8 | 9 | POJO site 10 | Get the json response from server and create POJO files 11 | http://www.jsonschema2pojo.org/ 12 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/button_green_border.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/button_grey_border.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/side_nav_bar.xml: -------------------------------------------------------------------------------- 1 | 3 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_divider.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #009688 4 | #00796B 5 | #1DE9B6 6 | #848383 7 | #F44336 8 | #e4e4e4 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/menu/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_star_black.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_person_name.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_edit_profile.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_event_seat_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_book.xml: -------------------------------------------------------------------------------- 1 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_email_black.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_confirm_order.xml: -------------------------------------------------------------------------------- 1 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_wallet.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/layout/content_book.xml: -------------------------------------------------------------------------------- 1 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_location_on_black.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/input_box.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | 11 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/java/com/codephillip/app/busticket/mymodels/Orders.java: -------------------------------------------------------------------------------- 1 | 2 | package com.codephillip.app.busticket.mymodels; 3 | 4 | import java.util.List; 5 | import com.google.gson.annotations.Expose; 6 | import com.google.gson.annotations.SerializedName; 7 | 8 | public class Orders { 9 | 10 | @SerializedName("orders") 11 | @Expose 12 | private List orders = null; 13 | 14 | public List getOrders() { 15 | return orders; 16 | } 17 | 18 | public void setOrders(List orders) { 19 | this.orders = orders; 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /app/src/main/java/com/codephillip/app/busticket/mymodels/routeobject/Routes.java: -------------------------------------------------------------------------------- 1 | 2 | package com.codephillip.app.busticket.mymodels.routeobject; 3 | 4 | import java.util.List; 5 | import com.google.gson.annotations.Expose; 6 | import com.google.gson.annotations.SerializedName; 7 | 8 | public class Routes { 9 | 10 | @SerializedName("routes") 11 | @Expose 12 | private List routes = null; 13 | 14 | public List getRoutes() { 15 | return routes; 16 | } 17 | 18 | public void setRoutes(List routes) { 19 | this.routes = routes; 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_phone_black.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/java/com/codephillip/app/busticket/mymodels/Customers.java: -------------------------------------------------------------------------------- 1 | 2 | package com.codephillip.app.busticket.mymodels; 3 | 4 | import java.util.List; 5 | import com.google.gson.annotations.Expose; 6 | import com.google.gson.annotations.SerializedName; 7 | 8 | public class Customers { 9 | 10 | @SerializedName("customers") 11 | @Expose 12 | private List customers = null; 13 | 14 | public List getCustomers() { 15 | return customers; 16 | } 17 | 18 | public void setCustomers(List customers) { 19 | this.customers = customers; 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_history.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/java/com/codephillip/app/busticket/mymodels/Locations.java: -------------------------------------------------------------------------------- 1 | 2 | package com.codephillip.app.busticket.mymodels; 3 | 4 | import com.google.gson.annotations.Expose; 5 | import com.google.gson.annotations.SerializedName; 6 | 7 | import java.util.List; 8 | 9 | public class Locations { 10 | 11 | @SerializedName("locations") 12 | @Expose 13 | private List locations = null; 14 | 15 | public List getLocations() { 16 | return locations; 17 | } 18 | 19 | public void setLocations(List locations) { 20 | this.locations = locations; 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /app/src/main/java/com/codephillip/app/busticket/retrofit/ApiClient.java: -------------------------------------------------------------------------------- 1 | package com.codephillip.app.busticket.retrofit; 2 | 3 | import retrofit2.Retrofit; 4 | import retrofit2.converter.gson.GsonConverterFactory; 5 | 6 | 7 | public class ApiClient { 8 | private static Retrofit retrofit = null; 9 | 10 | public static Retrofit getClient(String url) { 11 | if (retrofit == null) { 12 | retrofit = new Retrofit.Builder() 13 | .baseUrl(url) 14 | .addConverterFactory(GsonConverterFactory.create()) 15 | .build(); 16 | } 17 | return retrofit; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /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/java/com/codephillip/app/busticket/BookActivity.java: -------------------------------------------------------------------------------- 1 | package com.codephillip.app.busticket; 2 | 3 | import android.os.Bundle; 4 | import android.support.v7.app.AppCompatActivity; 5 | import android.support.v7.widget.Toolbar; 6 | 7 | public class BookActivity extends AppCompatActivity { 8 | 9 | @Override 10 | protected void onCreate(Bundle savedInstanceState) { 11 | super.onCreate(savedInstanceState); 12 | setContentView(R.layout.activity_book); 13 | Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); 14 | setSupportActionBar(toolbar); 15 | getSupportActionBar().setDisplayHomeAsUpEnabled(true); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | -------------------------------------------------------------------------------- /app/src/main/res/layout/content_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /app/src/main/java/com/codephillip/app/busticket/ProfileFragment.java: -------------------------------------------------------------------------------- 1 | package com.codephillip.app.busticket; 2 | 3 | import android.os.Bundle; 4 | import android.support.v4.app.Fragment; 5 | import android.view.LayoutInflater; 6 | import android.view.View; 7 | import android.view.ViewGroup; 8 | 9 | public class ProfileFragment extends Fragment { 10 | 11 | public ProfileFragment() { 12 | } 13 | 14 | public static ProfileFragment newInstance() { 15 | return new ProfileFragment(); 16 | } 17 | 18 | @Override 19 | public View onCreateView(LayoutInflater inflater, ViewGroup container, 20 | Bundle savedInstanceState) { 21 | View rootView = inflater.inflate(R.layout.activity_profile, container, false); 22 | 23 | return rootView; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /app/src/main/java/com/codephillip/app/busticket/broadcasts/MyReceiver.java: -------------------------------------------------------------------------------- 1 | package com.codephillip.app.busticket.broadcasts; 2 | 3 | import android.content.BroadcastReceiver; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | import android.util.Log; 7 | 8 | import com.codephillip.app.busticket.MainActivity; 9 | 10 | public class MyReceiver extends BroadcastReceiver { 11 | private final String TAG = MyReceiver.class.getSimpleName(); 12 | 13 | @Override 14 | public void onReceive(Context context, Intent intent) { 15 | Log.d(TAG, "onReceive: STARTED"); 16 | // broadcast received, indicating that the SetUpService has finished 17 | Intent mainIntent = new Intent(context, MainActivity.class); 18 | mainIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 19 | context.startActivity(mainIntent); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 16dp 6 | 160dp 7 | 16dp 8 | 8dp 9 | 180dp 10 | 16dp 11 | 18sp 12 | 8dp 13 | 5dp 14 | 10dp 15 | 40dp 16 | 30dp 17 | 20dp 18 | 19 | -------------------------------------------------------------------------------- /app/src/main/java/com/codephillip/app/busticket/SplashActivity.java: -------------------------------------------------------------------------------- 1 | package com.codephillip.app.busticket; 2 | 3 | import android.content.Intent; 4 | import android.os.Bundle; 5 | import android.support.v7.app.AppCompatActivity; 6 | import android.widget.Toast; 7 | 8 | public class SplashActivity extends AppCompatActivity { 9 | 10 | @Override 11 | protected void onCreate(Bundle savedInstanceState) { 12 | super.onCreate(savedInstanceState); 13 | setContentView(R.layout.splash_screen); 14 | 15 | if (Utils.isConnectedToInternet(SplashActivity.this)) 16 | startService(new Intent(getApplicationContext(), SetUpService.class)); 17 | else 18 | Toast.makeText(this, "Please check your Internet connection", Toast.LENGTH_SHORT).show(); 19 | } 20 | 21 | @Override 22 | protected void onPause() { 23 | super.onPause(); 24 | finish(); 25 | } 26 | } -------------------------------------------------------------------------------- /app/src/main/res/menu/activity_main_drawer.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 13 | 17 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/java/com/codephillip/app/busticket/provider/locations/LocationsModel.java: -------------------------------------------------------------------------------- 1 | package com.codephillip.app.busticket.provider.locations; 2 | 3 | import com.codephillip.app.busticket.provider.base.BaseModel; 4 | 5 | import java.util.Date; 6 | 7 | import android.support.annotation.NonNull; 8 | import android.support.annotation.Nullable; 9 | 10 | /** 11 | * Data model for the {@code locations} table. 12 | */ 13 | public interface LocationsModel extends BaseModel { 14 | 15 | /** 16 | * Get the {@code name} value. 17 | * Can be {@code null}. 18 | */ 19 | @Nullable 20 | String getName(); 21 | 22 | /** 23 | * Get the {@code latitude} value. 24 | * Can be {@code null}. 25 | */ 26 | @Nullable 27 | Double getLatitude(); 28 | 29 | /** 30 | * Get the {@code longitude} value. 31 | * Can be {@code null}. 32 | */ 33 | @Nullable 34 | Double getLongitude(); 35 | } 36 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/codephillip/app/busticket/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.codephillip.app.busticket; 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.codephillip.app.busticket", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/test/java/com/codephillip/app/busticket/RegexValidatorTest.java: -------------------------------------------------------------------------------- 1 | package com.codephillip.app.busticket; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.assertEquals; 6 | 7 | 8 | import static org.junit.Assert.*; 9 | 10 | /** 11 | * Created by codephillip on 23/08/17. 12 | */ 13 | 14 | public class RegexValidatorTest { 15 | 16 | @Test 17 | public void test_validators() throws Exception { 18 | assertEquals(5, 2 + 3); 19 | assertTrue(Utils.validateData("0756878567", Utils.PHONE_PATTERN)); 20 | assertTrue(Utils.validateData("0786878567", Utils.PHONE_PATTERN)); 21 | assertTrue(Utils.validateData("0776878567", Utils.PHONE_PATTERN)); 22 | assertTrue(Utils.validateData("0706878567", Utils.PHONE_PATTERN)); 23 | assertTrue(Utils.validateData("pas0*YhuUj*#e*", Utils.PASSWORD_PATTERN)); 24 | assertTrue(Utils.validateData("1234", Utils.MM_CODE_PATTERN)); 25 | assertTrue(Utils.validateData("6775", Utils.MM_CODE_PATTERN)); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /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 /home/codephillip/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/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 15 | 16 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_book.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 13 | 14 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /app/src/main/res/layout/app_bar_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 13 | 14 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /app/src/main/res/layout/recyclerview_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 13 | 14 | 20 | 21 | 22 | 31 | 32 | -------------------------------------------------------------------------------- /app/src/main/java/com/codephillip/app/busticket/retrofit/ApiInterface.java: -------------------------------------------------------------------------------- 1 | package com.codephillip.app.busticket.retrofit; 2 | 3 | import com.codephillip.app.busticket.mymodels.Customer; 4 | import com.codephillip.app.busticket.mymodels.Customers; 5 | import com.codephillip.app.busticket.mymodels.Locations; 6 | import com.codephillip.app.busticket.mymodels.Order; 7 | import com.codephillip.app.busticket.mymodels.Orders; 8 | import com.codephillip.app.busticket.mymodels.routeobject.Routes; 9 | 10 | import retrofit2.Call; 11 | import retrofit2.http.Body; 12 | import retrofit2.http.GET; 13 | import retrofit2.http.POST; 14 | import retrofit2.http.PUT; 15 | 16 | 17 | public interface ApiInterface { 18 | 19 | @POST("/api/v1/customers") 20 | Call createCustomer(@Body Customer customer); 21 | 22 | @PUT("/api/v1/customers") 23 | Call signInCustomer(@Body Customer customer); 24 | 25 | @GET("/api/v1/routes?format=json") 26 | Call allRoutes(); 27 | 28 | @GET("/api/v1/orders?format=json") 29 | Call allOrders(); 30 | 31 | @GET("/api/v1/locations?format=json") 32 | Call allLocations(); 33 | 34 | @POST("/api/v1/orders") 35 | Call createOrder(@Body Order order); 36 | 37 | 38 | } 39 | -------------------------------------------------------------------------------- /app/src/main/java/com/codephillip/app/busticket/mymodels/Location.java: -------------------------------------------------------------------------------- 1 | 2 | package com.codephillip.app.busticket.mymodels; 3 | 4 | import com.google.gson.annotations.Expose; 5 | import com.google.gson.annotations.SerializedName; 6 | 7 | public class Location { 8 | 9 | @SerializedName("id") 10 | @Expose 11 | private Integer id; 12 | @SerializedName("name") 13 | @Expose 14 | private String name; 15 | @SerializedName("longitude") 16 | @Expose 17 | private double longitude; 18 | @SerializedName("latitude") 19 | @Expose 20 | private double latitude; 21 | 22 | public Integer getId() { 23 | return id; 24 | } 25 | 26 | public void setId(Integer id) { 27 | this.id = id; 28 | } 29 | 30 | public String getName() { 31 | return name; 32 | } 33 | 34 | public void setName(String name) { 35 | this.name = name; 36 | } 37 | 38 | public double getLongitude() { 39 | return longitude; 40 | } 41 | 42 | public void setLongitude(double longitude) { 43 | this.longitude = longitude; 44 | } 45 | 46 | public double getLatitude() { 47 | return latitude; 48 | } 49 | 50 | public void setLatitude(double latitude) { 51 | this.latitude = latitude; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /app/src/main/res/layout/splash_screen.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 11 | 12 | 17 | 18 | 24 | 25 | 26 | 27 | 28 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /app/src/main/java/com/codephillip/app/busticket/provider/base/AbstractContentValues.java: -------------------------------------------------------------------------------- 1 | package com.codephillip.app.busticket.provider.base; 2 | 3 | import android.content.Context; 4 | import android.content.ContentResolver; 5 | import android.content.ContentValues; 6 | import android.net.Uri; 7 | 8 | public abstract class AbstractContentValues { 9 | protected final ContentValues mContentValues = new ContentValues(); 10 | 11 | /** 12 | * Returns the {@code uri} argument to pass to the {@code ContentResolver} methods. 13 | */ 14 | public abstract Uri uri(); 15 | 16 | /** 17 | * Returns the {@code ContentValues} wrapped by this object. 18 | */ 19 | public ContentValues values() { 20 | return mContentValues; 21 | } 22 | 23 | /** 24 | * Inserts a row into a table using the values stored by this object. 25 | * 26 | * @param contentResolver The content resolver to use. 27 | */ 28 | public Uri insert(ContentResolver contentResolver) { 29 | return contentResolver.insert(uri(), values()); 30 | } 31 | 32 | /** 33 | * Inserts a row into a table using the values stored by this object. 34 | * 35 | * @param context The context to use. 36 | */ 37 | public Uri insert(Context context) { 38 | return context.getContentResolver().insert(uri(), values()); 39 | } 40 | } -------------------------------------------------------------------------------- /app/src/main/java/com/codephillip/app/busticket/provider/orders/OrdersModel.java: -------------------------------------------------------------------------------- 1 | package com.codephillip.app.busticket.provider.orders; 2 | 3 | import com.codephillip.app.busticket.provider.base.BaseModel; 4 | 5 | import java.util.Date; 6 | 7 | import android.support.annotation.NonNull; 8 | import android.support.annotation.Nullable; 9 | 10 | /** 11 | * Data model for the {@code orders} table. 12 | */ 13 | public interface OrdersModel extends BaseModel { 14 | 15 | /** 16 | * Get the {@code code} value. 17 | * Can be {@code null}. 18 | */ 19 | @Nullable 20 | String getCode(); 21 | 22 | /** 23 | * Get the {@code valid} value. 24 | * Can be {@code null}. 25 | */ 26 | @Nullable 27 | Boolean getValid(); 28 | 29 | /** 30 | * Get the {@code datecreated} value. 31 | * Can be {@code null}. 32 | */ 33 | @Nullable 34 | Date getDatecreated(); 35 | 36 | /** 37 | * Get the {@code date} value. 38 | * Can be {@code null}. 39 | */ 40 | @Nullable 41 | Date getDate(); 42 | 43 | /** 44 | * Get the {@code customer} value. 45 | * Can be {@code null}. 46 | */ 47 | @Nullable 48 | String getCustomer(); 49 | 50 | /** 51 | * Get the {@code route} value. 52 | * Can be {@code null}. 53 | */ 54 | @Nullable 55 | String getRoute(); 56 | } 57 | -------------------------------------------------------------------------------- /app/src/main/res/layout/nav_header_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 14 | 15 | 21 | 22 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 17 | 18 | 24 | 25 | 29 | 30 |