Skip to content

Commit

Permalink
fixed few bugs and ui
Browse files Browse the repository at this point in the history
  • Loading branch information
Maniii97 committed Jul 18, 2023
1 parent cbc08cd commit cfd3450
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,22 @@ 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)

}

var result: String = ""



if (required == 0) {
result =
"You already have 75% attendance. \n" +
Expand All @@ -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<TextView>(R.id.tvResult)
tvResult.text=result

Expand Down
Binary file added app/src/main/res/drawable/mrii.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions app/src/main/res/layout/result_dialog1.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
Expand Down Expand Up @@ -64,4 +64,4 @@



</RelativeLayout>
</LinearLayout>
4 changes: 2 additions & 2 deletions app/src/main/res/layout/result_dialog2.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
Expand Down Expand Up @@ -64,4 +64,4 @@



</RelativeLayout>
</LinearLayout>
17 changes: 10 additions & 7 deletions app/src/main/res/layout/result_dialog3.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
Expand Down Expand Up @@ -34,11 +34,14 @@
android:textSize="18sp"
android:textStyle="bold" />

<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/mri4"
android:layout_gravity="center" />
<pl.droidsonroids.gif.GifImageView
android:layout_width="225dp"
android:layout_height="225dp"
android:layout_gravity="center"
android:layout_marginStart="20dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="20dp"
android:src="@drawable/mrii" />

<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btnCalculate"
Expand All @@ -64,4 +67,4 @@



</RelativeLayout>
</LinearLayout>
1 change: 1 addition & 0 deletions app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>
<color name="blue">#7584fa</color>
<color name="whitee">#756a6a</color>
</resources>

0 comments on commit cfd3450

Please sign in to comment.