Answer the question
In order to leave comments, you need to log in
How to reduce the rendering time of an Activity?
The purple part represents the time taken to transfer the stream's render resources.
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
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question