android-5.0-lollipop

Implementing Ripple effect outside ImageButton

微笑、不失礼 提交于 2019-12-30 01:37:09
问题 I am trying to implement ripple effect for ImageButton.I have set ripple in background and drawable image in the src for it. android:background="@drawable/myripplexml" android:src="@drawable/myimagepath" Its giving nice ripple effect inside button Layout. But I want Ripple effect to extend outside the Button Layout also.Another way to do it is using : android:background="?android:attr/selectableItemBackgroundBorderless" But it uses default color and style. How can I customize it regarding

Extending Preference classes in Android Lollipop = losing animation

人盡茶涼 提交于 2019-12-29 07:41:50
问题 Just for extending CheckBoxPreference or SwitchPreference on Android Lollipop, the widget (the checkbox or the switch) won't have animation anymore. I'd like to extend SwitchPreference to force api < 21 to use SwitchCompat instead of the default one they are using (which is obviously wrong). I am using the new AppCompatPreferenceActivity with appcompat-v7:22.1.1 but that doesn't seem to affect the switches. The thing is that with just extending those classes, without adding any custom layout

How to use Android-L preview Task Locking?

本小妞迷上赌 提交于 2019-12-29 05:23:45
问题 Has anyone got task locking working in Android L? Could they share some details on how it works? I have seen the instructions below, but struggling to understand this. At the moment I have made an App that I would like to run in kiosk mode. I have looked at making it a launcher App or using Surelock but the new task locking looks like it will be the best option in future. I need to create a userdebug build of Android L? I have not built Android from source before, I started looking at making

Some questions about GcmTaskService

戏子无情 提交于 2019-12-29 04:35:27
问题 Background I wanted to use the new JobScheduler API that was presented on Lollipop, but sadly it doesn't have an official port for pre-Lollipop. However, there is the GcmTaskService, which provides very similar functionalities. The problem This API is quite new, so there are very few places to look for information of how to use it (here and here, for example). The questions I have a few questions about this new API : It seems that it requires Google Play Services (here) to be used (except for

Some questions about GcmTaskService

泄露秘密 提交于 2019-12-29 04:35:12
问题 Background I wanted to use the new JobScheduler API that was presented on Lollipop, but sadly it doesn't have an official port for pre-Lollipop. However, there is the GcmTaskService, which provides very similar functionalities. The problem This API is quite new, so there are very few places to look for information of how to use it (here and here, for example). The questions I have a few questions about this new API : It seems that it requires Google Play Services (here) to be used (except for

AppCompat v7 Toolbar onOptionsItemSelected not called

孤人 提交于 2019-12-29 03:32:15
问题 I changed from the original ActionBar to the AppCompat Toolbar and setSupportActionBar(toolbar). When I am using getSupportActionBar() and setDisplayHomeAsUpEnabled(true) for the back arrow, the click never calls onOptionsItemSelected or any other listener method. Do I have to implement some special listener for it? Befor everything was working just fine. EDIT: Initialise the ActionBar: mToolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(mToolbar); mActionBar =

Screen pinning 3rd party apps programmatically

怎甘沉沦 提交于 2019-12-29 03:29:07
问题 After achieving device ownership, I am trying to implement a method to instruct the device to lock any given app into kiosk mode (or screen pinning mode). Since I have device ownership, the user is not asked for the permission to do so. From the developer website, brief description tells me that it is possible to do what I am trying: http://developer.android.com/about/versions/android-5.0.html#ScreenPinning Programmatically: To activate screen pinning programmatically, call startLockTask()

How can i exclude ActionBar when transitions between Activities on Android 5.0

亡梦爱人 提交于 2019-12-28 15:37:31
问题 On Android 5.0 Lollipop, I have two activities A and B. Activity B has a slie enter transition from bottom with a Overlay ActionBar, but when B shows, the ActionBar also slide from bottom to top. How can i prevent the actionbar from slide transition. does system actionbar has an id that i can add to the exclude target ? thanks! 回答1: If you are using the AppCompat v7 library, it is easy: View decor = getWindow().getDecorView(); int actionBarId = R.id.action_bar_container; enterTransition

initializeScrollbars is undefined?

时光毁灭记忆、已成空白 提交于 2019-12-28 06:32:08
问题 Background I'm using this library which for one of its classes (that extends from ViewGroup), in "PLA_AbsListView.java", inside the CTOR, there are those lines: final TypedArray a = context.obtainStyledAttributes(R.styleable.View); initializeScrollbars(a); a.recycle(); Recently, I've updated the SDK & ADT of Android to support the new Android version (Lollipop - API21) . The problem Ever since I've updated everything, I keep getting this error: The method initializeScrollbars(TypedArray) is

Cardview shadow not appearing in lollipop devices?

ぃ、小莉子 提交于 2019-12-28 04:00:16
问题 Am using the cardview in my android app. However the shadow is not showing. Here is the xml layout The default optionsmenu shadow also not showing. <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:card_view="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#ECEDF0" android:orientation="vertical"