diff --git a/app/src/main/java/com/example/attendancecalculator/ResultDialog.kt b/app/src/main/java/com/example/attendancecalculator/ResultDialog.kt index fb63c4f..187aa1e 100644 --- a/app/src/main/java/com/example/attendancecalculator/ResultDialog.kt +++ b/app/src/main/java/com/example/attendancecalculator/ResultDialog.kt @@ -29,16 +29,15 @@ class ResultDialog : AppCompatActivity() { - if (bunk > 0) { + if (bunk > 0 && required==0) { setContentView(R.layout.result_dialog0) - } - else if (required in 6..11) { + } else if (required in 6..11) { setContentView(R.layout.result_dialog1) } else if (required in 12..17) { setContentView(R.layout.result_dialog2) } else if (required > 17) { setContentView(R.layout.result_dialog3) - } else if(required in 0..6) { + } else { setContentView(R.layout.activity_result_dialog) } @@ -46,7 +45,6 @@ class ResultDialog : AppCompatActivity() { var result: String = "" - if (required == 0) { result = "You already have 75% attendance. \n" + @@ -64,10 +62,9 @@ class ResultDialog : AppCompatActivity() { else{ result ="You need to attend $required more classes to attain 75% attendance \n" + "Current Attendance : $presentc/$totalc = $cAttn% \n" + - "Required Attendance : $req/$total = $nAttn% \n" + "Required Attendance : $req/$total = $nAttn%" } - val tvResult = findViewById(R.id.tvResult) tvResult.text=result diff --git a/app/src/main/res/drawable/mrii.gif b/app/src/main/res/drawable/mrii.gif new file mode 100644 index 0000000..1fbec39 Binary files /dev/null and b/app/src/main/res/drawable/mrii.gif differ diff --git a/app/src/main/res/layout/result_dialog1.xml b/app/src/main/res/layout/result_dialog1.xml index 0a1fb8a..66e5b31 100644 --- a/app/src/main/res/layout/result_dialog1.xml +++ b/app/src/main/res/layout/result_dialog1.xml @@ -1,5 +1,5 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/result_dialog2.xml b/app/src/main/res/layout/result_dialog2.xml index 56b05c7..f1c8140 100644 --- a/app/src/main/res/layout/result_dialog2.xml +++ b/app/src/main/res/layout/result_dialog2.xml @@ -1,5 +1,5 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/result_dialog3.xml b/app/src/main/res/layout/result_dialog3.xml index 871ab38..eb63503 100644 --- a/app/src/main/res/layout/result_dialog3.xml +++ b/app/src/main/res/layout/result_dialog3.xml @@ -1,5 +1,5 @@ - - + \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 36ead32..ac9cb56 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -8,4 +8,5 @@ #FF000000 #FFFFFFFF #7584fa + #756a6a \ No newline at end of file