android-support-design

How do I change the default height of a BottomSheetDialog?

≯℡__Kan透↙ 提交于 2019-12-18 10:16:12
问题 I've been using the new BottomSheetDialog added in Support Library 23.2, but I want to change the default height of the dialog. I know it probably has to do with the behavior_peekHeight attribute which controls the initial height, but how do I set that in the BottomSheetDialog when I don't have direct access to the BottomSheetBehavior ? 回答1: You can set a bottomSheetDialogTheme in your Activity, overriding the bottomSheetStyle attribute's behavior_peekHeight : <style name="AppTheme" parent=

View can not be anchored to the the parent CoordinatorLayout

百般思念 提交于 2019-12-18 05:35:46
问题 this is not my app, this is nordic app that put its source on github and I am trying to run the soutce on my machine. but i keep having this error : 03-07 07:12:13.641 12622-12622/com.noxel.apppaneladmintry2 E/AndroidRuntime﹕ FATAL EXCEPTION: main Process: com.noxel.apppaneladmintry2, PID: 12622 java.lang.IllegalStateException: View can not be anchored to the the parent CoordinatorLayout at android.support.design.widget.CoordinatorLayout$LayoutParams.resolveAnchorView(CoordinatorLayout.java

How to set the elevation of an AppBarLayout programmatically in the Android Support Library v24.0.0?

余生长醉 提交于 2019-12-18 02:12:11
问题 When upgrading from the Android Support Library v23.4.0 to v24.0.0, setting the elevation to 0 programmatically to an AppBarLayout stopped working: appBayLayout.setElevation(0); It does work when setting the elevation in the XML. 回答1: Edit The AppBarLayout from v24.0.0 uses a StateListAnimator that defines the elevation depending on its state. So using setElevation will have no effect if a StateListAnimator is being used (which happens by default). Set the elevation via the XML or

Android CollapsingToolbarLayout Title background

与世无争的帅哥 提交于 2019-12-17 23:29:11
问题 I'm working with the CollapsingToolbarLayout from the new Android Design Support Library. I have set its title and it is working fine, the only problem I still have is that when you scroll, the text is lost, depending on the image in the background. What I'd like to do, is set a background to the CollapsingToolbarLayout title, but I haven't find a way to do it. Is there anyway to achieve this? Thanks! Layout: <android.support.design.widget.CoordinatorLayout android:id="@+id/main_content"

Android BottomSheetDialogFragment does not expand completely

谁说胖子不能爱 提交于 2019-12-17 22:47:07
问题 I have the following test bottom sheet implementation. When I set the peekHeight to a value less than 500, it works. After some value, any increase in peek height will not change how the bottom sheet is expanded. It Just remains there to only drag manually. How do we set the peekHeight programmatically to ensure that the bottom sheet is auto expanded to the peek height. bottom_sheet_dialog_main <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns

Error inflating class CollapsingToolbarLayout

夙愿已清 提交于 2019-12-17 10:44:54
问题 My CollapsingToolbarLayout crashes because of Error inflating class android.support.design.widget.CollapsingToolbarLayout. I updated the android studio last weekend. Before the updated, it works fine. After I updated it, it crashed. However, I tried to downgrade it to 2.0.0 version and it's not working anymore. My coworker has no problem with the CollapsingToolbarLayout. I am not sure what happened. The error was: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test

AAPT: error: resource android:attr/fontVariationSettings not found and resource android:attr/ttcIndex not found

允我心安 提交于 2019-12-17 06:56:07
问题 I m currently working on an android project, so when I upgrade the project from android targetSdkVersion 21 to 27, the project won't work. so if there's anyone here who can help me to fix that problem. I m using mac os 10.12. this app/build.gradle : apply plugin: 'com.android.application' apply plugin: 'org.greenrobot.greendao' android { compileSdkVersion 27 buildToolsVersion "27.0.3" defaultConfig { applicationId "ma.oujda.ifdose" minSdkVersion 21 targetSdkVersion 27 versionCode 1

How to hide ToolBar when i scrolling content up in android

强颜欢笑 提交于 2019-12-17 05:02:00
问题 I am trying to hide my tool bar when i scroll my text and image with content , here i use scrollView for getting scroll content when ,when i scroll content up how to hide tool bar please any one tell me how to get here my XMl code content_main.XML <android.support.v4.widget.NestedScrollView xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" xmlns:android="http://schemas.android.com/apk/res/android" app:layout_behavior="

Android - Should pass resolved color instead of resource id here: `getResources().getColor(R.attr.colorPrimary)`

家住魔仙堡 提交于 2019-12-13 12:42:58
问题 I am following this tutorial Flexibal Space with Image For design pattern for a toolbar called Flexibal Space with Image in android. While using Palette here I am stuck in following error in java file causing application to crash. Should pass resolved color instead of resource id here: `getResources().getColor(R.attr.colorPrimary)` Follwing is my java file YoutubeActivity.java public class YoutubeActivity extends AppCompatActivity { Toolbar toolbar; CollapsingToolbarLayout collapsingToolbar;

Multiple checkable groups in NavigationDrawer stopped working after upgrading support design library

心不动则不痛 提交于 2019-12-13 01:04:27
问题 I am using NavigationView to display menu.xml data to my NavigationDrawer. It had two groups of checkable items. The first group could have any number of items checked at the same time, the second one could have only one checked. Support library versions used: compile 'com.android.support:appcompat-v7:22.2.1' compile 'com.android.support:design:22.2.0' xml code used for NavigationView <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns