A
A
alekseyHunter2019-09-01 09:20:19
Android
alekseyHunter, 2019-09-01 09:20:19

How to reduce the rendering time of an Activity?

The purple part represents the time taken to transfer the stream's render resources.

How to reduce this time (purple part)?
Activation code:
class ObjectActivity : AppCompatActivity(){

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

        val bundle = intent.getBundleExtra("bundle")

        val tabTitles = bundle!!.getStringArray(ARGUMENT_DESC_TITLES)
        val info = bundle.getStringArray(ARGUMENT_DESC_INFO)
        val image = bundle.getInt(ARGUMENT_DESC_IMAGE)
        val desc = bundle.getString(ARGUMENT_DESC_NAME)


        val imageView: ImageView = findViewById(R.id.desc_image)
        val toolbarName: CollapsingToolbarLayout = findViewById(R.id.desc_name)
        val viewPager: ViewPager = findViewById(R.id.viewpager)
        val tabLayout: TabLayout = findViewById(R.id.sliding_tabs)

        Picasso.get().load(image).into(imageView)
        toolbarName.title = desc

        val fragmentPagerAdapter = SampleFragmentPagerAdapter(supportFragmentManager, tabTitles!!, info, image)
        viewPager.adapter = fragmentPagerAdapter

        tabLayout.setupWithViewPager(viewPager)

        val toolbar = findViewById<View>(R.id.flexible_example_toolbar) as android.support.v7.widget.Toolbar
        toolbar.setNavigationOnClickListener { onBackPressed() }
    }
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Developer, 2019-09-01
@alekseyHunter

The rendering time is strongly influenced by the layout, the number of nested views, from the parameters, the relationship relative to each other...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question