tabs

Detecting tab visibility in Firefox

佐手、 提交于 2019-12-09 17:56:46
问题 I'm writing a webapp that performs an action every minute or so which (very briefly) hangs the browser. I'd like to pause this action when the tab displaying the webapp is not shown, to minimize the annoyance. Is there any way to do this using Javascript, under the latest version of Firefox? Edit: to clarify, I'm asking about how to determine the visibility of the tab that some JS code is running in - not how to pause/resume the action which hangs the browser. 回答1: var isFocused = true;

Enable/Disable Tab in ActionBar

非 Y 不嫁゛ 提交于 2019-12-09 17:41:28
问题 It's possible to enable/disable Tabs in ActionBar? With TabHost this is not a problem.. I do: tabHost.getTabWidget().getChildAt(3).setVisibility(true); and all works.. but if i want to do the same thing with Tabs in ActionBar?? In Tab class don't exist setEnable(); ActionBar bar = getActionBar(); Tab tab = bar.newTab(); tab.setText("Test"); tab.setEnable(false); /*DON'T EXIST!!*/ How can I do?? 回答1: You could use the removeTab( ActionBar.Tab tab )-method of ActionBar : bar.removeTab( tab );

Call Tabbed Fragment method from Activity

蹲街弑〆低调 提交于 2019-12-09 17:21:19
问题 I have one activity that comprises of three fragments. The fragments use the actionbar tabs using a PagerAdapter. What I want to do is access a method in the active tabbed fragment from the main activity. I have tried the below code but this just returns the fragment as null, so I guess it cant find it within the tabs! NPListFragment articleFrag = (NPListFragment) getSupportFragmentManager().findFragmentByTag("NP"); articleFrag.refreshT(); PagerAdapter: public class AppSectionsPagerAdapter

Android: “News and Weather” app tabs

◇◆丶佛笑我妖孽 提交于 2019-12-09 16:48:26
问题 does anyone know how to build that kind of tabs that the "News and Weather" app uses? see here http://img51.imageshack.us/img51/8788/tabsd.png This means a tab area that can be scrolled to the left & right. Changing the tabs is also possible by scrolling the listview to the left / right. 回答1: That component up there is actually a HorizontalScrollView , with buttons inside. Use it like a LinearLayout and throw in the buttons. You'll have to manually handle the selected/unselected states of the

How to make rounded tabs with css? [closed]

ぐ巨炮叔叔 提交于 2019-12-09 16:09:01
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I'm wondering if it's possible to archive the following effect with CSS I found these articles that kind of help but the problem is that in my case the tab sides are diagonal not straight vertical lines: http://css-tricks.com/tabs-with-round-out-borders/ http://css-tricks.com/better-tabs-with-round-out-borders/

How to change the color of the selected tab in the TabControl?

天大地大妈咪最大 提交于 2019-12-09 11:59:35
问题 I am implementing a TabControl for a dialog box in WPF. The color of the selected tab (mouse-down) is white by default. I want to change the color of that selected tab to the color of hover (when I hover over a tab, the color of the tab changes to an Office-blue-gradient, which is what I want the color of the selected tab to be on mouse-click). How can I do that? This piece of code does not work: <Style x:Key="StyleTabControl" TargetType="{x:Type TabItem}"> <Setter Property="Background" Value

How to set the default tab of multiple swipe views with tabs?

痴心易碎 提交于 2019-12-09 11:32:55
问题 I am really stuck. I did four Swipe Views with Tabs in my main activity but what I want is when user opens the application it shows automatically the second tab not the first one. This is my MainActivity.java public class MainActivity extends FragmentActivity implements ActionBar.TabListener { private ViewPager viewPager; private TabsPagerAdapter mAdapter; private ActionBar actionBar; // Tab titles private String[] tabs = { "First Tab", "Second Tab", "Third Tab", "Fourth Tab" }; @Override

Android TabHost tabs steal focus when using Hardware Keyboard

三世轮回 提交于 2019-12-09 09:44:00
问题 I currently have a TabHost containing 4 tabs. On a few of the fragments we have a number of EditText views within the layout. We have noticed that when you attempt to type into any of the EditText views using the hardware keyboard, the focus is stolen from the EditText and given to the currently active tab in the TabHost . This only occurs on screens with tabs. Is there a quick and simple way to solve this? 回答1: This has been a known bug for quite a long time: http://code.google.com/p/android

Google Chrome pinned tab highlight unread [closed]

六月ゝ 毕业季﹏ 提交于 2019-12-09 08:18:50
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . In google chrome there is a feature that highlights pinned tabs which have unread content. For example, I pinned my Facebook page, and if any Notification or Message arrives, the pinned tab gets highlighted. This is not so noticeable as only a little white spot, sliding from right to left on the top of the tab,

How to get current selected tab index in TabLayout?

喜你入骨 提交于 2019-12-09 07:36:08
问题 When I use ActionBar tabs, I use this code. private int getCurrentTabIndex() { ActionBar actionBar = activity.getSupportActionBar(); ActionBar.Tab selectedTab = actionBar.getSelectedTab(); if(selectedTab == null){ return 0; } return selectedTab.getPosition(); } But how can I do it using TabLayout? 回答1: Use OnTabSelectedListener. And then in this listener get the getPosition(). Something like this: tabLayout.setOnTabSelectedListener(new TabLayout.OnTabSelectedListener(){ @Override public void