android-tablayout

Got Error inflating class android.support.design.widget.TabLayout

≡放荡痞女 提交于 2019-12-31 01:29:08
问题 I'm trying to create a menu tab based on Google's "material design" using Eclipse, but I got an error: 01-07 01:02:10.238: E/tag(6696): contact on create called 01-07 01:02:10.301: E/AndroidRuntime(6696): FATAL EXCEPTION: main 01-07 01:02:10.301: E/AndroidRuntime(6696): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.rvappsstudios.designflashalerts/com.rvappsstudios.designflashalerts.MainActivity}: java.lang.RuntimeException: Unable to start activity ComponentInfo{com

Hide Tablayout Bar in android

时光怂恿深爱的人放手 提交于 2019-12-30 07:09:25
问题 I have a activity with toolbar , Tablayout , viewpager with fragments like that I want to implement toolbar material search on all the fragments like that but the problem is TAB Bar . I want to hide the tab bar(Call,Chat,Contact) on Search Open and unhide it when the search close How can I hide the tabbar ? I am using this library for material Search view implementation layout code is below <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android=

Android. Tablayout inside a tab of another tablayout

独自空忆成欢 提交于 2019-12-30 06:54:12
问题 Is it possible to have a tablayout inside a tab of another tablayout? I have created the following image for a better explanation. The slide movement desired is as it is described in the image. My main activity Xml <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/activity_main" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support

Tabs of TabLayout not showing

谁都会走 提交于 2019-12-30 02:10:05
问题 I have a main activity, which hosts a fragment, which in turn hosts a TabLayout (with a ViewPager). The tab bar is shown, baut the tabs themselves are not shown. Here is my code in the main activity for displaying the host fragment: Fragment fragment = new BMITabsFragment(); FragmentManager fragmentManager = getSupportFragmentManager(); fragmentManager.beginTransaction().replace(R.id.content_frame, fragment).addToBackStack(Constants.BMI_TABS_FRAGMENT).commit(); Here is my the Fragment which

TabLayout without using ViewPager

…衆ロ難τιáo~ 提交于 2019-12-29 13:46:12
问题 I want to implement a TabLayout because it is simple but all the tutorials I have found involve a ViewPager . I just want something like OnClickListener where if I click the Add icon, it will show a toast that displays "tab 1" and if I click a calendar icon, it will show a toast that displays "tab 2" I would like to use TabLayout because it handles device rotations. Main_activity.java public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle

TabLayout without using ViewPager

帅比萌擦擦* 提交于 2019-12-29 13:45:13
问题 I want to implement a TabLayout because it is simple but all the tutorials I have found involve a ViewPager . I just want something like OnClickListener where if I click the Add icon, it will show a toast that displays "tab 1" and if I click a calendar icon, it will show a toast that displays "tab 2" I would like to use TabLayout because it handles device rotations. Main_activity.java public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle

Hiding/Showing the toolbar when fragment in the tabs is scrolled

只愿长相守 提交于 2019-12-29 03:09:30
问题 I added the new Toolbar , Tablayout and Viewpager in my android app. I provided Fragments for my 3 Tabs and its working fine. But the problem is that when i scroll up my Toolbar does not hide. I want that when i scroll my fragment it should hide. And one more thing, i am using Webview in the fragment. My codes are given below. MainActivity.Java public class MainActivity extends AppCompatActivity { TabLayout tabLayout; @Override protected void onCreate(Bundle savedInstanceState) { super

Can a custom view be used as a TabItem?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-28 12:06:11
问题 The TabLayout class in android provides you with a TabItem that can let you specify a text and a icon. Is it possible to use a custom view as a TabItem? My tab would look like this as you can see besides an icon and a text label, I also have a notification symbol (a number inside a yellow circle). how can I make tabs like this? 回答1: In certain cases, instead of the default tab view we may want to apply a custom XML layout for each tab. To achieve this, iterate over all the TabLayout.Tabs

Tabs don't fit to screen with tabmode=scrollable, Even with a Custom Tab Layout

故事扮演 提交于 2019-12-28 06:53:12
问题 I have made a custom TabLayout with a ViewPager and am using the TabLayout in scrollable mode: I need it to be scrollable as the number of dates can vary to as many as 15-20: <com.example.project.recommendedapp.CustomScrollableTabLayout android:id="@+id/tab_layout_movie" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="?attr/colorPrimary" android:elevation="6dp" android:minHeight="?attr/actionBarSize" app:tabGravity="fill" app:tabMode="scrollable"

Android TabLayout inside Fragment

允我心安 提交于 2019-12-28 05:10:11
问题 I am using Navigation Drawer to navigate between fragments they all use the MainActivity toolbar but each fragment has it's own TabLayout with 3 tabs and in each tab I am using RecyclerView to show different text and images. I did this last time using actvities instead of fragments but now using the drawer it's beter to use fragments. I have got to a point where the tabs work but as soon as I put the ViewPager in and connect the adapters to the tabs and I open the new fragment from the drawer