android-support-design

Attribute already defined with incompatible format (Original attribute defined here)

我的未来我决定 提交于 2019-12-05 05:33:53
Can't build project after adding compile 'com.android.support:design:24.2.0' Keeps giving the following errors: Seems like, the problem is with supporting vector drawables. Somewhere some attributes are added twice. For instance, built values.xml file contains: <declare-styleable name="AppBarLayout_LayoutParams"><attr name="layout_scrollFlags"><flag name="scroll" value="0x1"/><flag name="exitUntilCollapsed" value="0x2"/><flag name="enterAlways" value="0x4"/><flag name="enterAlwaysCollapsed" value="0x8"/></attr><attr format="reference" name="layout_scrollInterpolator"/></declare-styleable> and

Sharing NavigationView with all the Activities?

蓝咒 提交于 2019-12-04 19:34:46
问题 How do we share Drawer with all the activities? In the lister: onNavigationItemSelected of setNavigationItemSelectedListener we can get the id and navigate to it. What I am looking for is something like this: private void initDrawerLayout() { drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout); NavigationView navView = (NavigationView) findViewById(R.id.navigation_view); navView.setNavigationItemSelectedListener(new NavigationView.OnNavigationItemSelectedListener() { @Override

Is TabLayout supposed to replace PagerTabStrip? Is there any “pro” to PagerTabStrip?

☆樱花仙子☆ 提交于 2019-12-04 16:31:29
OK, so I see PagerTabStrip has a bug - https://code.google.com/p/android/issues/detail?id=183127 Therefore, is TabLayout a better choice especially for now? Is there any downside to TabLayout? Some quirkiness where you might have to set all 3 items? I see TabLayout versus pagerTabStrip for convenience and functionality but that didn't really get answers... 来源: https://stackoverflow.com/questions/32770917/is-tablayout-supposed-to-replace-pagertabstrip-is-there-any-pro-to-pagertabst

Android recylerview v.23.2.0 & design library v.23.2.0 are broken

一笑奈何 提交于 2019-12-04 16:11:52
问题 After update to v23.2.0 recyclerview items have strange behavior: very big with empty space. After update to design library 23.2.0 menu overflow icon became black (app has dark action bar). UPDATE On my nexus 5 overflow icon & recycler view row are fixed, but on Galaxy Tab 4 overflow icon is still black. UPDATE 2 If you have problems with empty spacing, fix layout parameters for your views (match_parent -> wrap_content), cause RecyclerView will now size itself based on the size of its

How to add Snackbars in a BroadcastReceiver?

て烟熏妆下的殇ゞ 提交于 2019-12-04 10:05:05
Snackbars provide lightweight feedback about an operation by showing a brief message at the bottom of the screen. Snackbars can contain an action. Android also provides a toast, primarily used for system messaging. Toasts are similar to snackbars but do not contain actions and cannot be swiped off screen. My question import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.widget.Toast; public class TestReceiver extends BroadcastReceiver { @Override public void onReceive(final Context context, final Intent intent) { Toast.makeText

How sync TabLayout with ViewPager when using TabItem

孤人 提交于 2019-12-04 06:40:25
I want to use TabLayout with TabItem with following code: <android.support.design.widget.TabLayout android:id="@+id/tabs" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/color_primary" app:tabGravity="fill" app:tabIndicatorColor="@color/white" app:tabMode="fixed" app:tabSelectedTextColor="@color/white" app:tabTextColor="@color/gray_light"> <android.support.design.widget.TabItem android:layout_width="wrap_content" android:layout_height="match_parent" android:icon="@drawable/ic_language" /> <!-- other tabs ... --> </android.support.design

How to enable/disable toolbar scrolling programmatically when using design support library

无人久伴 提交于 2019-12-03 18:30:21
问题 I use support design library to show/hide toolbar when scrolling a recyclerView inside a fragment, as mention here https://github.com/codepath/android_guides/wiki/Handling-Scrolls-with-CoordinatorLayout <?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/drawer_layout" android:layout_width=

java.lang.NoClassDefFoundError: android.support.v7.app.AppCompatDelegateImplV14

﹥>﹥吖頭↗ 提交于 2019-12-03 17:15:24
All of a sudden, when I try to compile my project,and run my app, I start getting this runtime error- java.lang.NoClassDefFoundError: android.support.v7.app.AppCompatDelegateImplV14 at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:93) at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:77) at android.support.v7.app.AppCompatActivity.getDelegate(AppCompatActivity.java:429) at android.support.v7.app.AppCompatActivity.onCreate(AppCompatActivity.java:57) at com.example.shubhamkanodia.bookmybook.MainActivity.onCreate(MainActivity.java:70) at android

Unable to see Tab Indicator in TabLayout design support library

假如想象 提交于 2019-12-03 16:07:23
问题 I am using Material design library and creating layout using CoordinatorLayout ,AppBarLayout , RecyclerView and TabLayout . My issue is i am unable to see Tab indicator in Tablayout .Below is my xml file that i am using in AppCompactActivity . <android.support.design.widget.CoordinatorLayout android:id="@+id/coodinate_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_above="@+id/btn_next_screen"> <android.support.v7.widget.RecyclerView android:id=

How to use selectors to change icons with the new TabLayout

☆樱花仙子☆ 提交于 2019-12-03 11:25:41
I'm using the new support TabLayout from Android. The thing is that I wanted to use selectors to change the icon when a tab is selected. I've been looking into the source code and it seems to me that the it never changes the state of the view (and for that reason I can't use the selector). Does anyone knows some workaround? Thank you! There is way to set customView as a tab with setCustomView(View view) method. So you can create a textview and set a selector to it and set this view to tab. Hope it helps you! Assume your my_selector.xml is, <selector xmlns:android="http://schemas.android.com