Showing
1 changed file
with
6 additions
and
5 deletions
| ... | @@ -31,6 +31,8 @@ import com.google.common.util.concurrent.ListenableFuture; | ... | @@ -31,6 +31,8 @@ import com.google.common.util.concurrent.ListenableFuture; |
| 31 | import com.google.common.util.concurrent.MoreExecutors; | 31 | import com.google.common.util.concurrent.MoreExecutors; |
| 32 | import com.google.common.util.concurrent.SettableFuture; | 32 | import com.google.common.util.concurrent.SettableFuture; |
| 33 | 33 | ||
| 34 | +import org.json.JSONArray; | ||
| 35 | + | ||
| 34 | import java.util.ArrayList; | 36 | import java.util.ArrayList; |
| 35 | import java.util.LinkedHashMap; | 37 | import java.util.LinkedHashMap; |
| 36 | import java.util.List; | 38 | import java.util.List; |
| ... | @@ -591,7 +593,7 @@ public class HomeActivity extends Activity implements View.OnClickListener, Coup | ... | @@ -591,7 +593,7 @@ public class HomeActivity extends Activity implements View.OnClickListener, Coup |
| 591 | 593 | ||
| 592 | llOptionsContainer.removeAllViews(); | 594 | llOptionsContainer.removeAllViews(); |
| 593 | 595 | ||
| 594 | - org.json.JSONArray options = question.getOptions(); | 596 | + JSONArray options = question.getOptions(); |
| 595 | String type = question.getType(); | 597 | String type = question.getType(); |
| 596 | 598 | ||
| 597 | List<Integer> selectedPositions = new ArrayList<>(); | 599 | List<Integer> selectedPositions = new ArrayList<>(); |
| ... | @@ -601,7 +603,8 @@ public class HomeActivity extends Activity implements View.OnClickListener, Coup | ... | @@ -601,7 +603,8 @@ public class HomeActivity extends Activity implements View.OnClickListener, Coup |
| 601 | View dropdownHeader = LayoutInflater.from(this).inflate(R.layout.item_questionnaire_option, llOptionsContainer, false); | 603 | View dropdownHeader = LayoutInflater.from(this).inflate(R.layout.item_questionnaire_option, llOptionsContainer, false); |
| 602 | LinearLayout llDropdownContainer = dropdownHeader.findViewById(R.id.ll_option_container); | 604 | LinearLayout llDropdownContainer = dropdownHeader.findViewById(R.id.ll_option_container); |
| 603 | TextView tvDropdownTitle = dropdownHeader.findViewById(R.id.tv_option_title); | 605 | TextView tvDropdownTitle = dropdownHeader.findViewById(R.id.tv_option_title); |
| 604 | - tvDropdownTitle.setText(getString(R.string.demo_region_title)); | 606 | + String optionHeaderText = options.optString(0); |
| 607 | + tvDropdownTitle.setText(optionHeaderText); | ||
| 605 | WarpUtils.renderCustomFont(this, R.font.ping_lcg_regular, tvDropdownTitle); | 608 | WarpUtils.renderCustomFont(this, R.font.ping_lcg_regular, tvDropdownTitle); |
| 606 | llDropdownContainer.setBackground(AppCompatResources.getDrawable(this, R.drawable.shape_questionnaire_option_unselected)); | 609 | llDropdownContainer.setBackground(AppCompatResources.getDrawable(this, R.drawable.shape_questionnaire_option_unselected)); |
| 607 | tvDropdownTitle.setTextColor(getColor(R.color.custom_black2)); | 610 | tvDropdownTitle.setTextColor(getColor(R.color.custom_black2)); |
| ... | @@ -611,15 +614,13 @@ public class HomeActivity extends Activity implements View.OnClickListener, Coup | ... | @@ -611,15 +614,13 @@ public class HomeActivity extends Activity implements View.OnClickListener, Coup |
| 611 | llDropdownList.setVisibility(View.GONE); | 614 | llDropdownList.setVisibility(View.GONE); |
| 612 | 615 | ||
| 613 | if (options != null) { | 616 | if (options != null) { |
| 614 | - for (int i = 0; i < options.length(); i++) { | 617 | + for (int i = 1; i < options.length(); i++) { |
| 615 | final int position = i; | 618 | final int position = i; |
| 616 | String optionText = options.optString(i); | 619 | String optionText = options.optString(i); |
| 617 | View optionView = LayoutInflater.from(this).inflate(R.layout.item_questionnaire_option, llDropdownList, false); | 620 | View optionView = LayoutInflater.from(this).inflate(R.layout.item_questionnaire_option, llDropdownList, false); |
| 618 | - LinearLayout llOptionContainer = optionView.findViewById(R.id.ll_option_container); | ||
| 619 | TextView tvOptionTitle = optionView.findViewById(R.id.tv_option_title); | 621 | TextView tvOptionTitle = optionView.findViewById(R.id.tv_option_title); |
| 620 | tvOptionTitle.setText(optionText); | 622 | tvOptionTitle.setText(optionText); |
| 621 | WarpUtils.renderCustomFont(this, R.font.ping_lcg_regular, tvOptionTitle); | 623 | WarpUtils.renderCustomFont(this, R.font.ping_lcg_regular, tvOptionTitle); |
| 622 | - llOptionContainer.setBackground(AppCompatResources.getDrawable(this, R.drawable.shape_questionnaire_option_unselected)); | ||
| 623 | tvOptionTitle.setTextColor(getColor(R.color.custom_grey3)); | 624 | tvOptionTitle.setTextColor(getColor(R.color.custom_grey3)); |
| 624 | 625 | ||
| 625 | optionView.setOnClickListener(v -> { | 626 | optionView.setOnClickListener(v -> { | ... | ... |
-
Please register or login to post a comment