android-support-library

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=

FragmentTabHost with drawable icon

*爱你&永不变心* 提交于 2019-12-18 09:24:12
问题 I have implemented tabs using FragmentTabHost in support package, but the drawable icon is not shown? How to show the drawable icon with FragmentTabHost? mTabs = (FragmentTabHost)findViewById(android.R.id.tabhost); mTabs.setup(this, getSupportFragmentManager(), R.id.realtabcontent); mTabs.addTab(mTabs.newTabSpec("chapter").setIndicator("Chapter",getResources(). getDrawable(R.drawable.chapter1)), ContentFragment.class, null); mTabs.addTab(mTabs.newTabSpec("section").setIndicator("section"

ClassNotFoundException “android.support.v4.graphics.drawable.DrawableWrapper”

寵の児 提交于 2019-12-18 08:27:30
问题 What can cause this error for class DrawableWrapper from the support lib? Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.graphics.drawable.DrawableWrapper" on path: DexPathList[[zip file "/data/app/com.example.banyan.tasty- 1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]] 回答1: Try updating your support library to 27.1.0. 回答2: Make sure all of your "com.android.support:*" dependencies are at the same version. Looks like one of the support

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

android can't load SupportV8 RenderScript in api <17

余生长醉 提交于 2019-12-18 05:08:21
问题 i just want to use RenderScript's ScriptIntrinsicBlur in my application , i've added renderscript.v8.jar (in android support lib v8) for supporting under 17 apis but it crashes on this line (in api <17 this happens it works fine on 4.2 or higher) : RenderScript rs = RenderScript.create(getApplicationContext()); and the Exception output is java.lang.RuntimeException: An error occured while executing doInBackground() at android.os.AsyncTask$3.done(AsyncTask.java:299) at java.util.concurrent

How to fix the Snackbar height and position?

独自空忆成欢 提交于 2019-12-18 04:13:30
问题 On Android Support Library 24.1.1 , the Snackbar was working fine: Then starting on Android Support Library 24.2.0 onwards, the Snackbar started to behave like this: On the library revision history, there is the following statement: Behavior changes: Snackbar now draws behind the navigation bar if the status bar is translucent. But the thing is that my app is full screen and it doesn't have the navigation bar or the status bar. How can I fix it? 回答1: Look this answer https://stackoverflow.com

23.2.0 set vector drawable as background in 4.X

不羁岁月 提交于 2019-12-18 03:17:26
问题 I am super excited about the new possibility to set vector drawables to layouts using the app:srcCompat="@drawable/icon" attribute introduced in support-library 23.2.0. But I wonder how I can fetch one of this drawables programmatically or set is as background. I thought about something like: ContextCompat.getDrawable(context, R.drawable.icon) Is this even possible? 回答1: Okay, I managed it myself. Thanks for @Budius for pointing me in the right direction. The Answers lays in VectorDrawable

Android Gradle build fails: Could not find com.google.android:support-v4:r18

允我心安 提交于 2019-12-18 03:11:19
问题 EDIT: This issue seemed to disappear by its own somehow, possibly due to the new Gradle build system becoming more mature. I have two separate Android projects: The 1st project is an Android Library using 'android-library' plugin for Gradle, which depends on the support-library-v4:r18 . Snippet from dependencies in build.gradle : compile 'com.android.support:support-v4:18.0.0' The support library is fetched from Android Support Repository installed via Android SDK Manager as explained here.

Snackbar in Support Library doesn't include OnDismissListener()?

邮差的信 提交于 2019-12-18 03:04:43
问题 I'd like to implement the new Snackbar included in the latest Design Support Library, but the way it is offered seems counter-intuitive for my, and I assume many others', use. When the user does an important action, I want to allow them to undo it via the Snackbar, but there seems to be no way to detect when it is dismissed to do the action. It makes sense to me to do it the following way: User does action. Show Snackbar and update UI as if the action has been completed (ie it appears that

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