Gallery android:unselectedAlpha works strangely

by arnouf » Sat, 27 Mar 2010 20:47:39 GMT


Sponsored Links
 Hi all,

I work with a gallery and a BaseAdapter.
In my XML file I specified, on my gallery, android:unselectedAlpha.
When I select an item (using click or pad) image are moved but they
take the alpha defined for (normally) the unselected image.

Do you have any idea ?

--



Other Threads

1. Improve monkey to exclude some component in test

Hi,
I encounter a annoied issue when using "adb shell monkey" to test
stability of my hardward. Monkey enters setting-->usb setting to
change "engineering mode (ADB)" to "mass storage mode" randomly. After
that, my desktop loses control of device. Unfortunately, there is no
interface in monkey to filter out a specific activity, soI add it
myself. The new "-x" option is used to indicate which component
(package/class) shall be filtered out. Below is the patch. Now, I want
to know if it's a correct way to resolve such issue?

Thx.

diff --git a/cmds/monkey/src/com/android/commands/monkey/Monkey.java
b/cmds/monkey/src/com/android/commands/monkey/Monkey.java
index 00fb40c..e36ded8 100644
--- a/cmds/monkey/src/com/android/commands/monkey/Monkey.java
+++ b/cmds/monkey/src/com/android/commands/monkey/Monkey.java
@@ -102,6 +102,8 @@ public class Monkey {

     /** Packages we are allowed to run, or empty if no restriction. */
     private HashSet<String> mValidPackages = new HashSet<String>();
+    /** Packages we are forbidden to run, or empty if no restriction. */
+    private HashSet<String> mExcludeComponent = new HashSet<String>();
     /** Categories we are allowed to launch **/
     ArrayList<String> mMainCategories = new ArrayList<String>();
     /** Applications we can switch to. */
@@ -136,7 +138,8 @@ public class Monkey {
      */
     private class ActivityWatcher extends IActivityWatcher.Stub {
         public boolean activityStarting(Intent intent, String pkg) {
-            boolean allow = checkEnteringPackage(pkg) ||
(DEBUG_ALLOW_ANY_STARTS != 0);
+            boolean allow = (checkEnteringIntent(intent) &&
+                    checkEnteringPackage(pkg)) ||
(DEBUG_ALLOW_ANY_STARTS != 0);
             if (mVerbose > 0) {
                 System.out.println("    // " + (allow ? "Allowing" :
"Rejecting")
                         + " start of " + intent + " in package " + pkg);
@@ -167,6 +170,20 @@ public class Monkey {
                 return mValidPackages.contains(pkg);
             }
         }
+
+        private boolean checkEnteringIntent(Intent intent) {
+            if (intent == null) {
+                return true;
+            }
+            System.out.println("checkEnteringIntent, Intent: " +
+                     intent.getComponent().flattenToString());
+            // preflight the hash lookup to avoid the cost of hash
key generation
+            if (mExcludeComponent.size() == 0)  {
+                return true;
+            } else  {
+                return
!mExcludeComponent.contains(intent.getComponent().flattenToString());
+            }
+        }

         public boolean appCrashed(String processName, int pid, String shortMsg,
                 String longMsg, byte[] crashData) {
@@ -474,6 +491,8 @@ public class Monkey {
                     mSeed = nextOptionLong("Seed");
                 } else if (opt.equals("-p")) {
                     mValidPackages.add(nextOptionData());
+                } else if (opt.equals("-x")) {
+                    mExcludeComponent.add(nextOptionData());
                 } else if (opt.equals("-c")) {
                     mMainCategories.add(nextOptionData());
                 } else if (opt.equals("-v")) {
@@ -886,6 +905,7 @@ public class Monkey {
      */
     private void showUsage() {
       System.err.println("usage: monkey [-p ALLOWED_PACKAGE [-p
ALLOWED_PACKAGE] ...]");
+      System.err.println("              [-x EXCLUDE_COMPONENT [-x
EXCLUDE_COMPONENT] ...]");
       System.err.println("              [-c MAIN_CATEGORY [-c
MAIN_CATEGORY] ...]");
       System.err.println("              [--ignore-crashes]
[--ignore-timeouts]");
       System.err.println("
[--ignore-security-exceptions] [--monitor-native-crashes]");

--~--~---------~--~----~------------~-------~--~----~

2. How can I know whether SIP(Soft Input Panel - Keyboard view) is showing or not

In landscape, the default IME goes into fullscreen mode, so it covers your
UI instead of resizing it.  (Other IMEs may do different things, this
behavior is just up to the IME.)








-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~---------~--~----~------------~-------~--~----~

3. is it possible to save an mp3 from my applications raw folder onto the sdcard?

4. graphics speciall effects

5. How to get root access of my android phone

6. Animated window transitions in Android 1.5

7. is it possible to save an mp3 from my applications raw folder onto the sdcard?