android-support-library

Android accessibility service backwards compatibility and jelly bean

不想你离开。 提交于 2020-01-03 02:19:07
问题 I've got an app that uses the accessibility service to monitor for events. It's always worked fine in versions of android up to ICS, but with Jelly bean I'm not having much luck. As the documents mention I've added android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE" to my service in the manifest file. This causes the app to work fine using the declarative xml method for the xml. The problem is on backwards compatibility. For versions such as gingerbread I'm now getting the

ToolBar disappears when setting elevation for AppBarLayout

荒凉一梦 提交于 2020-01-02 23:14:01
问题 My ToolBar disappears when setting elevation for AppBarLayout . Here's the layout. <android.support.design.widget.AppBarLayout android:id="@+id/appbar" android:layout_width="match_parent" android:layout_height="@dimen/appbar_height" app:elevation="0dp" android:background="@color/transparent"> <android.support.v7.widget.Toolbar style="@style/ToolBarStyle" android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" app:elevation="0dp" android:background="

Android TV: VerticalGridFragment shadow dimension and color

我与影子孤独终老i 提交于 2020-01-02 05:46:12
问题 I'm working on an Android TV application but I'm not quite happy with the standard shadow rendered by the VerticalGridFragment , I'd like to have it smaller and a bit less darker. I've searched through the code but I didn't find any full working solution. In my VerticalGridPresenter subclass, the only method I can override is createShadowOverlayOptions but I can't get the result I want. The only workaround I came up with is to define the following dimensions, so that the ones declared in the

ViewPager setCurrentItem freezes UI thread

别说谁变了你拦得住时间么 提交于 2020-01-02 03:01:09
问题 I am using a ViewPager from Android support v13 and I'd like to scroll to a specific item using setCurrentItem(int) , but when I try to scroll more than 2 pages the application freezes, and after a few seconds the system shows an ANR window. I tried to increase the offscreen screen limit using setOffscreenPageLimit(2) , that way it did not freeze when i tried to scroll 2 pages, but did the same for 3 pages. My problem is that my fragments are pretty memory consuming so I would not like to

AppCompat v7 r21 changing Alpha of the ActionBar's title

别来无恙 提交于 2020-01-01 19:56:32
问题 With the previous versions of AppCompat it was easy to get the ActionBar 's title TextView and modify it. There is the method I was using: private TextView getActionBarTitleView() { int id = getResources().getIdentifier("action_bar_title", "id", "android"); return (TextView) findViewById(id); } And then to change the alpha's value of the title: getActionBarTitleView().setAlpha(ratio*255); Now for some reasons, "action_bar_title" with the lastest AppCompat version isn't working anymore. When I

How to access instance of MediaBrowserServiceCompat service?

岁酱吖の 提交于 2020-01-01 19:42:33
问题 I'm surprisingly struggling to get hold of the instance of a service which is derived from MediaBrowserServiceCompat . For a typical service, to achieve that, a local binder is used class MyService extends MediaBrowserServiceCompat { class MyBinder extends Binder { public MyService getService() { return MyService.this; } private final MyBinder binder = new MyBinder(); @Override public IBinder onBind(Intent intent) { return binder; } public void doMagic() { // <-- How to call this from

Android viewpager: weird bug when adding/removing page

末鹿安然 提交于 2020-01-01 14:40:13
问题 I dont know how to explain this, so i uploaded a video in Youtube. Everything works fine when i am adding pages. Also removing page works if i start at the end of the list and move progressively to the first page, but if i remove somewhere between 0-end and after that i add page, i am getting a blank page. Fragment is created but view is not. Is there something wrong with my code? Yes, i have seen this question, returning POSITION_NONE is not an option, because application i am working on

Method call mActionBar=getActionBar() gives error [closed]

家住魔仙堡 提交于 2020-01-01 11:51:12
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I am using support library android.support.v7.app.actionbar because i want action bar in api level 8 and above But following sentence gives me error like change mActionBar to ActionBar mActionBar=getActionBar(); My FragmentActivity in which I wnat to use ActionBar Tab is as follows import com.example

Gradle conflict when using admob 15.0.0 with the lastest support library

只愿长相守 提交于 2020-01-01 09:17:26
问题 I am using 'com.google.android.gms:play-services-ads:12.0.1'. and android support version 27.1.1. when I try to upgrade my ads library to the latest (15.0.0) I get an error saying that I must use the same version specification. See image below. Is there a way to use the latest version for both the supportLibraries and the play-services-ads ? Note that this problem does not exist when i use the play-services-ads version 12.0.1 回答1: You can try overriding the conflicted support library by

FloatingActionButton setVisibility() not working

谁都会走 提交于 2020-01-01 04:24:08
问题 I can't hide my FloatingActionButton . Here is my code: XML: <CoordinatorLayout> <AppBarLayout android:id="@+id/appbar"> <CollapsingToolbarLayout> <ImageView/> <android.support.v7.widget.Toolbar /> </CollapsingToolbarLayout> </AppBarLayout> <NestedScrollView /> <android.support.design.widget.FloatingActionButton android:id="@+id/fab" app:layout_anchor="@id/appbar" app:layout_anchorGravity="bottom|right|end"/> </CoordinatorLayout> And I'm calling: fab.clearAnimation(); fab.setVisibility(View