importing code

First import of all android files into repo
This commit is contained in:
Arjun Patel
2017-07-27 14:15:43 -07:00
parent 6cec05f6a2
commit bb24887a9e
65 changed files with 2095 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
.externalNativeBuild
+22
View File
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<resourceExtensions />
<wildcardResourcePatterns>
<entry name="!?*.java" />
<entry name="!?*.form" />
<entry name="!?*.class" />
<entry name="!?*.groovy" />
<entry name="!?*.scala" />
<entry name="!?*.flex" />
<entry name="!?*.kt" />
<entry name="!?*.clj" />
<entry name="!?*.aj" />
</wildcardResourcePatterns>
<annotationProcessing>
<profile default="true" name="Default" enabled="false">
<processorPath useClasspath="true" />
</profile>
</annotationProcessing>
</component>
</project>
+3
View File
@@ -0,0 +1,3 @@
<component name="CopyrightManager">
<settings default="" />
</component>
+18
View File
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
<option name="resolveModulePerSourceSet" value="false" />
</GradleProjectSettings>
</option>
</component>
</project>
+46
View File
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EntryPointsManager">
<entry_points version="2.0" />
</component>
<component name="NullableNotNullManager">
<option name="myDefaultNullable" value="android.support.annotation.Nullable" />
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
<option name="myNullables">
<value>
<list size="4">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
</list>
</value>
</option>
<option name="myNotNulls">
<value>
<list size="4">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
</list>
</value>
</option>
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
<OptionsSetting value="true" id="Add" />
<OptionsSetting value="true" id="Remove" />
<OptionsSetting value="true" id="Checkout" />
<OptionsSetting value="true" id="Update" />
<OptionsSetting value="true" id="Status" />
<OptionsSetting value="true" id="Edit" />
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
</project>
+9
View File
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/MyReceipts.iml" filepath="$PROJECT_DIR$/MyReceipts.iml" />
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
</modules>
</component>
</project>
+12
View File
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
</set>
</option>
</component>
</project>
+1
View File
@@ -0,0 +1 @@
/build
+46
View File
@@ -0,0 +1,46 @@
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "com.example.ram2.myreceipts"
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:support-vector-drawable:25.3.1'
compile 'com.firebaseui:firebase-ui-storage:0.6.0'
compile 'com.android.support:multidex:1.0.1'
compile 'com.google.firebase:firebase-storage:10.2.1'
compile 'com.google.firebase:firebase-auth:10.2.1'
compile 'com.google.android.gms:play-services-auth:10.2.1'
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.gms:play-services-vision:10.2.1'
}
apply plugin: 'com.google.gms.google-services'
+55
View File
@@ -0,0 +1,55 @@
{
"project_info": {
"project_number": "337559407579",
"firebase_url": "https://neatreceipts-5bccc.firebaseio.com",
"project_id": "neatreceipts-5bccc",
"storage_bucket": "neatreceipts-5bccc.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:337559407579:android:be54a440b659d36d",
"android_client_info": {
"package_name": "com.example.ram2.myreceipts"
}
},
"oauth_client": [
{
"client_id": "337559407579-463ut2lbftvnpki1gbt78rp6phihse1b.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.example.ram2.myreceipts",
"certificate_hash": "be5d0120fb65aecf99235c500c02a3ca9ee9f87b"
}
},
{
"client_id": "337559407579-gdvrcnq62mh0lfkefm16fq5dqa2gpj1n.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyAj7IkwjUgbC2tOoq7SyG4qyhSBsI52RHM"
}
],
"services": {
"analytics_service": {
"status": 1
},
"appinvite_service": {
"status": 2,
"other_platform_oauth_client": [
{
"client_id": "337559407579-gdvrcnq62mh0lfkefm16fq5dqa2gpj1n.apps.googleusercontent.com",
"client_type": 3
}
]
},
"ads_service": {
"status": 2
}
}
}
],
"configuration_version": "1"
}
+25
View File
@@ -0,0 +1,25 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in C:\Users\RAM2\AppData\Local\Android\Sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# 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
@@ -0,0 +1,26 @@
package com.example.ram2.myreceipts;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumentation test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.example.ram2.myreceipts", appContext.getPackageName());
}
}
@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.ram2.myreceipts">
<uses-permission android:name="android.permission.CAMERA">
</uses-permission>
<application
android:allowBackup="true"
android:icon="@drawable/logo"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:name="android.support.multidex.MultiDexApplication">
<activity
android:name=".WelcomePage"
android:configChanges="orientation|keyboardHidden|screenSize"
android:label="@string/app_name"
android:theme="@style/FullscreenTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".homeJava"
android:launchMode= "singleInstance">
</activity>
<activity
android:name=".drawerJava"
android:launchMode= "singleInstance">
</activity>
<activity
android:name=".notifJava"
android:launchMode= "singleInstance">
</activity>
<activity
android:name=".Pop"
android:launchMode= "singleInstance">
</activity>
<meta-data android:name="com.google.android.gms.vision.DEPENDENCIES"
android:value="ocr">
</meta-data>
</application>
</manifest>
@@ -0,0 +1,12 @@
package com.example.ram2.myreceipts;
import android.support.v7.app.AppCompatActivity;
/**
* Created by Dhananjaya on 5/31/2017.
*/
public class GoogleSign extends AppCompatActivity {
} // end class
@@ -0,0 +1,67 @@
package com.example.ram2.myreceipts;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.util.DisplayMetrics;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
/**
* Created by Dhananjaya on 5/22/2017.
*/
public class Pop extends Activity {
EditText inputCode;
Button retreiveR;
String inputString = "";
Toast noInput;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_popup);
inputCode = (EditText) findViewById(R.id.inputCode);
retreiveR = (Button) findViewById(R.id.retreiveR);
DisplayMetrics dm = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(dm);
int width = dm.widthPixels;
int height = dm.heightPixels;
getWindow().setLayout((int)(width*.7), (int)(height*.6));
noInput = Toast.makeText(getApplicationContext(), "Please input a code", Toast.LENGTH_LONG);
} // end onCreate
@Override
protected void onStart() {
super.onStart();
retreiveR.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
inputString = inputCode.getText().toString();
if ( inputString.equals("") )
noInput.show();
else {
Intent intent = new Intent(Pop.this, homeJava.class);
intent.putExtra("code", inputString);
setResult(RESULT_OK, intent);
finish();
}// end else
}
}); // end listener
} // end onStart
}
@@ -0,0 +1,90 @@
package com.example.ram2.myreceipts;
/**
* Created by RAM2 on 5/17/2017.
*/
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.ServerSocket;
import java.net.Socket;
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.os.Environment;
import android.os.StrictMode;
import android.util.Log;
public class Server extends Activity {
private static ServerSocket serverSocket;
private static Socket clientSocket;
private static InputStream inputStream;
private static FileOutputStream fileOutputStream;
private static BufferedOutputStream bufferedOutputStream;
private static int bufferSize = 3000; // bufferSize temporary hardcoded
private static int bytesRead;
private static int totalbytesRead = 0;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);
try {
init();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
private void init() throws IOException {
// TODO Auto-generated method stub
serverSocket = new ServerSocket(5000); // Server socket
System.out.println("Server started. Listening to the port 5000");
clientSocket = serverSocket.accept();
byte[] data = new byte[bufferSize]; // create byte array to buffer the
// file
inputStream = clientSocket.getInputStream();
String filePath = "C:\\Users\\RAM2\\AndroidStudioProjects\\MyReceipts\\app\\src\\main\\res\\drawable\\bg_home.jpg" ;
fileOutputStream = new FileOutputStream(filePath);
// fileOutputStream = new FileOutputStream(file);
bufferedOutputStream = new BufferedOutputStream(fileOutputStream);
System.out.println("Receiving...");
// following lines read the input slide file byte by byte
bytesRead = inputStream.read(data,0,data.length);
totalbytesRead = bytesRead;
do {
bytesRead =
inputStream.read(data, totalbytesRead, (data.length-totalbytesRead));
if(bytesRead >= 0) totalbytesRead += bytesRead;
} while(bytesRead > -1);
bufferedOutputStream.write(data, 0 , totalbytesRead);
bufferedOutputStream.flush();
long end = System.currentTimeMillis();
System.out.println(end);
bufferedOutputStream.close();
System.out.println("Sever received the file");
}
}
@@ -0,0 +1,144 @@
package com.example.ram2.myreceipts;
import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Toast;
import com.google.android.gms.auth.api.Auth;
import com.google.android.gms.auth.api.signin.GoogleSignInAccount;
import com.google.android.gms.auth.api.signin.GoogleSignInOptions;
import com.google.android.gms.auth.api.signin.GoogleSignInResult;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.SignInButton;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.common.api.ResultCallback;
import com.google.android.gms.common.api.Status;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.AuthCredential;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import com.google.firebase.auth.GoogleAuthProvider;
/**
* An example full-screen activity that shows and hides the system UI (i.e.
* status bar and navigation/system bar) with user interaction.
*/
public class WelcomePage extends AppCompatActivity {
private SignInButton mGoogleBtn;
private static final int RC_SIGN_IN = 1;
private static final String TAG = "Main_Activity";
private GoogleApiClient mGoogleApiClient;
private FirebaseAuth mAuth;
private FirebaseAuth.AuthStateListener mAuthListener;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_welcome_page);
mGoogleBtn = (SignInButton) findViewById(R.id.sign_in_button);
mAuth = FirebaseAuth.getInstance();
mAuthListener = new FirebaseAuth.AuthStateListener() {
@Override
public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {
if(firebaseAuth.getCurrentUser() != null) {
startActivity( new Intent(WelcomePage.this, homeJava.class) );
}
}
};
// Configure Google Sign In
GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
.requestIdToken(getString(R.string.default_web_client_id))
.requestEmail()
.build();
mGoogleApiClient = new GoogleApiClient.Builder(getApplicationContext())
.enableAutoManage(this, new GoogleApiClient.OnConnectionFailedListener() {
@Override
public void onConnectionFailed(@NonNull ConnectionResult connectionResult) {
Toast.makeText(WelcomePage.this, "Authorization Denied", Toast.LENGTH_LONG).show();
}
})
.addApi(Auth.GOOGLE_SIGN_IN_API, gso)
.build();
mGoogleBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
signIn();
}
});
} // end onCreate
@Override
protected void onStart() {
super.onStart();
mAuth.addAuthStateListener(mAuthListener);
}
private void signIn() {
Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(mGoogleApiClient);
startActivityForResult(signInIntent, RC_SIGN_IN);
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
// Result returned from launching the Intent from GoogleSignInApi.getSignInIntent(...);
if (requestCode == RC_SIGN_IN) {
GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data);
if (result.isSuccess()) {
// Google Sign In was successful, authenticate with Firebase
GoogleSignInAccount account = result.getSignInAccount();
firebaseAuthWithGoogle(account);
} else {
// Google Sign In failed, update UI appropriately
// ...
}
}
} // end onActivityResult
private void firebaseAuthWithGoogle(GoogleSignInAccount acct) {
AuthCredential credential = GoogleAuthProvider.getCredential(acct.getIdToken(), null);
mAuth.signInWithCredential(credential)
.addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if (task.isSuccessful()) {
// Sign in success, update UI with the signed-in user's information
Log.d(TAG, "signInWithCredential:success");
FirebaseUser user = mAuth.getCurrentUser();
} else {
// If sign in fails, display a message to the user.
Log.w(TAG, "signInWithCredential:failure", task.getException());
Toast.makeText(WelcomePage.this, "Authentication failed.",
Toast.LENGTH_SHORT).show();
}
// ...
}
});
} // end method
}// end class
@@ -0,0 +1,146 @@
package com.example.ram2.myreceipts;
import android.net.Uri;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
/**
* Created by RAM2 on 5/17/2017.
*/
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.KeyEvent;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import com.bumptech.glide.Glide;
import com.firebase.ui.storage.images.FirebaseImageLoader;
import com.google.android.gms.auth.api.Auth;
import com.google.android.gms.auth.api.signin.GoogleSignInOptions;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.common.api.ResultCallback;
import com.google.android.gms.common.api.Status;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import java.io.File;
import java.net.URI;
public class drawerJava extends AppCompatActivity {
private FirebaseAuth mAuth;
private FirebaseAuth.AuthStateListener mAuthListener;
private GoogleApiClient mGoogleApiClient;
TextView currentUserName;
ImageView profPic;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_drawer);
currentUserName = (TextView) findViewById(R.id.currentUserName);
profPic = (ImageView) findViewById(R.id.profPic);
GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
.requestIdToken(getString(R.string.default_web_client_id))
.requestEmail()
.build();
mGoogleApiClient = new GoogleApiClient.Builder(this)
.enableAutoManage(this /* FragmentActivity */,new GoogleApiClient.OnConnectionFailedListener() {
@Override
public void onConnectionFailed(@NonNull ConnectionResult connectionResult) {
Toast.makeText(drawerJava.this, "Authorization Denied", Toast.LENGTH_LONG).show();
}
})
.addApi(Auth.GOOGLE_SIGN_IN_API, gso)
.build();
mAuth = FirebaseAuth.getInstance();
mAuthListener = new FirebaseAuth.AuthStateListener() {
@Override
public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {
if(firebaseAuth.getCurrentUser() == null) {
Intent ontoWelcome = new Intent(drawerJava.this, WelcomePage.class);
startActivity(ontoWelcome);
}
}
};
Button logOut = (Button) findViewById(R.id.logOut);
logOut.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
// completely logout user
mAuth.signOut();
Auth.GoogleSignInApi.signOut(mGoogleApiClient).setResultCallback(
new ResultCallback<Status>() {
@Override
public void onResult(@NonNull Status status) {
}
});
}
});
Button exit = (Button) findViewById(R.id.exit);
exit.setOnClickListener( new View.OnClickListener() {
@Override
public void onClick ( View view ) {
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_HOME);
startActivity(intent);
}
});
Button back = (Button) findViewById(R.id.back);
back.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent back = new Intent(drawerJava.this, homeJava.class);
startActivity(back);
overridePendingTransition(R.anim.slide_in_right, R.anim.exit_left);
}
});
} // end onCreate
@Override
protected void onStart() {
super.onStart();
mAuth.addAuthStateListener(mAuthListener);
FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();
String name = user.getDisplayName();
currentUserName.setText(name);
Uri photoUrl = user.getPhotoUrl();
Glide.with(drawerJava.this)
.load(photoUrl)
.into(profPic);
} // end onStart
@Override
public void onBackPressed() {
Intent back = new Intent(drawerJava.this, homeJava.class);
startActivity(back);
overridePendingTransition(R.anim.slide_in_right, R.anim.exit_left);
return;
}
}// end class
@@ -0,0 +1,246 @@
package com.example.ram2.myreceipts;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.support.v4.app.ActivityCompat;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import com.bumptech.glide.Glide;
import com.firebase.ui.storage.images.FirebaseImageLoader;
import com.google.android.gms.vision.CameraSource;
import com.google.android.gms.vision.text.TextRecognizer;
import com.google.firebase.storage.FirebaseStorage;
import com.google.firebase.storage.StorageReference;
import java.io.IOException;
/**
* Created by RAM2 on 5/11/2017.
*/
public class homeJava extends AppCompatActivity {
ImageView codePopup;
ImageView notificon;
ImageView dashicon;
ImageView homeicon;
StorageReference mStorage;
StorageReference filePath;
ImageView currentReceipt;
ImageView entireReceipt;
String inputString;
Toast notValidCode;
private int REQUEST_CODE = 1;
String[] arr = new String[3];
int whichModuletoDisplay;
TextView begin;
/*TextView textView;
SurfaceView cameraView;
CameraSource cameraSource;
final int RequestCameraPermissionID = 1001;
StringBuilder stringBuilder;
TextRecognizer textRecognizer;
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
switch (requestCode) {
case RequestCameraPermissionID: {
if (grantResults[0] == PackageManager.PERMISSION_GRANTED) {
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) {
return;
}
try {
cameraSource.start(cameraView.getHolder());
} catch (IOException e) {
e.printStackTrace();
}
}
}
break;
}
} // end onRequestPermissionsResult */
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home);
codePopup = (ImageView) findViewById(R.id.enterCode);
notificon = (ImageView) findViewById(R.id.notificon);
dashicon = (ImageView) findViewById(R.id.dashicon);
homeicon = (ImageView) findViewById(R.id.homeicon);
begin = (TextView) findViewById(R.id.begin);
entireReceipt = (ImageView) findViewById(R.id.entireReceipt);
notValidCode = Toast.makeText(getApplicationContext(), "Not a Valid Code", Toast.LENGTH_LONG);
arr[0] = "F123";
arr[1] = "F456";
arr[2] = "F789";
whichModuletoDisplay = 1;
/*cameraView = (SurfaceView) findViewById(R.id.surfaceView);
textView = (TextView) findViewById(R.id.txtView);
cameraView.setVisibility(View.VISIBLE);
textRecognizer = new TextRecognizer.Builder(getApplicationContext()).build();
if (!textRecognizer.isOperational()) {
Log.w("MainActivity", "Detector Dependencies are not yet available.");
} else {
cameraSource = new CameraSource.Builder(getApplicationContext(), textRecognizer)
.setFacing(CameraSource.CAMERA_FACING_BACK)
.setRequestedPreviewSize(1280, 1024)
.setRequestedFps(2.0f)
.setAutoFocusEnabled(true)
.build();
}
cameraView.getHolder().addCallback(new SurfaceHolder.Callback() {
@Override
public void surfaceCreated(SurfaceHolder surfaceHolder) {
try {
if (ActivityCompat.checkSelfPermission(getApplicationContext(), Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(homeJava.this,
new String[]{Manifest.permission.CAMERA},
RequestCameraPermissionID);
return;
}
cameraSource.start(cameraView.getHolder());
} catch (IOException e) {
e.printStackTrace();
}
}
@Override
public void surfaceChanged(SurfaceHolder surfaceHolder, int i, int i1, int i2) {
}
@Override
public void surfaceDestroyed(SurfaceHolder surfaceHolder) {
cameraSource.stop();
}
}); */
}// end onCreate method
@Override
protected void onStart() {
super.onStart();
mStorage = FirebaseStorage.getInstance().getReference();
dashicon.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent ontoDrawer = new Intent(homeJava.this, drawerJava.class);
startActivity(ontoDrawer);
overridePendingTransition(R.anim.slide_in_left, R.anim.exit_right);
}
});
codePopup.setOnClickListener( new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent toPopup = new Intent(homeJava.this, Pop.class);
startActivityForResult(toPopup, REQUEST_CODE);
}
}); // end clickListener for refresh button
homeicon.setOnClickListener( new View.OnClickListener() {
@Override
public void onClick(View view) {
entireReceipt.setVisibility(View.INVISIBLE);
codePopup.setVisibility(View.VISIBLE);
}
}); // end clickListener for refresh button
}// end onStart
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if ( requestCode == REQUEST_CODE ) {
if (resultCode == RESULT_OK) {
inputString = data.getStringExtra("code");
int checkIfValid = 0;
for ( int i = 0; i < arr.length; i++ ){
if ( inputString.equalsIgnoreCase(arr[i]) ) {
checkIfValid++;
final String whichReceipt = Integer.toString(i+1);
int currR = getResources().getIdentifier("receipt" + whichModuletoDisplay, "id", getPackageName());
currentReceipt = (ImageView) findViewById(currR);
whichModuletoDisplay++;
//file path for overview image
filePath = mStorage.child("receipt" + whichReceipt + "/" + "bg_home11.jpg");
Glide.with(homeJava.this)
.using(new FirebaseImageLoader())
.load(filePath)
.into(currentReceipt);
currentReceipt.setScaleType(ImageView.ScaleType.FIT_XY);
begin.setVisibility(View.INVISIBLE);
//entire receipt image
currentReceipt.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
filePath = mStorage.child("receipt"+ whichReceipt +"/entirer1.jpg");
entireReceipt.setVisibility(View.VISIBLE);
entireReceipt.setScaleType(ImageView.ScaleType.FIT_XY);
Glide.with(homeJava.this)
.using(new FirebaseImageLoader())
.load(filePath)
.into(entireReceipt);
codePopup.setVisibility(View.INVISIBLE);
}
}); // end Listener for entireReceipt
} // end if
} // end for
if ( checkIfValid == 0 )
notValidCode.show();
}// end if
}// end if
}// end method
} // end class
@@ -0,0 +1,58 @@
package com.example.ram2.myreceipts;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import org.w3c.dom.Text;
/**
* Created by RAM2 on 5/11/2017.
*/
public class notifJava extends AppCompatActivity {
TextView updates;
LinearLayout imageSection;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_notifications);
updates = (TextView) findViewById(R.id.notifModule);
imageSection = (LinearLayout) findViewById(R.id.imageSection);
ImageView homeicon = (ImageView) findViewById(R.id.homeicon);
homeicon.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent ontoHome = new Intent(notifJava.this, homeJava.class);
startActivity(ontoHome);
overridePendingTransition(R.anim.slide_in_left, R.anim.exit_right);
}
});
ImageView dashicon = (ImageView) findViewById(R.id.dashicon);
dashicon.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick ( View view ) {
Intent ontoDrawer = new Intent(notifJava.this, drawerJava.class);
startActivity(ontoDrawer);
overridePendingTransition(R.anim.slide_in_left, R.anim.exit_right);
}
});
}// end oncreate
public void setTxtView () {
updates = (TextView) findViewById(R.id.notifModule);
String updateMsg = updates.getText().toString() + "/n" + "A new receipt has been added by:";
updates.setText(updateMsg);
} // end setTxtView
}// end class
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="300"
android:fromXDelta="0%"
android:interpolator="@android:anim/decelerate_interpolator"
android:toXDelta="-100%" />
</set>
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<set
xmlns:android="http://schemas.android.com/apk/res/android" >
<translate xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="300"
android:fromXDelta="0%"
android:interpolator="@android:anim/decelerate_interpolator"
android:toXDelta="100%" />
</set>
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<set
xmlns:android="http://schemas.android.com/apk/res/android" >
<translate xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="300"
android:fromXDelta="-100%"
android:toXDelta="0%"
android:interpolator="@android:anim/decelerate_interpolator"
/>
</set>
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="300"
android:fromXDelta="100%"
android:toXDelta="0%"
android:interpolator="@android:anim/decelerate_interpolator"
/>
</set>
Binary file not shown.

After

Width:  |  Height:  |  Size: 120 KiB

@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<layer-list>
<item android:left="5dp" android:top="5dp">
<shape>
<corners android:radius="3dp" />
<gradient
android:angle="315"
android:endColor="@android:color/transparent"
android:startColor="@android:color/black"
android:type="radial"
android:centerX="0.55"
android:centerY="0"
android:gradientRadius="300"/>
<padding android:bottom="1dp" android:left="0dp" android:right="3dp" android:top="0dp" />
</shape>
</item>
<item android:bottom="2dp" android:left="3dp">
<shape>
<corners android:radius="1dp" />
<solid android:color="#ccd9e8" />
</shape>
</item>
</layer-list>
</item>
</selector>
Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M3,13h8L11,3L3,3v10zM3,21h8v-6L3,15v6zM13,21h8L21,11h-8v10zM13,3v6h8L21,3h-8z" />
</vector>
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M10,20v-6h4v6h5v-8h3L12,3 2,12h3v8z" />
</vector>
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M12,22c1.1,0 2,-0.9 2,-2h-4c0,1.1 0.89,2 2,2zM18,16v-5c0,-3.07 -1.64,-5.64 -4.5,-6.32L13.5,4c0,-0.83 -0.67,-1.5 -1.5,-1.5s-1.5,0.67 -1.5,1.5v0.68C7.63,5.36 6,7.92 6,11v5l-2,2v1h16v-1l-2,-2z" />
</vector>
Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

@@ -0,0 +1,86 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#44474c"
android:orientation="vertical">
<Button
android:id="@+id/exit"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:text="Exit"
android:textAlignment="center"
android:layout_below="@+id/logOut"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginTop="15dp" />
<Button
android:id="@+id/logOut"
android:layout_width="175dp"
android:layout_height="wrap_content"
android:layout_marginTop="22dp"
android:text="Log Out"
android:textAlignment="center"
android:layout_below="@+id/currentUserName"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<Button
android:id="@+id/back"
android:layout_width="70dp"
android:layout_height="wrap_content"
android:layout_above="@+id/textView4"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginBottom="32dp"
android:text="Back"
android:textAlignment="center" />
<RatingBar
android:id="@+id/ratingBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="79dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true" />
<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/ratingBar"
android:layout_centerHorizontal="true"
android:layout_marginBottom="18dp"
android:fontFamily="cursive"
android:text="Rate this App"
android:textColor="@android:color/white"
android:textSize="24sp" />
<TextView
android:id="@+id/currentUserName"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="@+id/profPic"
android:layout_marginTop="21dp"
android:fontFamily="cursive"
android:textAlignment="center"
android:textColor="@android:color/white"
android:textSize="30sp" />
<ImageView
android:id="@+id/profPic"
android:layout_width="50dp"
android:layout_height="50dp"
app:srcCompat="@drawable/bg_home"
android:layout_marginTop="19dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true" />
</RelativeLayout>
@@ -0,0 +1,177 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="com.example.ram2.myreceipts.homeJava">
<RelativeLayout
android:id="@+id/homeContent"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.89"
android:background="#ccd9e8">
<TextView
android:id="@+id/homeTitle"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginBottom="@dimen/activity_vertical_margin"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginRight="@dimen/activity_horizontal_margin"
android:layout_marginTop="@dimen/activity_vertical_margin"
android:text="Home"
android:textAlignment="center"
android:textSize="30sp" />
<ImageView
android:id="@+id/enterCode"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_alignEnd="@+id/homeTitle"
android:layout_alignParentBottom="true"
android:layout_alignRight="@+id/homeTitle"
android:layout_marginBottom="19dp"
android:elevation="5dp"
app:srcCompat="@drawable/codepopup" />
<ImageView
android:id="@+id/dashicon"
android:layout_width="40dp"
android:layout_height="50dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:layout_marginTop="8dp"
android:elevation="5dp"
app:srcCompat="@drawable/drawer" />
<LinearLayout
android:id="@+id/toInvis"
android:layout_width="fill_parent"
android:layout_height="490dp"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:background="#ccd9e8"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:background="#ccd9e8">
<ImageView
android:id="@+id/receipt1"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="@+id/homeTitle" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:background="#ccd9e8"
android:elevation="0dp">
<ImageView
android:id="@+id/receipt2"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="@+id/receipt1"
android:layout_weight="1"
android:elevation="0dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:background="#ccd9e8"
android:elevation="0dp">
<ImageView
android:id="@+id/receipt3"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_weight="1" />
</LinearLayout>
</LinearLayout>
<ImageView
android:id="@+id/entireReceipt"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:adjustViewBounds="true"
android:elevation="5dp"
android:scaleType="fitCenter"
android:visibility="invisible"
app:srcCompat="@android:color/background_dark" />
<TextView
android:id="@+id/begin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="Click on the icon below to add receipts" />
<SurfaceView
android:id="@+id/surfaceView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:elevation="8dp"
android:visibility="invisible" />
<TextView
android:id="@+id/txtView"
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_marginBottom="9dp"
android:elevation="10dp"
android:layout_alignParentBottom="true"
android:layout_alignLeft="@+id/dashicon"
android:layout_alignStart="@+id/dashicon" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="41dp"
android:visibility="visible">
<ImageView
android:id="@+id/homeicon"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:elevation="5dp"
app:srcCompat="@drawable/ic_home_black_24dp" />
</RelativeLayout>
</LinearLayout>
@@ -0,0 +1,124 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ccd9e8"
android:orientation="vertical"
tools:context="com.example.ram2.myreceipts.notifJava">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/relativeLayout">
<TextView
android:id="@+id/notifTitle"
android:layout_width="match_parent"
android:layout_height="30dp"
android:layout_marginBottom="@dimen/activity_vertical_margin"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginRight="@dimen/activity_horizontal_margin"
android:layout_marginTop="@dimen/activity_vertical_margin"
android:background="#ccd9e8"
android:elevation="5dp"
android:text="Notifications"
android:textAlignment="center"
android:textSize="22sp" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="480dp"
android:background="#ccd9e8"
android:orientation="horizontal"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight=".3">
<TextView
android:id="@+id/notifModule"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:elevation="6dp"
android:lineSpacingExtra="12sp"
android:textSize="24sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/imageSection"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:layout_weight=".7"
android:orientation="horizontal">
</LinearLayout>
</LinearLayout>
</RelativeLayout>
<RelativeLayout
android:id="@+id/relativeLayout"
android:layout_width="match_parent"
android:layout_height="41dp"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:background="@android:color/white"
android:elevation="6dp">
<ImageView
android:id="@+id/notificon"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignTop="@+id/homeicon"
android:layout_marginEnd="36dp"
android:layout_marginRight="36dp"
android:elevation="5dp"
app:srcCompat="@drawable/ic_notifications_black_24dp" />
<ImageView
android:id="@+id/dashicon"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:layout_marginLeft="46dp"
android:layout_marginStart="46dp"
app:srcCompat="@drawable/ic_dashboard_black_24dp" />
<Button
android:id="@+id/button"
android:layout_width="120dp"
android:layout_height="match_parent"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:background="#c0d0ea"
android:elevation="0dp"
android:visibility="visible" />
<ImageView
android:id="@+id/homeicon"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:elevation="5dp"
app:srcCompat="@drawable/ic_home_black_24dp" />
</RelativeLayout>
</RelativeLayout>
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<TextView
android:id="@+id/textView6"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:background="@drawable/popbg"
android:textAlignment="center" />
<TextView
android:id="@+id/textView5"
android:layout_width="match_parent"
android:layout_height="130dp"
android:layout_above="@+id/inputCode"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:fontFamily="sans-serif-smallcaps"
android:text="Enter Transaction Code:"
android:textAlignment="center"
android:textColor="#434447"
android:textSize="30sp" />
<Button
android:id="@+id/retreiveR"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/inputCode"
android:layout_centerHorizontal="true"
android:layout_marginTop="31dp"
android:text="Retrieve Receipt" />
<EditText
android:id="@+id/inputCode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:ems="10"
android:fontFamily="sans-serif-smallcaps"
android:hint="Enter here"
android:inputType="textPersonName"
android:textAlignment="center"
android:textColor="#ccd5e5"
android:textIsSelectable="false" />
</RelativeLayout>
@@ -0,0 +1,77 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#0099cc"
tools:context="com.example.ram2.myreceipts.WelcomePage">
<!-- The primary full-screen view. This can be replaced with whatever view
is needed to present your content, e.g. VideoView, SurfaceView,
TextureView, etc. -->
<TextView
android:id="@+id/fullscreen_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bg_home"
android:gravity="center"
android:keepScreenOn="true"
android:textColor="#33b5e5"
android:textSize="50sp"
android:textStyle="bold"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<TextView
android:id="@+id/textView"
android:layout_width="288dp"
android:layout_height="wrap_content"
android:layout_marginTop="63dp"
android:fontFamily="cursive"
android:text="Welcome!"
android:textAlignment="center"
android:textAllCaps="false"
android:textColor="@android:color/darker_gray"
android:textSize="30sp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true" />
<com.google.android.gms.common.SignInButton
android:id="@+id/sign_in_button"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_marginBottom="130dp"
android:textColor="@color/black_overlay"
android:textSize="18sp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true" />
<TextView
android:id="@+id/textView2"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:layout_below="@+id/textView"
android:layout_centerHorizontal="true"
android:layout_marginTop="35dp"
android:fontFamily="cursive"
android:text="Neat Receipt"
android:textAlignment="center"
android:textColor="@android:color/background_light"
android:textSize="55sp" />
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/textView"
android:layout_centerHorizontal="true"
android:fontFamily="cursive"
android:text="to"
android:textColor="@android:color/darker_gray"
android:textSize="24sp" />
<!-- This FrameLayout insets its children based on system windows using
android:fitsSystemWindows. -->
</RelativeLayout>
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/navigation_home"
android:icon="@drawable/ic_home_black_24dp"
android:title="@string/title_home" />
<item
android:id="@+id/navigation_dashboard"
android:icon="@drawable/ic_dashboard_black_24dp"
android:title="@string/title_dashboard" />
<item
android:id="@+id/navigation_notifications"
android:icon="@drawable/ic_notifications_black_24dp"
android:title="@string/title_notifications" />
</menu>
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

@@ -0,0 +1,12 @@
<resources>
<!-- Declare custom theme attributes that allow changing which styles are
used for button bars depending on the API level.
?android:attr/buttonBarStyle is new as of API 11 so this is
necessary to support previous API levels. -->
<declare-styleable name="ButtonBarContainerTheme">
<attr name="metaButtonBarStyle" format="reference" />
<attr name="metaButtonBarButtonStyle" format="reference" />
</declare-styleable>
</resources>
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303f9f</color>
<color name="colorAccent">#FF4081</color>
<color name="black_overlay">#66000000</color>
</resources>
@@ -0,0 +1,5 @@
<resources>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
</resources>
@@ -0,0 +1,8 @@
<resources>
<string name="app_name">Neat Receipt</string>
<string name="title_activity_dashboard">Dashboard</string>
<string name="title_home">Home</string>
<string name="title_dashboard">Dashboard</string>
<string name="title_notifications">Notifications</string>
</resources>
@@ -0,0 +1,23 @@
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
<style name="FullscreenTheme" parent="AppTheme">
<item name="android:actionBarStyle">@style/FullscreenActionBarStyle</item>
<item name="android:windowActionBarOverlay">true</item>
<item name="android:windowBackground">@null</item>
<item name="metaButtonBarStyle">?android:attr/buttonBarStyle</item>
<item name="metaButtonBarButtonStyle">?android:attr/buttonBarButtonStyle</item>
</style>
<style name="FullscreenActionBarStyle" parent="Widget.AppCompat.ActionBar">
<item name="android:background">@color/black_overlay</item>
</style>
</resources>
@@ -0,0 +1,17 @@
package com.example.ram2.myreceipts;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
}
+24
View File
@@ -0,0 +1,24 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.2'
classpath 'com.google.gms:google-services:3.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
+17
View File
@@ -0,0 +1,17 @@
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
Binary file not shown.
+6
View File
@@ -0,0 +1,6 @@
#Tue May 09 15:56:11 PDT 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
+160
View File
@@ -0,0 +1,160 @@
#!/usr/bin/env bash
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn ( ) {
echo "$*"
}
die ( ) {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
esac
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
+90
View File
@@ -0,0 +1,90 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windowz variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
+1
View File
@@ -0,0 +1 @@
include ':app'