[Newbie] [Android studio] I put too many image buttons. Is there any other way?

Asked 1 years ago, Updated 1 years ago, 62 views

I'm a total beginner.

My level is that I've been following a simple example from the Android studio to the Cotlin for a semester in liberal arts (I don't know the structure of which sentence is why, but I just follow the example sentence...) Understanding the code?Without it, I'm trying to make this and that by organizing what I learned and searching little by little and copying and pasting code if I need anything else.

Recently, in Android Studios, the language is Cotlin, making a simple game There are about 30 spaces on the board where the game horse can move, and each one is made of a button We're rolling the dice to make certain commands of the button go ahead when a horse arrives at a certain compartment. (I made the dice roll simply by showing the image of rolling the dice when I press the button and giving the result.)

I don't know how to use an external link, so I put all the images in the drawer and use them (about 15-20 images) When it gets a bit complicated, the connection between the activities is confusing I was a bit lazy to do it I try to make it work in one activity as much as possible.

For example, turning on the help window doesn't create a separate activity Add containerlayout so that visibility is usually GONE and becomes VISIBLE when you press the button to turn on the help?

But I don't know if it's a lot of work, but it gets really slow and the app keeps turning off...

The reason why I thought of it was

I think... I don't know if it's right.

Please advise if it can be solved by dividing the activity or reducing the button a little bit, or which part should I study and do it in a different way.

android studio imagebutton activity kotlin

2022-09-21 22:08

1 Answers

If the content view layout layer of Activity is too complicated, there may be performance problems as you said, and if you try to manage the views, the code may become complicated, making it difficult to see and maintain. You can implement different roles in different ways, including Fragment, Dialog, and Popup Window. First of all, it would be good to study UI-related APIs and layout types.


2022-09-21 22:08

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.