android-support-library

Android BottomSheetBehavior, how to disable snap?

ぐ巨炮叔叔 提交于 2019-12-22 09:59:29
问题 Standard android BottomSheetBehavior has tree state: hidden, collapsed and expanded. I want to allow user to "leave" bottom sheet between collapsed and expanded. Now, with the default behavior, it will snap to collapsed or expanded based which is closest. How should I disable this snap functionality? 回答1: I will present a way to achievie such functionality for a View extending BottomSheetDialogFragment . Expanding: First of all overrive onResume : @Override public void onResume() { super

ShareActionProvider from support v7 library doesn´t work

China☆狼群 提交于 2019-12-22 09:21:38
问题 I am trying to implement ShareActionProvider using support library from this tutorial http://developer.android.com/reference/android/support/v7/widget/ShareActionProvider.html Somehow it just doesn´t work as expected. Below is my code: menu xml file: <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:myapp="http://schemas.android.com/apk/res-auto" > <item android:id="@+id/action_favorite" android:icon="@drawable/ic_favorite" myapp

Custom Support Dialog Fragment text is the wrong color

萝らか妹 提交于 2019-12-22 07:09:37
问题 If I put a TextView in a custom dialog box, the text will be black by default. Unfortunately, the support fragment dialogs backgrounds are dark gray. Black on gray is very hard to read. I could change the TextView to white or something like android:textColor="?android:attr/textColorPrimaryInverseDisableOnly" . But the dialog boxes on the new android (Holo Light) are white. So it will be white on white. I could use a hack like forcing it to be white on old versions of Android and forcing it to

Failed to find: com.android.support:support-v4:22.2.0

随声附和 提交于 2019-12-22 05:29:27
问题 I am trying to do an application but there seems to be some error with the gradle files now. It was working fine until I upgraded the support libraries. I was working with api 21 which worked fine, but then i upgraded to api22 and changed the gradle files accordingly.. Now this error shows up. Error:Failed to find: com.android.support:support-v4:22.2.0 This is my current gradle file : apply plugin: 'com.android.application' android { compileSdkVersion 22 buildToolsVersion "22.0.1"

PercentRelativeLayout - layout_width missing warning

谁说我不能喝 提交于 2019-12-22 05:10:24
问题 I'm trying out PercentRelativeLayout from the support library, and the docs just ask me to specify an app:layout_widthPercent property. However, when I do that, Android Studio gives me a red warn saying that the layout_width is unspecified. Other than suppressing the warning, is there a way around this? For example: <android.support.percent.PercentRelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <android.support.design.widget.TextInputLayout android:id=

Android autosizing TextViews split up words before decreasing font size

ぃ、小莉子 提交于 2019-12-22 04:35:31
问题 Is there a way to avoid it? If my text is "Blablabla" and it doesn't fit in a square, I don't want to have something like: Blabla- bla I want "Blablabla" with a smaller font size. Is there a way to control whether the autosizing TextView will split up words or not? Here's an example of the issue: The minimum text size there is 1sp , so it's pretty clear the word could fit with a decreased text size. It seems this has been reported: https://issuetracker.google.com/issues/38468964 回答1: I've

rendering error; couldn't resolve @id/search_edit_frame

此生再无相见时 提交于 2019-12-22 04:12:12
问题 I am having an error that says couldn't resolve @id/search_edit_frame I don't know why, I tried the File>Invalidate Caches> Just Restart and restart android studio also tried to change the render version all of my supported api.. <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" myapp="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.v7.widget

rendering error; couldn't resolve @id/search_edit_frame

梦想与她 提交于 2019-12-22 04:11:18
问题 I am having an error that says couldn't resolve @id/search_edit_frame I don't know why, I tried the File>Invalidate Caches> Just Restart and restart android studio also tried to change the render version all of my supported api.. <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" myapp="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.v7.widget

@IntDef annotation and return value from other's code that cannot be annotated or how to temporarily disable annotation from affecting the code?

安稳与你 提交于 2019-12-22 03:51:06
问题 I am using IntDef from Android Support annotation in my code (but my question is wider in scope so please keep reading :) like this: public class UiLockMode { @IntDef({DEFAULT, NONE, VISIBLE, TRANSPARENT}) @Retention(RetentionPolicy.SOURCE) public @interface AllowedValues {} public static final int DEFAULT = 0; public static final int NONE = 1; public static final int VISIBLE = 2; public static final int TRANSPARENT = 3; } Next, I got some other methods annotated with it like this: protected

Flaky Android Espresso Test - Snackbar

自闭症网瘾萝莉.ら 提交于 2019-12-22 01:53:55
问题 1) All devices/emulators being tested have animations disabled. 2) I have an @BeforeClass which builds my Credentials object. 3) I have an IntenServiceIdlingResource and an EventBusIdlingResource, registered in @Before. 4) When the sign in button is clicked, the IntentService fires off. In this case, the server (a mocked server) is returning a 500 error. That information is posted back to the UI from the IntentService, via greenrobot's EventBus, and a Snackbar is shown with the error message.