android-tabs

Android ActionBar: show/hide tabs dynamically?

99封情书 提交于 2019-12-21 09:02:17
问题 Is it possible to remove/restore the tab bar from the action bar dynamically? Up to now I did this by changing the navigation mode of the action bar. I used following code to remove and restore the tab bar: @Override public void restoreTabs() { getSupportActionBar() .setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); this.supportInvalidateOptionsMenu(); } @Override public void removeTabs() { getSupportActionBar() .setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD); this

error with google maps v2 in tab (MapFragment in Fragment)

这一生的挚爱 提交于 2019-12-21 05:23:10
问题 I have a fragmentActivity where I build a tabHost and in each tab there is a Fragment. Well, I haver four tabs 3 with info and 1 with a fragment where is included a google-map-v2 (is a fragmentMAp in a Fragment because I want to add buttons etc.), when I select one tab and pass to other everything go well, but when I select the map tab, after that other tab and again the map tab an error is throw. My view seems like: |__||__|__|__| | __________ | || FRAGMENT || ||_____ _ || || FRAG| |_||| ||

Sliding Tabs in Toolbar using Material Design

独自空忆成欢 提交于 2019-12-20 19:44:41
问题 I have been learning to use Sliding Tabs using Material Design using this post. I have managed to achieve SlidingTabs below the Toolbar , like this one: But now i would like to create ActionBar/ToolBar Fragment Tabs ... 回答1: I was able to recreate exactly what you are looking to implement. I am using the this Library for the tabs. This is the view I have created: Import Library Through Dependencies or Download Project and Import Manually compile 'com.jpardogo.materialtabstrip:library:1.0.9'

Tab with icon using TabLayout in Android Design Library

感情迁移 提交于 2019-12-20 12:35:12
问题 I'm trying to use the new TabLayout in the android design library to create app bar with icons only. like this: how can I do it using the new TabLayout Android Design Library. is there a simple solution for this, or i have to use the setCustomView only. i'm trying to avoid using it. because i didn't get the tint color for the icon like this image above. i try to write like this: tabLayout.addTab(tabLayout.newTab().setIcon(R.drawable.ic_dashboard)) but the icon still stay in the same color

Check fragment visibility after clicking on Tab from TabLayout that only contains icon using Android Espresso

自作多情 提交于 2019-12-19 09:57:45
问题 I'm trying to check if my fragment is visible after performing a click on my tab from my tabLayout which has been set up with view pager. This is my actual activity code, inside my activity onCreate method: mViewPager = findViewById(R.id.contentFrameLayout); mViewPager.setAdapter(mSectionPageAdapter); mViewPager.setPagingEnabled(false); //Set up the tab layout to display tabs tabLayout = findViewById(R.id.homeTabs); tabLayout.setupWithViewPager(mViewPager); for (int i = 0; i< tabLayout

Unable to add Tabs inside Fragment of Navigation Drawer Android

为君一笑 提交于 2019-12-18 15:51:02
问题 1) I have followed the Navigation Drawer example in Android Developer Docs here developer.android.com/training/implementing-navigation/nav-drawer.html and created my whole application. In the given example, they have used Fragments for each item selected in the Drawer called fragments with following code Bundle args = new Bundle(); args.putInt("Title_Number", position); fragment.setArguments(args); FragmentManager fragmentManager = getFragmentManager(); fragmentManager.beginTransaction()

Unable to add Tabs inside Fragment of Navigation Drawer Android

别说谁变了你拦得住时间么 提交于 2019-12-18 15:50:44
问题 1) I have followed the Navigation Drawer example in Android Developer Docs here developer.android.com/training/implementing-navigation/nav-drawer.html and created my whole application. In the given example, they have used Fragments for each item selected in the Drawer called fragments with following code Bundle args = new Bundle(); args.putInt("Title_Number", position); fragment.setArguments(args); FragmentManager fragmentManager = getFragmentManager(); fragmentManager.beginTransaction()

Adding Sliding Tabs using Support Library v7:21 with Toolbar in Android Developer Tools for existing project

天大地大妈咪最大 提交于 2019-12-18 12:26:33
问题 I have already read the information in this link: Use Tab with new ToolBar (AppCompat v7-21) and did a lot of research on the same. But the problem is the SlidingTabLayout project is using Gradle build files and structure. I want to add the tab layout using eclipse. How do I do this? I did run the SlidingTabLayout project in Android Studio though. But how do I add Tabs to Toolbar in v7:21? Note: All this needs to be done in a existing project, which has everything setup and warns me of the

Align-Center SlidingTabLayout

亡梦爱人 提交于 2019-12-18 03:41:50
问题 After I moved my app to 5.0, I had to move from the basic tabs to the slidingTabLayout that a google developer provides . The problem is, I can't figure out how to center both buttons in a way that they get both centered like the old one. Btw, I'm not talking about the style, just the positioning of the buttons, sharing the same amount o widht space! To make things clear I'll post some images: What I have now: What I expect to have: My layout: <LinearLayout xmlns:android="http://schemas

how to keep tabs visible on every activity

感情迁移 提交于 2019-12-17 20:26:11
问题 I am very new to android programming and I am trying to implement tabs using fragments. I am using this Tutorial. Everything goes fine but my problem is that I want to open a new activity and on this new activity I want to keep tab bar. I want tab bar visible on every new activity which opens inside tab. I have following code.. public class Tab1Fragment extends Fragment { @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { if