android-tablayout

issues with coordinator layout in android ?

大兔子大兔子 提交于 2019-12-12 00:53:20
问题 i m using coordinator layout to achive this video VIDEO REQUIREMENT NOW here is my layout : <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/tabanim_maincontent" android:layout_width="match_parent" android:layout_height="match_parent"> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical"> <LinearLayout

Tabs in CollapsingToolbarLayout overlapping RecyclerView

人盡茶涼 提交于 2019-12-11 16:32:55
问题 I have a TabLayout which has a ViewPager that selects between two fragments which both have vertical scrolling RecyclerViews. I have a scrolling TabLayout so that when I scroll the RecyclerView, the tabs disappear. However, it starts off with the TabLayout overlapping the RecyclerView's first item, cutting it off. I have tried adding margin to the ViewPager but this margin exists even after the tabs have been scrolled off of the screen. How could I change it so the tabs do not overlap the

Kotlin pass data between fragment from it main activity is null

岁酱吖の 提交于 2019-12-11 16:31:59
问题 I having difficulties to pass data from main activity to its fragment. Here main activity is ProductActivity.class that have two fragment using tablayout using Kotlin Using bundle and set to argument seem not working as error by compiler because string was not save or maybe null after create new fragment. java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.os.Bundle.getString(java.lang.String)' on a null object reference at my.hipi.hipiboutique.fragments

Titles in TabLayout donsen't appear

谁都会走 提交于 2019-12-11 15:48:29
问题 guys I have a trouble in Android, my code compiles and but not work all fine! I try to do a TabLayout with ViewPager but the text donsen't appear. This is the structure of the code: I build this based on DrawableLayout own created by Android Studio, so lets check my code: In Main Activity: The Library is allready imported. import android.support.design.widget.TabLayout; // Tabs and ViewPager TabLayout tabLayout = findViewById(R.id.tabs); ViewPager viewPager = findViewById(R.id.viewpager);

TabLayout highlite and Ripple effect

◇◆丶佛笑我妖孽 提交于 2019-12-11 12:16:56
问题 I have two question with TabLayout 1)Can i remove TabLayout highlight or change highlight color of tab layout? 2)Can i add ripple effect for tab. Each tab contain TextView i try to add custom background something like this <?xml version="1.0" encoding="utf-8"?> <ripple xmlns:android="http://schemas.android.com/apk/res/android" android:color="?android:colorControlHighlight"> <item android:drawable="@drawable/btn_white_bg" /> </ripple> but it doesn't work. 回答1: Another solution that works for

Divider between Tabs of TabLayout Programatically LinearLayout.SHOW_DIVIDER_MIDDLE

牧云@^-^@ 提交于 2019-12-11 08:39:35
问题 I've tried adding the divider between tabs, without using any custom layout. I have tried it programmatically using the following method: public static void addTabsDividers(TabLayout tabLayout, @ColorRes int divColorRes,int divWidthDP,int divHeightDP){ View root = tabLayout.getChildAt(0); if (root instanceof LinearLayout) { ((LinearLayout) root).setShowDividers(LinearLayout.SHOW_DIVIDER_MIDDLE); GradientDrawable drawable = new GradientDrawable(); drawable.setColor(tabLayout.getContext()

Call method in Fragment from MainActivity

好久不见. 提交于 2019-12-11 05:35:39
问题 My application consists of a MainActivity that contains a TabLayout . The second tab has a RecyclerView which allows for items to be selected by clicking on them. The initial state is shown in the left figure. When one or more items are selected however, a overlaying Toolbar is shown with the options to (from left to right) copy, edit, delete or deselect the items. This situation is shown in the middle figure. When for example the deselect option is chosen, the Toolbar should hide and the

TabLayout versus pagerTabStrip for convenience and functionality

冷暖自知 提交于 2019-12-11 04:36:08
问题 When using a ViewPager, is there any advantage to using TabLayout instead of PagerTabStrip or vice versa? Or are they equivalent? Is one more convenient than the other? Does one offer greater functionality? Again all questions are asked, and thus all answers are expected, in the context of ViewPager. Thanks. 回答1: TabLayout is a material concept that replaced the deprecated ActionBar tabs in Android 5.0. It extends HorizontalScrollView, so you can keep adding tabs horizontally which can

make Scrollable or fixed mode in Tablayout for dynamic number of Tabs

女生的网名这么多〃 提交于 2019-12-11 04:35:40
问题 I want tabMode scrollable with tabFilled with tabs (having single line title). As number of Tab and their title is dynamic in my app. How could I handle them when I set given property. Title of tabs come's in two lines.when number of tab is greater. app:tabGravity="fill" app:tabMaxWidth="0dp" app:tabMode="fixed" and when number of tabs are less and tabMode is set to scrollable . then extra space shown like below. how could I make a Tablayout to work in all phones and with one line text .

TabLayout cannot be resolved to a type- Eclipse

末鹿安然 提交于 2019-12-11 00:58:02
问题 I want to create a TabLayout with ViewPager . I'm using api version 22. I'm getting this error TabLayout cannot be resolved to a type I'm using Eclipse for development. 回答1: You were remaining with adding support library in your project. Before use the design support library, you have to import support-v7-appcompat library from android-sdks\extras\android\support\v7\appcompat. Then, you have to: create an android library project in eclipse for design support library put the contents of