Showing
1 changed file
with
8 additions
and
4 deletions
| ... | @@ -10,18 +10,15 @@ import android.util.TypedValue; | ... | @@ -10,18 +10,15 @@ import android.util.TypedValue; |
| 10 | import android.view.LayoutInflater; | 10 | import android.view.LayoutInflater; |
| 11 | import android.view.View; | 11 | import android.view.View; |
| 12 | import android.view.ViewGroup; | 12 | import android.view.ViewGroup; |
| 13 | -import android.widget.AdapterView; | ||
| 14 | import android.widget.ArrayAdapter; | 13 | import android.widget.ArrayAdapter; |
| 15 | import android.widget.ImageView; | 14 | import android.widget.ImageView; |
| 16 | import android.widget.LinearLayout; | 15 | import android.widget.LinearLayout; |
| 17 | import android.widget.ListPopupWindow; | 16 | import android.widget.ListPopupWindow; |
| 18 | import android.widget.RelativeLayout; | 17 | import android.widget.RelativeLayout; |
| 19 | -import android.widget.Spinner; | ||
| 20 | import android.widget.TextView; | 18 | import android.widget.TextView; |
| 21 | import android.widget.Toast; | 19 | import android.widget.Toast; |
| 22 | 20 | ||
| 23 | import androidx.appcompat.content.res.AppCompatResources; | 21 | import androidx.appcompat.content.res.AppCompatResources; |
| 24 | -import androidx.appcompat.widget.AppCompatSpinner; | ||
| 25 | import androidx.constraintlayout.widget.ConstraintLayout; | 22 | import androidx.constraintlayout.widget.ConstraintLayout; |
| 26 | import androidx.recyclerview.widget.LinearLayoutManager; | 23 | import androidx.recyclerview.widget.LinearLayoutManager; |
| 27 | import androidx.recyclerview.widget.RecyclerView; | 24 | import androidx.recyclerview.widget.RecyclerView; |
| ... | @@ -551,7 +548,14 @@ public class HomeActivity extends Activity implements View.OnClickListener, Coup | ... | @@ -551,7 +548,14 @@ public class HomeActivity extends Activity implements View.OnClickListener, Coup |
| 551 | bottomSheetDialog.setContentView(dialogView); | 548 | bottomSheetDialog.setContentView(dialogView); |
| 552 | 549 | ||
| 553 | ImageView ivClose = dialogView.findViewById(R.id.iv_back); | 550 | ImageView ivClose = dialogView.findViewById(R.id.iv_back); |
| 554 | - ivClose.setOnClickListener(v -> bottomSheetDialog.dismiss()); | 551 | + ivClose.setOnClickListener(v -> { |
| 552 | + if (mCurrentQuestionIndex > 0) { | ||
| 553 | + mCurrentQuestionIndex--; | ||
| 554 | + renderQuestion(questionnaire, dialogView, bottomSheetDialog); | ||
| 555 | + } else { | ||
| 556 | + bottomSheetDialog.dismiss(); | ||
| 557 | + } | ||
| 558 | + }); | ||
| 555 | 559 | ||
| 556 | mCurrentQuestionIndex = 0; | 560 | mCurrentQuestionIndex = 0; |
| 557 | renderQuestion(questionnaire, dialogView, bottomSheetDialog); | 561 | renderQuestion(questionnaire, dialogView, bottomSheetDialog); | ... | ... |
-
Please register or login to post a comment