1. Are you ready for the Galaxy S20? Here is everything we know so far!
  1. Kiwi_gamer01

    Kiwi_gamer01 Lurker
    Thread Starter

    Hey, is there a way to get a better visually looking transition method when changing tabs, than mine. I'am using the onChangeTab with viewPager.

    Code (Java):
    1. private void onChangeTab(int position) {
    2.  
    3.        //TextView tab_home = findViewById(R.id.tab_home);
    4.  
    5.        if(position==0)
    6.        {
    7.            reset();
    8.            TextView tv = findViewById(R.id.tab_home);
    9.            tv.setLayoutParams(new TableLayout.LayoutParams(ViewPager.LayoutParams.WRAP_CONTENT, 40, 0.9f));
    10.            home_.setTextSize(20);
    11.            home_.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.tab_on));
    12.            home_.setBackground(ContextCompat.getDrawable(getApplicationContext(), R.drawable.rounded_selected));
    13.        }
    14.        if(position==1)
    15.        {
    16.    ...


    Is There a way to get a smooth transition.
     



    1. Download the Forums for Android™ app!


      Download

       
Loading...

Share This Page

Loading...