android-5.0-lollipop

Adding Sliding Tabs using Support Library v7:21 with Toolbar in Android Developer Tools for existing project

天大地大妈咪最大 提交于 2019-12-18 12:26:33
问题 I have already read the information in this link: Use Tab with new ToolBar (AppCompat v7-21) and did a lot of research on the same. But the problem is the SlidingTabLayout project is using Gradle build files and structure. I want to add the tab layout using eclipse. How do I do this? I did run the SlidingTabLayout project in Android Studio though. But how do I add Tabs to Toolbar in v7:21? Note: All this needs to be done in a existing project, which has everything setup and warns me of the

Android Lollipop recents/multitasking header styling, text always black

久未见 提交于 2019-12-18 12:17:49
问题 It seems switching between Theme.AppCompat.Light.DarkActionBar and Theme.AppCompat.Light has no effect on the text color and "close" button inside the recents menu. colorPrimary changes the header color, but the text and button are always black. Any ideas? 回答1: For as far as I can tell you cannot change the color of the label text and close button because it is automatically set by the system. The only things that you can control are the icon, bar color, and label text via: Activity

Convert Android camera2 api YUV_420_888 to RGB

拜拜、爱过 提交于 2019-12-18 11:25:42
问题 I am writing an app that takes the camera feed, converts it to rgb, in order to do some processing. It works fine on the old camera implementation which uses NV21 Yuv format. The issue I am having is with the new Yuv format, YUV_420_888. The image is no longer converted correctly to RGB in the new Camera2 Api which sends YUV_420_888 yuv format instead of NV21 (YUV_420_SP) format. Can someone please tell me how should I convert YUV_420_888 to RGB? Thanks 回答1: In my approach I use OpenCV Mat

How can I place a ProgressBar at the right of the Toolbar?

…衆ロ難τιáo~ 提交于 2019-12-18 10:52:50
问题 With the new Lollipop API, we have to use a Toolbar if we want to personalize the action bar aspect. Adding a ProgressBar to the Toolbar is as simple as adding it to the Toolbar ViewGroup, as Chris Banes said. <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/material_green

Understanding necessity of Android VSYNC signals

做~自己de王妃 提交于 2019-12-18 10:29:36
问题 I'm trying to get a better understanding of the Android display subsystem, but one item that's still confusing to me is how VSYNC signals are handled, and why so many exist in the first place. Android is designed to use VSYNC at its core, but there are multiple VSYNC signals that it employs. Via https://source.android.com/devices/graphics/implement.html in the "VSYNC Offset" section, there is a flow diagram which diagrams three VSYNC signals: HW_VSYNC_0, VSYNC, and SF-VSYNC. I understand that

Android MediaCodec Encode and Decode In Asynchronous Mode

此生再无相见时 提交于 2019-12-18 10:29:22
问题 I am trying to decode a video from a file and encode it into a different format with MediaCodec in the new Asynchronous Mode supported in API Level 21 and up (Android OS 5.0 Lollipop). There are many examples for doing this in Synchronous Mode on sites such as Big Flake, Google's Grafika, and dozens of answers on StackOverflow, but none of them support Asynchronous mode. I do not need to display the video during the process. I believe that the general procedure is to read the file with a

Why do icons set with Notification.Builder.setSmallIcon in Android Lollipop show as a white square?

橙三吉。 提交于 2019-12-18 10:28:07
问题 I have this code: Notification notif; // Build notification Notification.Builder notifBuilder = new Notification.Builder(context); notifBuilder.setContentIntent(pendingIntent); notifBuilder.setContentTitle(title); notifBuilder.setSmallIcon(icon_resId); notifBuilder.setContentText(ne.getCaption()); notifBuilder.setDefaults(Notification.DEFAULT_ALL); notifBuilder.setAutoCancel(autocancel); notifBuilder.setWhen(System.currentTimeMillis()); notif = notifBuilder.build(); and works fine in Android

How can I style the SearchView when using a Toolbar as an Action Bar?

社会主义新天地 提交于 2019-12-18 10:22:31
问题 I'm using a Toolbar as an Action Bar in my app using the AppCompat v21 library, as described in this post on the Android Developers Blog. I've styled the action bar using the ThemeOverlay.AppCompat.Dark.ActionBar theme so that the text is light. However, I'd like to make the Action Bar SearchView 's search suggestion popup display dark text on a light background, and I've been unable to achieve this effect. Here's the XML for my Action Bar Toolbar : <android.support.v7.widget.Toolbar xmlns

Android L - Floating Action Button (FAB)

本秂侑毒 提交于 2019-12-18 09:59:31
问题 Did Google already released a defined style or a component for this new circular FAB button or should I implement the design on my own? The button is described here: Google Design | Floating Action Buttons EDIT (05/2015): Check Lukas' answer / Gabriele's answer showing an easy way to implement it with the design support library. 回答1: UPDATE : there's now an official widget for FAB: FloatingActionButton, see Gabriele Mariotti reply for full information. According to Adam Powell and Chet Haase

Getting error in google fit “Connection failed. Cause: ConnectionResult{statusCode=unknown status code 5005, resolution=null}”

被刻印的时光 ゝ 提交于 2019-12-18 08:46:08
问题 I have tried to develop application using google fit. I follow This link When i try to run that application i got the following error 10-27 11:55:19.966: I/Google Fit(6016): Connection failed. Cause: ConnectionResult{statusCode=unknown status code 5005, resolution=null} 10-27 11:55:19.966: E/GooglePlayServicesUtil(6016): Unexpected error code 5005 回答1: Finally i found that issues. We need to save the content in consent screen under oath and api 回答2: I had this error and the consent screen had