androiddesignsupport

Application crash on some devices with android.support.v7.widget.ContentFrameLayout.setDecorPadding

随声附和 提交于 2021-02-07 06:18:06
问题 Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mypackage/com.mypackage.activities.HomeActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v7.widget.ContentFrameLayout.setDecorPadding(int, int, int, int)' on a null object reference at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2721) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2782) at android.app

Android AppCompatEditText,AppCompatTextView, setText without ID

纵然是瞬间 提交于 2020-11-29 03:57:23
问题 I have simple Login page with some textview and edittex and i set static text to textview and hint to edittext from string.xml working fine. But Now i am receiving that strings(which i set form stirng.xml as i explained above) form webservices and i have to set webservice string. Issue is i didn't set any id to that login screen elements(edittext and textview). Update I have AppCompatTextView like below in my XML <androidx.appcompat.widget.AppCompatTextView android:layout_width="match_parent"

Android AppCompatEditText,AppCompatTextView, setText without ID

本小妞迷上赌 提交于 2020-11-29 03:54:05
问题 I have simple Login page with some textview and edittex and i set static text to textview and hint to edittext from string.xml working fine. But Now i am receiving that strings(which i set form stirng.xml as i explained above) form webservices and i have to set webservice string. Issue is i didn't set any id to that login screen elements(edittext and textview). Update I have AppCompatTextView like below in my XML <androidx.appcompat.widget.AppCompatTextView android:layout_width="match_parent"

Remove scrollbar from android support design navigation drawer?

断了今生、忘了曾经 提交于 2020-02-01 17:25:46
问题 I just updated the support design library from 22.2.1 to 23.0.1 and immediately noticed the presence of a scrollbar in the navigation drawer. I tried to use android:scrollbars="none" But that didn't fix it. Is there any other way to remove the scrollbar? 回答1: Unfortunately the scrollbar is set in the NavigationMenuView layout not in the NavigationView , for this reason if you use android:scrollbars="none" the scrollbar is still present. You can do it programmatically calling this method:

Remove scrollbar from android support design navigation drawer?

雨燕双飞 提交于 2020-02-01 17:25:44
问题 I just updated the support design library from 22.2.1 to 23.0.1 and immediately noticed the presence of a scrollbar in the navigation drawer. I tried to use android:scrollbars="none" But that didn't fix it. Is there any other way to remove the scrollbar? 回答1: Unfortunately the scrollbar is set in the NavigationMenuView layout not in the NavigationView , for this reason if you use android:scrollbars="none" the scrollbar is still present. You can do it programmatically calling this method:

(Design Support Library) CollapsingToolbarLayout — Toolbar not getting pinned on collapse

余生颓废 提交于 2020-01-22 09:00:26
问题 I'm having trouble integrating the Design Support Library into my application. For some reason, the toolbar collapses with the CollapsingToolbarLayout, and does not leave it pinned like in the Cheesesquare example by Chris Banes. https://github.com/chrisbanes/cheesesquare I didn't do anything different to my layout. In fact, I replaced my styles with his, and dropped in his layout. I wonder if using Toolbar, instead of android.support.v7.widget.Toolbar is causing this. Here is the problem.

How to get the current selected item position using TabLayout in Android Design Library

时光毁灭记忆、已成空白 提交于 2020-01-14 10:19:26
问题 I am using the android design library TabLayout in that how can I get the current selected item tab position. ViewPager pager = (ViewPager) view.findViewById(R.id.pager); MyPagerAdapter adapter = new MyPagerAdapter(getChildFragmentManager()); pager.setAdapter(adapter); tabLayout.setupWithViewPager(pager); 回答1: As of version 22.2.1 of the Support library the TabLayout has a method getSelectedTabPosition . Source 1 | Source 2 回答2: You can call ViewPager's getCurrentItem() to get the index of

RecyclerView drawing offscreen, can't scroll bottom item into view

狂风中的少年 提交于 2020-01-13 10:15:10
问题 Using Design Support Library 22.2.1, with the following View hierarchy: <DrawerLayout android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true"> <CoordinatorLayout android:layout_width="match_parent" android:layout_height="match_parent"> <AppBarLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <Toolbar android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" /> <TabLayout android:layout_width

Toolbar not scrolling when using collapsing toolbar effect

杀马特。学长 韩版系。学妹 提交于 2020-01-06 19:35:10
问题 I am using below layout to use collapsing toolbar effect but not able to expand toolbar.I want to expand the toolbar as given here for collapsing toolbar effect. https://guides.codepath.com/android/Handling-Scrolls-with-CoordinatorLayout <android.support.design.widget.CoordinatorLayout android:id="@+id/coordinatorLayout" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height=

Change Design Support Navigation View Header Title Programmatically

吃可爱长大的小学妹 提交于 2020-01-04 05:44:10
问题 I have a question about Navigation Drawer Header Section Items. Actually I want to change a TextView in HeaderLayout programatically, here are codes: drawer menu: <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android"> <group android:checkableBehavior="all"> <item android:id="@+id/navItem1" android:icon="@drawable/ic_home_drawer" android:title="A"/> <item android:id="@+id/navItem2" android:icon="@drawable/ic_gallery_drawer" android:title="B"/>