-
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
22 changed files
with
537 additions
and
47 deletions.
There are no files selected for viewing
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
3 changes: 2 additions & 1 deletion
3
...com/mr_17/queezy/CreateAccountActivity.kt → .../queezy/activity/CreateAccountActivity.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
3 changes: 2 additions & 1 deletion
3
...in/java/com/mr_17/queezy/LoginActivity.kt → ...om/mr_17/queezy/activity/LoginActivity.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
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
72 changes: 72 additions & 0 deletions
72
app/src/main/java/com/mr_17/queezy/activity/SolutionsActivity.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,72 @@ | ||
package com.mr_17.queezy.activity | ||
|
||
import android.os.Bundle | ||
import android.view.View | ||
import androidx.appcompat.app.AppCompatActivity | ||
import androidx.appcompat.widget.Toolbar | ||
import androidx.recyclerview.widget.LinearLayoutManager | ||
import androidx.recyclerview.widget.RecyclerView | ||
import com.mr_17.queezy.R | ||
import com.mr_17.queezy.adapter.SolutionsActivityRecyclerViewAdapter | ||
import com.mr_17.queezy.model.Question | ||
import com.mr_17.queezy.model.SolutionsActivityRecyclerViewModel | ||
|
||
class SolutionsActivity : AppCompatActivity() { | ||
|
||
private var qAndA: Question? = null | ||
|
||
private var toolbar: Toolbar? = null | ||
|
||
private var selectedOptions: ArrayList<Int>? = null | ||
private var answer: ArrayList<Int>? = null | ||
|
||
private var recyclerView: RecyclerView? = null | ||
private var list: java.util.ArrayList<SolutionsActivityRecyclerViewModel>? = null | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.activity_solutions) | ||
|
||
InitializeFields() | ||
InitializeSolutionsRecyclerView() | ||
} | ||
|
||
private fun InitializeFields() | ||
{ | ||
qAndA = intent.getSerializableExtra("qAndA") as Question? | ||
selectedOptions = intent.getSerializableExtra("selectedOptions") as ArrayList<Int>? | ||
answer = intent.getIntegerArrayListExtra("answers") as ArrayList<Int> | ||
|
||
recyclerView = findViewById(R.id.recycler_view) | ||
|
||
toolbar = findViewById(R.id.toolbar) | ||
toolbar!!.setNavigationOnClickListener { onBackPressed() } | ||
|
||
} | ||
|
||
private fun InitializeSolutionsRecyclerView() { | ||
recyclerView!!.layoutManager = LinearLayoutManager(this) | ||
list = ArrayList() | ||
|
||
for (i in answer!!.indices) { | ||
list!!.add(SolutionsActivityRecyclerViewModel( | ||
"Question " + (i+1).toString() + " of " + answer!!.size, | ||
"", | ||
qAndA!!.question!!.get(i), | ||
qAndA!!.optA!!.get(i), | ||
qAndA!!.optB!!.get(i), | ||
qAndA!!.optC!!.get(i), | ||
qAndA!!.optD!!.get(i), | ||
answer!!.get(i), | ||
selectedOptions!!.get(i) | ||
) | ||
) | ||
} | ||
|
||
// This will pass the ArrayList to our Adapter | ||
val adapter = SolutionsActivityRecyclerViewAdapter(list!!) | ||
|
||
// Setting the Adapter with the recyclerview | ||
recyclerView!!.adapter = adapter | ||
} | ||
} |
3 changes: 2 additions & 1 deletion
3
...n/java/com/mr_17/queezy/SplashActivity.kt → ...m/mr_17/queezy/activity/SplashActivity.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
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
6 changes: 2 additions & 4 deletions
6
.../java/com/mr_17/queezy/WelcomeActivity.kt → .../mr_17/queezy/activity/WelcomeActivity.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
Oops, something went wrong.