Skip to content

Commit

Permalink
intial upload
Browse files Browse the repository at this point in the history
  • Loading branch information
oviasdev committed Jun 2, 2019
1 parent 589d0c9 commit c8687cf
Show file tree
Hide file tree
Showing 98 changed files with 3,915 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
*.iml
.gradle
/local.properties
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
.DS_Store
/build
/captures
.externalNativeBuild
Binary file added .idea/caches/build_file_checksums.ser
Binary file not shown.
Binary file added .idea/caches/gradle_models.ser
Binary file not shown.
4 changes: 4 additions & 0 deletions .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/runConfigurations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
55 changes: 55 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.hp.ovias_mine"
minSdkVersion 16
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
}
buildToolsVersion = '28.0.3'

}


dependencies {
configurations {
all*.exclude group: 'com.android.support', module: 'support-v13'
}
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:2.0.0-beta1'
implementation 'com.android.support:design:28.0.0'
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.2'
implementation 'com.google.firebase:firebase-database:17.0.0'
//implementation 'com.google.android.gms:play-services-gcm:9.2.1'
implementation 'com.google.firebase:firebase-auth:17.0.0'
//implementation 'com.google.firebase:firebase-core:16.0.7'
implementation 'com.firebaseui:firebase-ui-database:0.4.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support:support-vector-drawable:28.0.0'
implementation 'com.borax12.materialdaterangepicker:library:1.9'

implementation 'com.github.PuffoCyano:Range-Time-Picker-Dialog:v1.8'
testImplementation 'junit:junit:4.13-beta-2'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.google.firebase:firebase-core:16.0.5'

}
apply plugin: 'com.google.gms.google-services'
55 changes: 55 additions & 0 deletions app/google-services.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"project_info": {
"project_number": "727777206429",
"firebase_url": "https://ovias-593f6.firebaseio.com",
"project_id": "ovias-593f6",
"storage_bucket": "ovias-593f6.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:727777206429:android:bd6403312015a350",
"android_client_info": {
"package_name": "com.example.hp.ovias_mine"
}
},
"oauth_client": [
{
"client_id": "727777206429-791rrsslt29gl5l79hsaa03puejfkanh.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.example.hp.ovias_mine",
"certificate_hash": "8b0a71b10c6c2d769aa5751f77510d2f17e9ccbf"
}
},
{
"client_id": "727777206429-hohr7v7ie1l9lb8nna3plm1abk7mgmop.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyAD5lo21c2Jad2mjQuSOOdaHy1cudWceXg"
}
],
"services": {
"analytics_service": {
"status": 1
},
"appinvite_service": {
"status": 2,
"other_platform_oauth_client": [
{
"client_id": "727777206429-hohr7v7ie1l9lb8nna3plm1abk7mgmop.apps.googleusercontent.com",
"client_type": 3
}
]
},
"ads_service": {
"status": 2
}
}
}
],
"configuration_version": "1"
}
24 changes: 24 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# 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
-keepclassmembers class com.paytm.pgsdk.PaytmWebView$PaytmJavaScriptInterface {
public *;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.example.hp.ovias_mine;

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.*;

/**
* Instrumented 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() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();

assertEquals("com.example.hp.ovias_mine", appContext.getPackageName());
}
}
45 changes: 45 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.hp.ovias_mine">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.READ_SMS"/>
<uses-permission android:name="android.permission.RECEIVE_SMS"/>

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name=".SplashScreen"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".MainActivity" />
<activity android:name=".ResetPasswordActivity" />
<activity android:name=".LoginActivity" />
<activity
android:name=".SignUpActivity"
android:theme="@style/AppTheme.NoActionBar" />
<activity
android:name=".HomeActivity"
android:label="@string/title_activity_home" />
<activity android:name=".BookActivity" />
<activity android:name=".Booktime" />
<activity android:name=".AdminActivity" />
<activity android:name=".ExampleActivity" />
<activity android:name=".AdminTransaction" />
<activity android:name=".GuardActivity" />
<activity android:name=".AdminMain"></activity>
</application>

</manifest>
102 changes: 102 additions & 0 deletions app/src/main/java/com/example/hp/ovias_mine/AdminActivity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
package com.example.hp.ovias_mine;

import android.graphics.ColorSpace;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

import com.firebase.ui.database.FirebaseRecyclerAdapter;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.Query;
import com.google.firebase.database.ValueEventListener;

public class AdminActivity extends AppCompatActivity {
RecyclerView recyclerView;
FirebaseDatabase db;
DatabaseReference dref;
AvailabilityCheck Model;



@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_admin);
recyclerView=findViewById(R.id.recycler);
recyclerView.setHasFixedSize(true);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
db=FirebaseDatabase.getInstance();
dref=db.getReference("available");
}

@Override
protected void onStart() {
super.onStart();
Query query = dref.orderByChild("availability").equalTo("unknown");
FirebaseRecyclerAdapter<AvailabilityCheck,ViewHolder> firebaseRecyclerAdapter=new FirebaseRecyclerAdapter<AvailabilityCheck, ViewHolder>(AvailabilityCheck.class,R.layout.row,ViewHolder.class,query) {
@Override
protected void populateViewHolder(ViewHolder viewHolder, AvailabilityCheck model, int position) {
viewHolder.setDetails(getApplicationContext(),model.getId(),model.getUsername(),model.getVehicle(),model.getDate(),model.getTime(),model.getAvailability());
}

@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
ViewHolder viewHolder = super.onCreateViewHolder(parent, viewType);
viewHolder.setOnClickListener(new ViewHolder.ClickListener() {
@Override
public void onItemClick(View view, int position) {
TextView text1 = (TextView) view.findViewById(R.id.ide);
TextView text2 = (TextView) view.findViewById(R.id.username);
TextView text3 = (TextView) view.findViewById(R.id.vehicle);
TextView text4 = (TextView) view.findViewById(R.id.date_);
TextView text5 = (TextView) view.findViewById(R.id.time_);
TextView text6 = (TextView) view.findViewById(R.id.status);
String ids = text1.getText().toString();


Toast.makeText(getApplicationContext(), "Item clicked at " + position + " ", Toast.LENGTH_SHORT).show();
dref.child(ids).child("availability").setValue("Available");

}
@Override
public void onItemclick(View view, int position) {
TextView text1 = (TextView) view.findViewById(R.id.ide);
TextView text2 = (TextView) view.findViewById(R.id.username);
TextView text3 = (TextView) view.findViewById(R.id.vehicle);
TextView text4 = (TextView) view.findViewById(R.id.date_);
TextView text5 = (TextView) view.findViewById(R.id.time_);
TextView text6 = (TextView) view.findViewById(R.id.status);
String ids = text1.getText().toString();


Toast.makeText(getApplicationContext(), "Failed ", Toast.LENGTH_SHORT).show();
dref.child(ids).child("availability").setValue("Not Available");

}
});
return viewHolder;

}
};


recyclerView.setAdapter(firebaseRecyclerAdapter);






}

}
Loading

0 comments on commit c8687cf

Please sign in to comment.