How to get current selected tab index in TabLayout?

Use OnTabSelectedListener. And then in this listener get the getPosition(). Something like this: tabLayout.setOnTabSelectedListener(new TabLayout.OnTabSelectedListener(){ @Override public void onTabSelected(TabLayout.Tab tab){ int position = tab.getPosition(); } }); UPDATE This method setOnTabSelectedListener() is deprecated . Use addOnTabSelectedListener(OnTabSelectedListener)

Customising the colours of vim’s tab bar

You can do the following, for example: :hi TabLineFill ctermfg=LightGreen ctermbg=DarkGreen :hi TabLine ctermfg=Blue ctermbg=Yellow :hi TabLineSel ctermfg=Red ctermbg=Yellow This line affects the window counter per tab: :hi Title ctermfg=LightBlue ctermbg=Magenta Garish colours chosen to highlight what each of the items changes. I find that looking at $VIMRUNTIME/colors/*.vim really helps when playing with highlighting. Note … Read more

How can I align text in columns using Console.WriteLine?

Try this Console.WriteLine(“{0,10}{1,10}{2,10}{3,10}{4,10}”, customer[DisplayPos], sales_figures[DisplayPos], fee_payable[DisplayPos], seventy_percent_value, thirty_percent_value); where the first number inside the curly brackets is the index and the second is the alignment. The sign of the second number indicates if the string should be left or right aligned. Use negative numbers for left alignment. Or look at http://msdn.microsoft.com/en-us/library/aa331875(v=vs.71).aspx