android-4.2-jelly-bean

Alternative to setAlpha in api level 8

大兔子大兔子 提交于 2019-11-30 14:38:46
问题 I am working on an app, which can run on Froyo as well as JellyBean . I have a class that extends PageTransformer as below: import android.support.v4.view.ViewPager.PageTransformer; import android.view.View; public class ZoomOutPageTransformer implements PageTransformer { private static float MIN_SCALE = 0.85f; private static float MIN_ALPHA = 0.5f; public void transformPage(View view, float position) { int pageWidth = view.getWidth(); int pageHeight = view.getHeight(); if (position < -1) {

Issue with ComposeShader on Android 4.1.1

十年热恋 提交于 2019-11-30 11:29:10
I'm just trying to implement a color picker for my android application, and ran into a strange issue on Android 4.1.1. The following code does not create the expected gradients on Android 4.1.1, but it does on 2.3.7: Shader fadeInRight = new LinearGradient(0, 0, pWidth, 0, 0x00000000, 0xFF000000, Shader.TileMode.CLAMP); Shader blackToWhite = new LinearGradient(0, 0, 0, pHeight, 0xFF000000, 0xFFFFFFFF, Shader.TileMode.CLAMP); Shader whiteMask = new ComposeShader(blackToWhite, fadeInRight, PorterDuff.Mode.DST_IN); Shader blackToColor = new LinearGradient(0, 0, pWidth, 0, 0xFF000000, hue, Shader

Android: Android 4.1 Emulator Invoking onDateSet Twice from DatePicker Dialog

喜你入骨 提交于 2019-11-30 11:12:34
My application was working perfectly on my Android 2.2 emulator. I then decided to test on an Android 4.1 emulator. The DatePickerDialog looks a little different and for some reason when I press on "Done", the onDateSet() listener gets called twice and causes problems in my application. I know this because the log shown below in the code is printed twice whenever I click on "Done" mDateSetListener = new DatePickerDialog.OnDateSetListener() { @Override public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) { Log.v("onDateSet", "ENTERED"); //rest of code... }}; Android

Alternative to setAlpha in api level 8

a 夏天 提交于 2019-11-30 11:11:56
I am working on an app, which can run on Froyo as well as JellyBean . I have a class that extends PageTransformer as below: import android.support.v4.view.ViewPager.PageTransformer; import android.view.View; public class ZoomOutPageTransformer implements PageTransformer { private static float MIN_SCALE = 0.85f; private static float MIN_ALPHA = 0.5f; public void transformPage(View view, float position) { int pageWidth = view.getWidth(); int pageHeight = view.getHeight(); if (position < -1) { view.setAlpha(0); } else if (position <= 1) { float scaleFactor = Math.max(MIN_SCALE, 1 - Math.abs

jelly bean search key

ぐ巨炮叔叔 提交于 2019-11-30 09:42:45
In my Android app I enable my specific app-search to be triggered via the search key in a number of my activities using this mechanism from the manifest <meta-data android:name="android.app.default_searchable" android:value=".Search.SearchActivity" /> with the appropriate search activity. This all worked fine until recently. With the Jelly Bean update the Search Key now always starts Google NOW search functionality. On this site: http://www.android.com/about/jelly-bean/ I found in the "Google Search" section this statement: "For devices with a hardware search key, you can tap it to launch

Android UserManager: Check if user is owner (admin)

ε祈祈猫儿з 提交于 2019-11-30 09:35:16
Im developing an app with the latest android version (4.2.1 API-Level 17) for tablets with multiuser capabilities. I want to restrict certain features (like the access to the app preferences) to the owner of the tablet (that is the user who can add and remove other user accounts) is there any way i can find out if the current user is the owner? i read through the UserManager and UserHandle API docs but couldn't find a function that allows me to check for it. have i missed something or is there another way to do that? Similar but without reflection: static boolean isAdminUser(Context context) {

Jelly Bean webview app does not respond to touchend events perfectly

梦想与她 提交于 2019-11-30 07:37:42
My webview app works fine with touchend events in android version older than Jelly Bean. But in Jelly Bean, the touchend events are not reliable. Especially on divs that are scrollable, the touchend events are not fired sometimes and the whole app stops responding to any touchend events and I get the Log message with the tag "webcoreglue" and text "Should not happen: no rect-based-test nodes found" Now after i scroll even little bit, it starts responding to touchend normally. Pls help. HTML <div id="srpanel" class="panel"> <div class="main sr-list"> <div class="sr-list-item-action"> </div> <

Android: Programatically trigger text selection mode in a WebView on Jelly Bean

社会主义新天地 提交于 2019-11-30 05:00:09
问题 I need to programatically trigger text selection mode in a WebView, but the code I have used does not work on Jelly Bean? I have been using the following code but it no longer works on Android 4.1 (Jelly Bean) because WebView.selectText, emulateShiftHeld, and the key dispatch are no longer supported on Jelly Bean. Following code that works on all versions up to ICS is based on: How to enable the default highlight menus in android webview? public void selectAndCopyText() { try { // ICS WebView

Issue with ComposeShader on Android 4.1.1

独自空忆成欢 提交于 2019-11-29 17:02:48
问题 I'm just trying to implement a color picker for my android application, and ran into a strange issue on Android 4.1.1. The following code does not create the expected gradients on Android 4.1.1, but it does on 2.3.7: Shader fadeInRight = new LinearGradient(0, 0, pWidth, 0, 0x00000000, 0xFF000000, Shader.TileMode.CLAMP); Shader blackToWhite = new LinearGradient(0, 0, 0, pHeight, 0xFF000000, 0xFFFFFFFF, Shader.TileMode.CLAMP); Shader whiteMask = new ComposeShader(blackToWhite, fadeInRight,

wifiLock and wakeLock not working correctly on Android

故事扮演 提交于 2019-11-29 15:14:42
I am developing an app that needs to use both wifiLock and wakeLock so the audio streaming when the screen is off does not get disturbed. I have tried my app on Android 2.3 and wakeLock and looks like wifiLock work as expected so there is no difference between when the screen is on or off, but the same app on Android 4.2 (Jelly-bean) when the screen goes off is not working as well and the audio gets choppy which shows either wakeLock or wifiLock are not working correctly. Is there any reason for this? Here is how I acquire and release the locks, in my main activity I have: @Override public