diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2b75303 --- /dev/null +++ b/.gitignore @@ -0,0 +1,13 @@ +*.iml +.gradle +/local.properties +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +/build +/captures +.externalNativeBuild diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..61a9130 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..15a15b2 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..9bba60d --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,21 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml new file mode 100644 index 0000000..a5f05cd --- /dev/null +++ b/.idea/jarRepositories.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..d5d35ec --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,9 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml new file mode 100644 index 0000000..7f68460 --- /dev/null +++ b/.idea/runConfigurations.xml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/.gitignore b/app/.gitignore new file mode 100644 index 0000000..796b96d --- /dev/null +++ b/app/.gitignore @@ -0,0 +1 @@ +/build diff --git a/app/build.gradle b/app/build.gradle new file mode 100644 index 0000000..ba9f74b --- /dev/null +++ b/app/build.gradle @@ -0,0 +1,38 @@ +apply plugin: 'com.android.application' + +android { + compileSdkVersion 30 + buildToolsVersion "30.0.2" + defaultConfig { + applicationId "com.example.trac" + minSdkVersion 16 + targetSdkVersion 30 + versionCode 1 + versionName "1.0" + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar']) + implementation 'androidx.appcompat:appcompat:1.2.0' + implementation 'androidx.constraintlayout:constraintlayout:2.0.4' + implementation 'androidx.legacy:legacy-support-v4:1.0.0' + implementation 'com.google.android.material:material:1.2.1' + + implementation 'com.daimajia.easing:library:2.0@aar' + implementation 'com.daimajia.androidanimations:library:2.3@aar' + implementation 'com.google.android.gms:play-services-maps:17.0.0' + implementation 'me.dm7.barcodescanner:zxing:1.9.13' + implementation 'com.karumi:dexter:6.2.2' + + testImplementation 'junit:junit:4.12' + androidTestImplementation 'androidx.test:runner:1.3.0' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' +} diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro new file mode 100644 index 0000000..f1b4245 --- /dev/null +++ b/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile diff --git a/app/src/androidTest/java/com/example/trac/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/example/trac/ExampleInstrumentedTest.java new file mode 100644 index 0000000..efaeda0 --- /dev/null +++ b/app/src/androidTest/java/com/example/trac/ExampleInstrumentedTest.java @@ -0,0 +1,27 @@ +package com.example.trac; + +import android.content.Context; + +import androidx.test.InstrumentationRegistry; +import androidx.test.runner.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getTargetContext(); + + assertEquals("com.example.trac", appContext.getPackageName()); + } +} diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..2310e5e --- /dev/null +++ b/app/src/main/AndroidManifest.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/java/com/example/trac/Login.java b/app/src/main/java/com/example/trac/Login.java new file mode 100644 index 0000000..20d1caf --- /dev/null +++ b/app/src/main/java/com/example/trac/Login.java @@ -0,0 +1,85 @@ +package com.example.trac; + +import androidx.appcompat.app.AppCompatActivity; + +import android.content.Intent; +import android.net.Uri; +import android.os.Bundle; +import android.view.View; +import android.widget.Button; +import android.widget.EditText; +import android.widget.ImageView; +import android.widget.TextView; + +public class Login extends AppCompatActivity { + EditText editText, editText3, editText4; + Button button; + ImageView img_fb, img_g; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_login); + + img_fb = findViewById(R.id.imageViewfb); + img_g = findViewById(R.id.imageViewg); + button = findViewById(R.id.button); + editText4 = findViewById(R.id.editText4); + editText = findViewById(R.id.editText); + editText3 = findViewById(R.id.editText3); + + img_fb.setOnClickListener(new View.OnClickListener() { + public void onClick(View v) { + FbIsClicked(); + } + }); + + img_g.setOnClickListener(new View.OnClickListener() { + public void onClick(View v) { + GoogleIsClicked(); + } + }); + + button.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + TheButtonIsClicked(); + } + }); + } + + public void FbIsClicked(){ + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.addCategory(Intent.CATEGORY_BROWSABLE); + intent.setData(Uri.parse("https://www.facebook.com/")); + startActivity(intent); + } + + public void GoogleIsClicked(){ + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.addCategory(Intent.CATEGORY_BROWSABLE); + intent.setData(Uri.parse("https://www.google.com/")); + startActivity(intent); + } + + public void TheButtonIsClicked(){ + + if(editText4.getText().length()==0) { + editText4.setError("Error"); + } + else if(editText3.getText().length()==0) { + editText3.setError("Error"); + } + else if(editText.getText().length()==0) { + editText.setError("Error"); + } + else { + //String str = editText4.getText().toString(); + Intent intent = new Intent(this, MainPage.class); + //intent.putExtra("username", str); + startActivity(intent); + } + } +} diff --git a/app/src/main/java/com/example/trac/MainActivity.java b/app/src/main/java/com/example/trac/MainActivity.java new file mode 100644 index 0000000..87c0df6 --- /dev/null +++ b/app/src/main/java/com/example/trac/MainActivity.java @@ -0,0 +1,48 @@ +package com.example.trac; + +import androidx.appcompat.app.AppCompatActivity; + +import android.content.Intent; +import android.os.Bundle; +import android.view.View; +import android.view.animation.AnimationUtils; +import android.widget.ImageView; + +import com.daimajia.androidanimations.library.Techniques; +import com.daimajia.androidanimations.library.YoYo; + +public class MainActivity extends AppCompatActivity { + + ImageView img; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + + + img =findViewById(R.id.imageView); + YoYo.with(Techniques.FlipInX) + .duration(800) + .repeat(1) + .playOn(img); + + + YoYo.with(Techniques.BounceInDown) + .duration(700) + .repeat(1) + .playOn(img); + + img.setOnClickListener(new View.OnClickListener() { + public void onClick(View v) { + openNewActivity(); + } + }); + + } + + public void openNewActivity(){ + Intent intent = new Intent(this, Login.class); + startActivity(intent); + } +} diff --git a/app/src/main/java/com/example/trac/MainPage.java b/app/src/main/java/com/example/trac/MainPage.java new file mode 100644 index 0000000..f84aa40 --- /dev/null +++ b/app/src/main/java/com/example/trac/MainPage.java @@ -0,0 +1,176 @@ +package com.example.trac; + +import android.content.Intent; +import android.os.Bundle; + +import com.google.android.gms.maps.CameraUpdateFactory; +import com.google.android.gms.maps.GoogleMap; +import com.google.android.gms.maps.MapView; +import com.google.android.gms.maps.OnMapReadyCallback; +import com.google.android.gms.maps.SupportMapFragment; +import com.google.android.gms.maps.model.LatLng; +import com.google.android.gms.maps.model.MarkerOptions; +import com.google.android.material.floatingactionbutton.FloatingActionButton; +import com.google.android.material.snackbar.Snackbar; + +import android.view.View; + +import androidx.core.view.GravityCompat; +import androidx.appcompat.app.ActionBarDrawerToggle; + +import android.view.MenuItem; + +import com.google.android.material.navigation.NavigationView; + +import androidx.drawerlayout.widget.DrawerLayout; + +import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; + +import android.view.Menu; +import android.widget.Button; +import android.widget.TextView; +import android.widget.Toast; + +public class MainPage extends AppCompatActivity + implements NavigationView.OnNavigationItemSelectedListener, OnMapReadyCallback { + + //String name; + //TextView display_name; + private MapView mMapView; + public static TextView scantext; + Button scanbtn; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main_page); + Toolbar toolbar = findViewById(R.id.toolbar); + setSupportActionBar(toolbar); + + scantext = findViewById(R.id.scantext); + scanbtn = findViewById(R.id.scanbtn); + scanbtn.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + startActivity(new Intent(getApplicationContext(), scannerView.class)); + } + }); + + + //mMapView = findViewById(R.id.mapView); + //mMapView.onCreate(savedInstanceState); + + SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager() + .findFragmentById(R.id.map); + mapFragment.getMapAsync(this); + + + /* mMapView.getMapAsync(new OnMapReadyCallback() { + @Override + public void onMapReady(GoogleMap googleMap) { + + LatLng VimanNagar = new LatLng(18.567995, 73.912980); + + googleMap.addMarker(new MarkerOptions() + .position(VimanNagar) + .title("Viman Nagar")); + + googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(VimanNagar, 10f)); + } + }); */ + + /* FloatingActionButton fab = findViewById(R.id.fab); + fab.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG) + .setAction("Action", null).show(); + } + }); */ + + //display_name = findViewById(R.id.display_name); + //display_name.setText("Welcome, "+getIntent().getExtras().getString("username")); + + DrawerLayout drawer = findViewById(R.id.drawer_layout); + NavigationView navigationView = findViewById(R.id.nav_view); + ActionBarDrawerToggle toggle = new ActionBarDrawerToggle( + this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close); + drawer.addDrawerListener(toggle); + toggle.syncState(); + navigationView.setNavigationItemSelectedListener(this); + + //display_name = findViewById(R.id.display_name); + // textView = findViewById(R.id.textView); + + //name = getIntent().getStringExtra("username"); + //display_name.setText(name); + } + + @Override + public void onBackPressed() { + DrawerLayout drawer = findViewById(R.id.drawer_layout); + if (drawer.isDrawerOpen(GravityCompat.START)) { + drawer.closeDrawer(GravityCompat.START); + } else { + super.onBackPressed(); + } + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + // Inflate the menu; this adds items to the action bar if it is present. + getMenuInflater().inflate(R.menu.main_page, menu); + return true; + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + // Handle action bar item clicks here. The action bar will + // automatically handle clicks on the Home/Up button, so long + // as you specify a parent activity in AndroidManifest.xml. + int id = item.getItemId(); + + //noinspection SimplifiableIfStatement + if (id == R.id.action_settings) { + return true; + } + + return super.onOptionsItemSelected(item); + } + + @SuppressWarnings("StatementWithEmptyBody") + @Override + public boolean onNavigationItemSelected(MenuItem item) { + // Handle navigation view item clicks here. + int id = item.getItemId(); + + if (id == R.id.nav_home) { + Toast.makeText(this, "Membership", Toast.LENGTH_LONG).show(); + } else if (id == R.id.nav_gallery) { + Toast.makeText(this, "Promos", Toast.LENGTH_LONG).show(); + } else if (id == R.id.nav_slideshow) { + Toast.makeText(this, "Get Free Ride", Toast.LENGTH_LONG).show(); + } else if (id == R.id.nav_tools) { + Toast.makeText(this, "Settings", Toast.LENGTH_LONG).show(); + } + + DrawerLayout drawer = findViewById(R.id.drawer_layout); + drawer.closeDrawer(GravityCompat.START); + return true; + } + + + @Override + public void onMapReady(GoogleMap googleMap) { + LatLng VimanNagar = new LatLng(18.567995, 73.912980); + + googleMap.addMarker(new MarkerOptions() + .position(VimanNagar) + .title("Viman Nagar")); + + googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(VimanNagar, 10f)); + } +} + + diff --git a/app/src/main/java/com/example/trac/scannerView.java b/app/src/main/java/com/example/trac/scannerView.java new file mode 100644 index 0000000..330a200 --- /dev/null +++ b/app/src/main/java/com/example/trac/scannerView.java @@ -0,0 +1,66 @@ +package com.example.trac; + +import androidx.appcompat.app.AppCompatActivity; + +import android.Manifest; +import android.os.Bundle; + +import com.google.zxing.Result; +import com.karumi.dexter.Dexter; +import com.karumi.dexter.PermissionToken; +import com.karumi.dexter.listener.PermissionDeniedResponse; +import com.karumi.dexter.listener.PermissionGrantedResponse; +import com.karumi.dexter.listener.PermissionRequest; +import com.karumi.dexter.listener.single.PermissionListener; + +import me.dm7.barcodescanner.zxing.ZXingScannerView; + +public class scannerView extends AppCompatActivity implements ZXingScannerView.ResultHandler { + + ZXingScannerView scannerView; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + scannerView = new ZXingScannerView(this); + setContentView(scannerView); + + Dexter.withContext(getApplicationContext()) + .withPermission(Manifest.permission.CAMERA) + .withListener(new PermissionListener() { + @Override + public void onPermissionGranted(PermissionGrantedResponse permissionGrantedResponse) { + scannerView.startCamera(); + } + + @Override + public void onPermissionDenied(PermissionDeniedResponse permissionDeniedResponse) { + + } + + @Override + public void onPermissionRationaleShouldBeShown(PermissionRequest permissionRequest, PermissionToken permissionToken) { + permissionToken.continuePermissionRequest(); + } + }).check(); + } + + @Override + public void handleResult(Result rawResult) { + MainPage.scantext.setText(rawResult.getText()); + onBackPressed(); + } + + @Override + protected void onPause() { + super.onPause(); + scannerView.stopCamera(); + } + + @Override + protected void onResume() { + super.onResume(); + scannerView.setResultHandler(this); + scannerView.startCamera(); + } +} \ No newline at end of file diff --git a/app/src/main/res/drawable-v21/ic_menu_gallery.xml b/app/src/main/res/drawable-v21/ic_menu_gallery.xml new file mode 100644 index 0000000..03c7709 --- /dev/null +++ b/app/src/main/res/drawable-v21/ic_menu_gallery.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable-v21/ic_menu_manage.xml b/app/src/main/res/drawable-v21/ic_menu_manage.xml new file mode 100644 index 0000000..aeb047d --- /dev/null +++ b/app/src/main/res/drawable-v21/ic_menu_manage.xml @@ -0,0 +1,9 @@ + + + \ No newline at end of file diff --git a/app/src/main/res/drawable-v21/ic_menu_send.xml b/app/src/main/res/drawable-v21/ic_menu_send.xml new file mode 100644 index 0000000..fdf1c90 --- /dev/null +++ b/app/src/main/res/drawable-v21/ic_menu_send.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..1f6bb29 --- /dev/null +++ b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + diff --git a/app/src/main/res/drawable-v24/logo.png b/app/src/main/res/drawable-v24/logo.png new file mode 100644 index 0000000..75cb179 Binary files /dev/null and b/app/src/main/res/drawable-v24/logo.png differ diff --git a/app/src/main/res/drawable/buttons.xml b/app/src/main/res/drawable/buttons.xml new file mode 100644 index 0000000..1b483b0 --- /dev/null +++ b/app/src/main/res/drawable/buttons.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/email.xml b/app/src/main/res/drawable/email.xml new file mode 100644 index 0000000..79199e3 --- /dev/null +++ b/app/src/main/res/drawable/email.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable/fb.png b/app/src/main/res/drawable/fb.png new file mode 100644 index 0000000..e5b81eb Binary files /dev/null and b/app/src/main/res/drawable/fb.png differ diff --git a/app/src/main/res/drawable/google.png b/app/src/main/res/drawable/google.png new file mode 100644 index 0000000..87cbb0a Binary files /dev/null and b/app/src/main/res/drawable/google.png differ diff --git a/app/src/main/res/drawable/headline.xml b/app/src/main/res/drawable/headline.xml new file mode 100644 index 0000000..c4ab4de --- /dev/null +++ b/app/src/main/res/drawable/headline.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..0d025f9 --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_person_black_24dp.xml b/app/src/main/res/drawable/ic_person_black_24dp.xml new file mode 100644 index 0000000..d7366bd --- /dev/null +++ b/app/src/main/res/drawable/ic_person_black_24dp.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable/location.xml b/app/src/main/res/drawable/location.xml new file mode 100644 index 0000000..e6dfeb4 --- /dev/null +++ b/app/src/main/res/drawable/location.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/membership.xml b/app/src/main/res/drawable/membership.xml new file mode 100644 index 0000000..9739032 --- /dev/null +++ b/app/src/main/res/drawable/membership.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable/promo.xml b/app/src/main/res/drawable/promo.xml new file mode 100644 index 0000000..365f6ff --- /dev/null +++ b/app/src/main/res/drawable/promo.xml @@ -0,0 +1,6 @@ + + + + diff --git a/app/src/main/res/drawable/ride.xml b/app/src/main/res/drawable/ride.xml new file mode 100644 index 0000000..76f42fc --- /dev/null +++ b/app/src/main/res/drawable/ride.xml @@ -0,0 +1,6 @@ + + + + diff --git a/app/src/main/res/drawable/setting.xml b/app/src/main/res/drawable/setting.xml new file mode 100644 index 0000000..b240b83 --- /dev/null +++ b/app/src/main/res/drawable/setting.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable/side_nav_bar.xml b/app/src/main/res/drawable/side_nav_bar.xml new file mode 100644 index 0000000..6d81870 --- /dev/null +++ b/app/src/main/res/drawable/side_nav_bar.xml @@ -0,0 +1,9 @@ + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/wallet.xml b/app/src/main/res/drawable/wallet.xml new file mode 100644 index 0000000..d90de7c --- /dev/null +++ b/app/src/main/res/drawable/wallet.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/layout/activity_login.xml b/app/src/main/res/layout/activity_login.xml new file mode 100644 index 0000000..973c910 --- /dev/null +++ b/app/src/main/res/layout/activity_login.xml @@ -0,0 +1,185 @@ + + + + + + + + + + + + + + + + + + +