There are several (or rather quite a few) stages in the application. Each stage (separate activation) has a set of imageViews (at each stage - a different number). Dimensions (width, height), as well as indents from the container borders, each imageView receives from the array created in each activity:
int[] viewsWidth={100,150,200,...} int[] viewsHeight={120,100,180, ...} int[] viewsLeftMargin ={20,150,30,80, ...} int[] viewsTopMargin ={180,250,50,120, ...} ImageView[] imageViews ={image1,image2,imge3,image4, ...} Further, these data in the createImageViews() method, which is in oncreate , are processed so that the pictures on different displays look correct ( ie, for a larger display, the size of the picture and indents increase, for a smaller one, decrease ).
Well, and so it happens at each stage (activit): 4 arrays are created + an ImageViews array, + a method that processes all this.
It begs the thought to simplify it all, but how? According to the MVC principle? I am not a very big specialist in java, I have little experience.
For example, you can put all the arrays (except for the array with pictures, of course) in the resource file, and the arrays will contain the parameters of all ImageView in the application, and not just one activation. Then create a model (Model1) that will bind 4 parameters {width, height, offset, indent}, then create a class that will create a List (paramsViewList) from Model1 objects, and then in each activate the created imageView array in the createImageViews() method to assign the appropriate values from paramsViewList.
In general, I think correctly, and will this option be a complication ( in fact ), and not an improvement in the code, and are there any more interesting ideas?