Skip to content

homework 3#3

Open
AzotX7 wants to merge 3 commits intodevelopfrom
hw3
Open

homework 3#3
AzotX7 wants to merge 3 commits intodevelopfrom
hw3

Conversation

@AzotX7
Copy link
Copy Markdown
Owner

@AzotX7 AzotX7 commented Nov 25, 2024

super.onViewCreated(view, savedInstanceState)
questionText = view.findViewById(R.id.questionText)
radioGroup = view.findViewById(R.id.radioGroup)
radioButton1 = view.findViewById(R.id.radioButton1)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

При такой реализации, если ответов на вопросы будет, например, больше 10, все они не влезут и не будут скроллиться. Было бы лучше реализовать это через ресайкл вью

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

У вас активити выступает как основной экран. По-хорошему, нужно реализовывать все через фрагменты


class MainActivity : AppCompatActivity() {

private lateinit var viewPager: ViewPager2
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Старайтесь избегать использования lateinit вместе с вьюшками - приводит к утечкам памяти

Copy link
Copy Markdown

@GrKnght GrKnght left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Работа проверена. Используете активити, а не фрагмент в качестве основного экрана

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants