I know that I have to much going on in my main thread but I'm looking for a work-around.
Here is my app's structure:
Currently I have my main activity, which has 6 clickable imageviews (that open new activities), the problem happens when one of the activities are opened. In this activity I'm using a SlidingTabLayout with 3 tabs.
This is what I am trying to achieve:
I'm creating a piano out of drawables(shapes)
For example, this is the black key:
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<stroke
android:width="1dp"
android:color="#FF000000" />
<solid
android:color="#FF000000"/>
</shape>
Then I call this drawables in my layout to create the piano:
<ImageView
android:layout_width="8dp"
android:layout_height="37dp"
android:layout_marginLeft="40dp"
android:layout_marginStart="10.5dp"
android:src="@drawable/key_black" />
I'm displaying 7 Imageviews for the black keys and 10 Imageviews for the white keys PER piano and I have 11 pianos PER tab. So that is 187 Imageview per tab.
So I understand that this will be harsh on my CPU. I'm looking for a way to do this of my main thread? To do it in the background? To do it without experiencing lagging?