-
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.
Started adding versions Fixed -- Added App Icon -- Fixed Button BG Colors -- About screen had white bar up top -- Field shift hid date when "mileage" was clicked on Add Record screen -- Added alpha version information and version TextViews -- Fixed spacing and text and text background colors -- Now asks current mileage of new vehicle avoiding blank line for first service -- Added Admin Section with option to delete entire list of vehicles -- Added comments to ALL files -- Removed unnecessary files To Do -- Make option to delete certain vehicles -- Create New Existing Vehicles type layout with click bringing up are you sure dialog -- Make option to delete certain services
- Loading branch information
1 parent
53a776d
commit 0cbf23d
Showing
60 changed files
with
489 additions
and
447 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
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
58 changes: 58 additions & 0 deletions
58
app/src/main/java/com/staxxproducts/vehicleservicetracker/AdminActivities.kt
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,58 @@ | ||
package com.staxxproducts.vehicleservicetracker | ||
|
||
import android.app.AlertDialog | ||
import android.content.Intent | ||
import android.os.Bundle | ||
import android.widget.Button | ||
|
||
|
||
class AdminActivities: MainActivity() { | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.admin_screen) | ||
|
||
// Initializes buttons | ||
val backButton = findViewById<Button>(R.id.goBackBtn) | ||
val eraseList = findViewById<Button>(R.id.eraseListBtn) | ||
|
||
// Sends user back to the main screen | ||
backButton.setOnClickListener { | ||
val intent = Intent(this, MainActivity::class.java) | ||
startActivity(intent) | ||
} | ||
// Executes sureOrNot which asks user if they're sure they want to delete the entire list | ||
eraseList.setOnClickListener { | ||
sureOrNotEntire() | ||
} | ||
|
||
|
||
|
||
} | ||
|
||
|
||
// Creates a dialog box giving the user the option to proceed with list deletion or to back out to the main screen | ||
private fun sureOrNotEntire() { | ||
|
||
val builder = AlertDialog.Builder(this) | ||
val inflater = layoutInflater | ||
val dialogLayout = inflater.inflate(R.layout.are_you_sure_popup, null) | ||
val yesImSure = dialogLayout.findViewById<Button>(R.id.yesSureBtn) | ||
val goBack = dialogLayout.findViewById<Button>(R.id.sureGoBack) | ||
builder.setView(dialogLayout) | ||
goBack.setOnClickListener { | ||
val intent = Intent(this, MainActivity::class.java) | ||
startActivity(intent) | ||
} | ||
yesImSure.setOnClickListener { | ||
val intent = Intent(this, ExistingVehicle::class.java) | ||
val preferences = getSharedPreferences("shared preferences", MODE_PRIVATE) | ||
preferences.edit().clear().apply() | ||
startActivity(intent) | ||
} | ||
|
||
builder.show() | ||
|
||
|
||
} | ||
} |
Oops, something went wrong.