-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
183 changed files
with
2,729 additions
and
1,527 deletions.
There are no files selected for viewing
Empty file.
Empty file.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Empty file.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
Empty file modified
0
app/src/androidTest/java/com/example/intellimills/ExampleInstrumentedTest.java
100644 → 100755
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions
14
app/src/main/java/com/example/intellimills/AdminDashboardActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.example.intellimills; | ||
|
||
import androidx.appcompat.app.AppCompatActivity; | ||
|
||
import android.os.Bundle; | ||
|
||
public class AdminDashboardActivity extends AppCompatActivity { | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_admin_dashboard); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
53 changes: 53 additions & 0 deletions
53
app/src/main/java/com/example/intellimills/DriverDashboardActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package com.example.intellimills; | ||
|
||
import androidx.appcompat.app.AppCompatActivity; | ||
import android.content.Intent; | ||
import android.os.Bundle; | ||
import android.view.View; | ||
import android.widget.Button; | ||
|
||
public class DriverDashboardActivity extends AppCompatActivity { | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_driver_dashboard); | ||
|
||
// Get references to the buttons | ||
Button pickHarvestButton = findViewById(R.id.buttonPickHarvest); | ||
Button reportIssueButton = findViewById(R.id.buttonReportIssue); | ||
Button applyLeaveButton = findViewById(R.id.buttonApplyLeave); // Added | ||
|
||
// Set OnClickListener for the "Pick a Harvest" button | ||
pickHarvestButton.setOnClickListener(new View.OnClickListener() { | ||
@Override | ||
public void onClick(View view) { | ||
// Open the DriverPickFarmActivity when "Pick a Harvest" button is clicked | ||
Intent pickFarmIntent = new Intent(DriverDashboardActivity.this, DriverPickFarmActivity.class); | ||
startActivity(pickFarmIntent); | ||
} | ||
}); | ||
|
||
// Set OnClickListener for the "Report an Issue" button | ||
reportIssueButton.setOnClickListener(new View.OnClickListener() { | ||
@Override | ||
public void onClick(View view) { | ||
// Open the MessagingActivity when "Report an Issue" button is clicked | ||
Intent messagingIntent = new Intent(DriverDashboardActivity.this, Messaging.class); | ||
startActivity(messagingIntent); | ||
} | ||
}); | ||
|
||
// Set OnClickListener for the "Apply Leave" button (Added) | ||
applyLeaveButton.setOnClickListener(new View.OnClickListener() { | ||
@Override | ||
public void onClick(View view) { | ||
// Open the DriverLeaveFormActivity when "Apply Leave" button is clicked | ||
Intent applyLeaveIntent = new Intent(DriverDashboardActivity.this, DriverLeaveFormActivity.class); | ||
startActivity(applyLeaveIntent); | ||
} | ||
}); | ||
|
||
// Rest of your onCreate code... | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
app/src/main/java/com/example/intellimills/DriverLeaveFormActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.example.intellimills; | ||
|
||
import androidx.appcompat.app.AppCompatActivity; | ||
|
||
import android.os.Bundle; | ||
|
||
public class DriverLeaveFormActivity extends AppCompatActivity { | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_driver_leave_form); | ||
} | ||
} |
83 changes: 83 additions & 0 deletions
83
app/src/main/java/com/example/intellimills/DriverLoginActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
package com.example.intellimills; | ||
|
||
import androidx.appcompat.app.AppCompatActivity; | ||
|
||
import android.os.Bundle; | ||
import android.text.TextUtils; | ||
import android.widget.Button; | ||
import android.widget.EditText; | ||
import android.widget.Toast; | ||
import android.content.Intent; | ||
import android.os.Handler; | ||
|
||
import com.google.firebase.auth.FirebaseAuth; | ||
|
||
public class DriverLoginActivity extends AppCompatActivity { | ||
|
||
FirebaseAuth mAuth; | ||
EditText editemail; | ||
EditText editpasswrd; | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_driver_login); | ||
editemail =findViewById(R.id.editTextTextEmailAddress2); | ||
editpasswrd = findViewById(R.id.editTextTextPassword2); | ||
|
||
// Initialize FirebaseAuth | ||
mAuth = FirebaseAuth.getInstance(); // Add this line to initialize Firebase Authentication | ||
|
||
Button signupdriver = findViewById(R.id.signupdriver); | ||
signupdriver.setOnClickListener(view -> { | ||
Toast.makeText(DriverLoginActivity.this, "Loading Driver Sign Up Page." , Toast.LENGTH_LONG).show(); | ||
|
||
signupdriver.setClickable(false); | ||
new Handler().postDelayed(() -> { | ||
Intent signdrv = new Intent(DriverLoginActivity.this,DriverSignUpActivity.class); | ||
startActivity(signdrv); | ||
finish(); | ||
},3000); | ||
}); | ||
Button button2 =findViewById(R.id.button2login); | ||
button2.setOnClickListener(view -> loginUser()); | ||
} | ||
private void loginUser(){ | ||
editemail =findViewById(R.id.editTextTextEmailAddress2); | ||
editpasswrd = findViewById(R.id.editTextTextPassword2); | ||
|
||
String email = editemail.getText().toString(); | ||
String password =editpasswrd.getText().toString(); | ||
Button button2 =findViewById(R.id.button2login); | ||
|
||
if (TextUtils.isEmpty(email)){ | ||
editemail.setError("Email cannot be empty"); | ||
editemail.requestFocus(); | ||
Toast.makeText(getApplicationContext(),"Please Enter Your Email",Toast.LENGTH_LONG).show(); | ||
}else if (TextUtils.isEmpty(password)){ | ||
editpasswrd.setError("Password cannot be empty"); | ||
editpasswrd.requestFocus(); | ||
Toast.makeText(getApplicationContext(),"Please enter Password.",Toast.LENGTH_LONG).show(); | ||
}else{ | ||
button2.setClickable(true); | ||
mAuth.signInWithEmailAndPassword(email,password).addOnCompleteListener(task -> { | ||
if (task.isSuccessful()){ | ||
Toast.makeText(DriverLoginActivity.this, "Welcome.", Toast.LENGTH_LONG).show(); | ||
Toast.makeText(getApplicationContext(),"Verifying.......",Toast.LENGTH_LONG).show(); | ||
new Handler().postDelayed(() -> { | ||
editemail.setText(""); | ||
editpasswrd.setText(""); | ||
Intent advert = new Intent(DriverLoginActivity.this, DriverDashboardActivity.class); | ||
startActivity(advert); | ||
finish(); | ||
|
||
},2000); | ||
}else { | ||
Toast.makeText(DriverLoginActivity.this, "Login Error" +task.getException().getMessage(), Toast.LENGTH_LONG).show(); | ||
button2.setClickable(true); | ||
} | ||
}); | ||
|
||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
app/src/main/java/com/example/intellimills/DriverPickFarmActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.example.intellimills; | ||
|
||
import androidx.appcompat.app.AppCompatActivity; | ||
|
||
import android.os.Bundle; | ||
|
||
public class DriverPickFarmActivity extends AppCompatActivity { | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_driver_pick_farm); | ||
} | ||
} |
Oops, something went wrong.