android-design-library

android:layout_height=“?attr/actionBarSize” is not working with support:design:23.0.0' library

我是研究僧i 提交于 2019-11-29 01:18:55
If I set android:layout_height="56dp" , I can see the toolbar in graphical layout. But when I set like the below, <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="@color/purple" android:gravity="center_vertical" android:minHeight="?attr/actionBarSize" app:layout_scrollFlags="scroll|enterAlways" app:popupTheme="@style/ThemeOverlay.AppCompat.Light"> </android.support.v7.widget.Toolbar> toolbar is not showing in graphical layout. Studio says that attr/actionBarSize is marked as private.

How to properly hide&show the actionbar using the new design library API?

江枫思渺然 提交于 2019-11-29 00:43:05
问题 Background Suppose I have these elements in the activity: actionbar (actually a Toolbar) tabs (using TabLayout ) ViewPager, with fragments. each fragment has ListVIew/RecyclerView. I wish to have the same behavior as on many apps, that when scrolling, the action bar will hide or show. A perfect example for it is how the Play Store scrolling works. Something like this (but with ListView in the fragments of course) : The problem I've found the "Android-ObservableScrollView" library which shows

how to implement collapsing image view like Google IO 2015 App using Design Library

只愿长相守 提交于 2019-11-28 23:19:56
问题 How to implement collapsing toolbar layout design like Google IO 2015 using Design Library In Open Source Code of Google IO 2015, it is not implemented using Design Library (CoordinatorLayout, CollapsingToolbarLayout etc) Note : In this the toolbar is at the bottom in upper section. I need the toolbar to be scrolling like this attached with the textview or any other view of upper section. 回答1: Finally i was able to implement it. <?xml version="1.0" encoding="utf-8"?> <android.support.design

How to animate FloatingActionButton of new Design Support Library

安稳与你 提交于 2019-11-28 23:02:16
问题 I am using a TabLayout with 5 different fragments. On 3 of these fragments a android.support.design.widget.FloatingActionButton should appear. Right now I simply set the visibility of the FAB when the tab changes, but I would like to have an animation, where the FAB comes in and out. How can I achieve this in Android? 回答1: The hide/show animation for shrink/pop are automatically handled by the new version of the Support Library.(22.2.1) Then OnTabChange listener show or hide the floating

When using the CoordinatorLayout my ScrollView has an incorrect size

筅森魡賤 提交于 2019-11-28 22:22:43
I'm using a ScrollView in a layout, and am attempting to use the new CoordinatorLayout from the design support library . My layout file looks like this: <android.support.design.widget.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="match_parent"> <ScrollView android:layout_width="match_parent" android:layout_height="match_parent" app:layout_behavior="@string/appbar_scrolling_view_behavior"> <LinearLayout android:layout_width="match_parent" android:layout

android - support libraries 23.2.0 cause app to crash

坚强是说给别人听的谎言 提交于 2019-11-28 21:28:38
My app works well with support libraries 23.1.0 or 23.1.1, but when i start using 23.2.0 it crashes on launch. I use five support libraries, but the ones that seem to make it crash are these two: com.android.support:appcompat-v7:23.2.0 com.android.support:design:23.2.0 I have this issue on my galaxy nexus (API 17) but not on my Nexus 7 (API 22). Does anyone know what might be the problem? Here is my gradle file: apply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion "23.0.2" defaultConfig { applicationId "com.ikarirobotics.aichordfinder" minSdkVersion 15

how to remove left margin of Android Toolbar?

好久不见. 提交于 2019-11-28 21:09:37
I'm trying to use toolbar for my project. Here is the code I am using: <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:layout_alignParentTop="true" android:background="?attr/colorPrimary" android:contentInsetLeft="0dp" android:elevation="@dimen/margin_padding_8dp" android:contentInsetStart="0dp"> <RelativeLayout android:id="@+id/rlToolbar" android:layout_width="match_parent" android:layout_height="match_parent"> <TextView android:id="@+id/tvTitle" android:layout_width="wrap_content" android

Snackbar is not working within fragment class

不打扰是莪最后的温柔 提交于 2019-11-28 21:02:12
I am trying to show snackbar view when I click on button but it shows force close error when I click on button I have define fragment class below and also error log. I have fragment class: public class HomeFragment extends Fragment { @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_home, container, false); context = getActivity(); initUI(rootView); return rootView; } private void initUI(View view) { btn= (Button) view.findViewById(R.id.btnpress); btn.setOnClickListener(new View

Set initially selected item index/id in BottomNavigationView

梦想的初衷 提交于 2019-11-28 18:14:58
I have implemented BottomNavigationView and have no idea how to set selection index or MenuItem id (in my case, middle item should be selected by default). I'm afraid there's no such possibility for now as far as it's too raw yet, but anyways any help will be appreciated. Thanks! Set the selected menu item ID using setSelectedItemId : bottomNavigationView.setSelectedItemId(R.id.item_id); This method started being available from Android Support Library 25.3.0. The only solution that worked for me is: View view = bottomNavigationView.findViewById(R.id.menu_action_dashboard); view.performClick();

CollapsingToolbarLayout | Scrolling and layout issues 2

谁说胖子不能爱 提交于 2019-11-28 17:58:52
问题 Related Questions CollapsingToolbarLayout | Scrolling and layout issues Backgroud I want to use 2 different fragments that will allow me to change the layout based on orientation and screen size Header Image (Currently just an ImageView ) Scrollable content Issues The CollapsingToolbarLayout does not allow me to expand the Toolbar to see the full Header Image It shows a majority of the image, but not all. Top is cut, but the bottom is visible. The Toolbar is set to Pin but it is hidden when