Skip to content
This repository has been archived by the owner on Oct 5, 2018. It is now read-only.

Commit

Permalink
Merge branch 'release/v1.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Evasionn committed May 13, 2018
2 parents f3d3264 + d76d848 commit d67d8e0
Show file tree
Hide file tree
Showing 257 changed files with 139,240 additions and 610 deletions.
19 changes: 12 additions & 7 deletions attendancetracking/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,20 @@ android {

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.0'
implementation 'com.android.support:cardview-v7:27.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:design:27.1.0'
implementation 'com.android.support:support-v4:27.1.0'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.basgeekball:awesome-validation:4.1'
implementation 'com.android.volley:volley:1.1.0'
implementation 'org.altbeacon:android-beacon-library:2.13.1'
implementation 'com.nabinbhandari.android:permissions:3.5'
implementation 'com.google.android.gms:play-services-vision:15.0.1'
implementation 'com.github.halysongoncalves:pugnotification:1.8.1'
implementation 'com.github.siyamed:android-shape-imageview:0.9.+@aar'
implementation 'com.roomorama:caldroid:3.0.1'
}
10 changes: 10 additions & 0 deletions attendancetracking/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

<uses-feature android:name="android.hardware.camera" />

<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>

<uses-feature
android:name="android.hardware.bluetooth_le"
android:required="true" />
Expand Down Expand Up @@ -44,6 +50,10 @@
<service android:name=".helpers.BeaconBuilder"/>
<service android:name=".utils.RegularMode"/>
<service android:name=".helpers.ServiceManager"/>
<service android:name=".helpers.Logger"/>
<service android:name=".helpers.Pusher"/>
<activity android:name=".securemode.FaceTrackerActivity"></activity>
<activity android:name=".activities.UploadImage"></activity>
</application>

</manifest>

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_login);
if (savedInstanceState == null) {

getFragmentManager()
getSupportFragmentManager()
.beginTransaction()
.replace(R.id.login_layout, new StudentLogin())
.commit();
Expand All @@ -30,12 +30,12 @@ protected void onCreate(Bundle savedInstanceState) {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (roleSwitch.isChecked()) {
getFragmentManager()
getSupportFragmentManager()
.beginTransaction()
.replace(R.id.login_layout, new LecturerLogin())
.commit();
} else {
getFragmentManager()
getSupportFragmentManager()
.beginTransaction()
.replace(R.id.login_layout, new StudentLogin())
.commit();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,38 +1,32 @@
package seniorproject.attendancetrackingsystem.activities;

import android.Manifest;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

import com.nabinbhandari.android.permissions.PermissionHandler;
import com.nabinbhandari.android.permissions.Permissions;

import java.util.Map;
import java.util.Objects;

import seniorproject.attendancetrackingsystem.R;
import seniorproject.attendancetrackingsystem.helpers.SessionManager;

public class MainActivity extends AppCompatActivity {
private Button login;
private Button register;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
SessionManager session = new SessionManager(getApplicationContext());
if (session.isLoggedIn()) {
Map<String, String> userInfo = session.getUserDetails();
Intent intent;
if(userInfo.get(SessionManager.KEY_USER_TYPE).equals("student"))
intent = new Intent(MainActivity.this, StudentActivity.class);
else
intent = new Intent(MainActivity.this, LecturerActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
}
Button login = findViewById(R.id.login_button);
Button register = findViewById(R.id.register_button);
login = findViewById(R.id.login_button);
register = findViewById(R.id.register_button);
Intent intent = getIntent();
Bundle bundle = intent.getExtras();

Expand All @@ -44,27 +38,56 @@ protected void onCreate(Bundle savedInstanceState) {
e.printStackTrace();
}
}
login.setOnClickListener(
new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent loginIntent = new Intent(MainActivity.this, LoginActivity.class);
startActivity(loginIntent);
}
});
checkPermissions();
}

register.setOnClickListener(
new View.OnClickListener() {
private void checkPermissions() {
Permissions.check(this, new String[]{Manifest.permission.CAMERA,
Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission
.READ_EXTERNAL_STORAGE, Manifest.permission.ACCESS_COARSE_LOCATION, Manifest
.permission.READ_PHONE_STATE},
"This permissions are required to use Attendance Tracking System", new Permissions
.Options()
.setSettingsDialogTitle("Warning!").setRationaleDialogTitle("Info"),
new PermissionHandler() {
@Override
public void onClick(View v) {
Intent registerIntent = new Intent(MainActivity.this, RegistrationActivity.class);
startActivity(registerIntent);
public void onGranted() {
checkSession();
login.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent loginIntent = new Intent(MainActivity.this, LoginActivity.class);
startActivity(loginIntent);
}
});

register.setOnClickListener(
new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent registerIntent =
new Intent(MainActivity.this, RegistrationActivity.class);
startActivity(registerIntent);
}
});
}
});
}

@Override
public void onBackPressed() {

private void checkSession() {
SessionManager session = new SessionManager(getApplicationContext());
if (session.isLoggedIn()) {
Map<String, String> userInfo = session.getUserDetails();
Intent intent;
if (userInfo.get(SessionManager.KEY_USER_TYPE).equals("student"))
intent = new Intent(MainActivity.this, StudentActivity.class);
else intent = new Intent(MainActivity.this, LecturerActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
}
}

@Override
public void onBackPressed() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_registration);
if (savedInstanceState == null) {
getFragmentManager()
getSupportFragmentManager()
.beginTransaction()
.replace(R.id.register_layout, new StudentRegister())
.commit();
Expand All @@ -29,12 +29,12 @@ protected void onCreate(Bundle savedInstanceState) {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (roleSwitch.isChecked()) {
getFragmentManager()
getSupportFragmentManager()
.beginTransaction()
.replace(R.id.register_layout, new LecturerRegister())
.commit();
} else {
getFragmentManager()
getSupportFragmentManager()
.beginTransaction()
.replace(R.id.register_layout, new StudentRegister())
.commit();
Expand Down
Loading

0 comments on commit d67d8e0

Please sign in to comment.