android-5.0-lollipop

how to gradually turn transparent action bar into solid color as user scrolls down

我与影子孤独终老i 提交于 2019-12-06 05:51:23
In recent android L apps ( lets say google i/o 2014 app) with material theme we have seen that if there is image view at top (followed by any kind of list), then to begin with the actionbar is transparent, then as the user scrolls down the actionbar gradually becomes solid color. 2 questions: 1. does this phenomenon have some name, if yes what is it? 2. how do i code to achieve this in an app for android L or is it default take a look here : https://github.com/ManuelPeinado/FadingActionBar second question : based on my researching until now, we have to implement it by code. it's called Fading

Install Apps from unknown sources inside work profile in Android Lollipop 5.0.1

孤街浪徒 提交于 2019-12-06 04:38:34
Question is related to Work Profile in " Android for work " . I have written a sample app that creates a managed work profile and sets itself as the profile owner . I will need to push some enterprise applications through the profile owner . So when i try to install , it says "Install blocked" , Cannot install from unknown sources . If i toggle the button ( Setting->security->Unknown Source ) on and off , settings are not getting reflected in the work profile. Is there a way to install the apps in work profile from unknown sources ? Perhaps it could be resolved with future updates, but as of

Android Lollipop BLE scan - getting peripherals without duplications

て烟熏妆下的殇ゞ 提交于 2019-12-06 04:29:15
问题 Android Lollipop introduced a new way to scan for BLE peripherals, via BluetoothLeScanner. From what I read, the new scanning API solved an issue that happened with the old scanning API (BluetoothAdapter.startLeScan(UUID[],LeScanCallback)) where on some devices the callback ( onLeScan ) was called only once per peripheral, even if the peripheral keeps advertising. This issue is handled on iOS with the CBCentralManagerScanOptionAllowDuplicatesKey option, that allows you to choose whether you

android ripple button with background

纵饮孤独 提交于 2019-12-06 03:49:28
问题 I successfully created a ripple button in android 5.0 using XML. My code is as follows: <?xml version="1.0" encoding="utf-8"?> <!-- the flat button to be used in app --> <!-- define the ripple --> <ripple xmlns:android="http://schemas.android.com/apk/res/android" android:color="?android:colorControlHighlight"> <!-- the ripple object --> <item android:id="@android:id/mask"> <!-- button shape (w/ radius) --> <shape android:shape="rectangle"> <!-- radius of vertices --> <corners android

Is there a way to share a same LayoutManager between multiple nested RecyclerViews

ⅰ亾dé卋堺 提交于 2019-12-06 03:29:26
问题 I'm developing an application that showing a game list, inside every game's itemView, i also have a video list to be showing. preview and structure are following. I deploy a RecyclerView as the window root view, and then for the videos, i used grid-style RecyclerView to display, so here we got a nested RecyclerView structure. But there is trouble because the number of videos is inconsistent between games, i don't want the RecyclerView of video list able to being scroll, so the best way is

Get foreground activity from package name?

孤者浪人 提交于 2019-12-06 03:18:53
I am trying to get running activity name (Foreground activity name) from package name as you all know that we can get currently running activity name via this line mActivityManager.getRunningTasks(1).get(0).topActivity.getClassName() but this work only bellow android 5.0 i need same thing in above 5.0 i am able to get current package name but not activity security is enhanced from android Lollipop; see this article for more details: getAppTask You could get foreground activities via UsageStats class; first, you have to add this permission in your manifest: <uses-permission android:name=

Style inheritance of extended Widget

风流意气都作罢 提交于 2019-12-06 03:17:08
问题 In my project (Target API 21 with AppCompat support), I need to extend the EditText class. My problem is MyEditText class does not inherit EditText style customized with: <style name="AppTheme" parent="@style/Theme.AppCompat.Light.NoActionBar" > <item name="colorPrimary">@color/primary</item> <item name="colorControlNormal">@color/grey_light</item> <item name="colorControlActivated">@color/primary</item> <item name="colorControlHighlight">@color/primary</item> </style> with @color/primary

java.lang.StackOverflow Error for Android L preview running art

百般思念 提交于 2019-12-06 03:07:31
Jumping straight to the topic, Android L introduces a ART as default runtime. I have a Sample Application, basically a document viewer. Most of the document viewing code including back buttons, Search,etc are written in C and the Android App uses JNI interface. I updated my code to make it build for Android L and it seems to open the document just fine. However, when pressing back button and closing the document, the Application seem to crash and the following backtrace is seen: I/DEBUG ( 1390): Abort message: 'art/runtime/check_jni.cc:65] JNI DETECTED ERROR IN APPLICATION: JNI CallIntMethodV

Android get UsageStatsManager in API level 21

情到浓时终转凉″ 提交于 2019-12-06 02:46:10
I need to get info about recent apps usage. Before API 21 it was used getRunningTasks or getRecentTasks to get this info. These methods were deprecated in API 21 according docs. There is UsageStatsManager class now, introduced in API level 21. But! Context.getSystemService(UsageStatsService) was added only in API level 22! The question is - how to get needed data in API 21 ?? According dashboards , there is 13% of users at this API level, I don't wanna lose them. Well Context#getSystemService(...) was introduced in API level 1 but Contexts' USAGE_STATS_SERVICE String was introduced in API

How to make Android List View Design from Android L Preview Design

隐身守侯 提交于 2019-12-06 02:44:24
问题 I make Android L preview image style list item. This is my code for these similar design. // Drawable/list_item_bg.xml <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <item> <shape android:shape="rectangle"> <solid android:color="#E6E6E6" /> </shape> </item> <item android:bottom="1dp"> <shape android:shape="rectangle"> <solid android:color="#FAFAFA" /> </shape> </item> </layer-list> //Drawable/list_icon_bg <shape xmlns:android=