OSDN Git Service

Add new text display attribute for gles version number
authorSuchi Amalapurapu <asuchitra@google.com>
Fri, 5 Jun 2009 21:33:17 +0000 (14:33 -0700)
committerSuchi Amalapurapu <asuchitra@google.com>
Mon, 8 Jun 2009 17:02:52 +0000 (10:02 -0700)
apps/Development/res/layout/application_hw_pref.xml
apps/Development/res/values/strings.xml
apps/Development/src/com/android/development/AppHwPref.java

index 859c7ab..c38a0cb 100755 (executable)
         <TextView android:id="@+id/attr_five_way_nav"
             android:layout_width="fill_parent"
             android:layout_height="wrap_content"/>
+        <TextView android:id="@+id/attr_gles_version_label"
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            android:text="@string/gles_version_label"
+            android:textStyle="bold" />
+        <TextView android:id="@+id/attr_gles_version"
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"/>
     </LinearLayout>
 </ScrollView>
 
index 5c3c953..cdfdf40 100644 (file)
     <string name="hard_keyboard_label">hardKeyboard:</string>
     <string name="navigation_label">navigation:</string>
     <string name="five_way_nav_label">five way nav:</string>
+    <string name="gles_version_label">GLES Version:</string>
 </resources>
index bf0f84f..79add80 100644 (file)
@@ -54,6 +54,7 @@ public class AppHwPref extends Activity {
     private static final int TOUCHSCREEN = BASE + 1;
     private static final int KEYBOARD_TYPE = BASE + 2;
     private static final int NAVIGATION = BASE + 3;
+    private static final int GLES_VERSION = BASE + 4;
     
     @Override
     protected void onCreate(Bundle icicle) {
@@ -79,31 +80,32 @@ public class AppHwPref extends Activity {
         
         setContentView(R.layout.application_hw_pref);
         if(appHwPref != null) {
-               displayTextView(R.id.attr_package, pInfo.applicationInfo.loadLabel(mPm));
-               displayTextView(R.id.attr_touchscreen, appHwPref, TOUCHSCREEN);
-               displayTextView(R.id.attr_input_method, appHwPref, KEYBOARD_TYPE);
-               displayTextView(R.id.attr_navigation, appHwPref, NAVIGATION);
-               displayFlag(R.id.attr_hard_keyboard, ConfigurationInfo.INPUT_FEATURE_HARD_KEYBOARD, appHwPref);
-               displayFlag(R.id.attr_five_way_nav, ConfigurationInfo.INPUT_FEATURE_FIVE_WAY_NAV, appHwPref);
+            displayTextView(R.id.attr_package, pInfo.applicationInfo.loadLabel(mPm));
+            displayTextView(R.id.attr_touchscreen, appHwPref, TOUCHSCREEN);
+            displayTextView(R.id.attr_input_method, appHwPref, KEYBOARD_TYPE);
+            displayTextView(R.id.attr_navigation, appHwPref, NAVIGATION);
+            displayFlag(R.id.attr_hard_keyboard, ConfigurationInfo.INPUT_FEATURE_HARD_KEYBOARD, appHwPref);
+            displayFlag(R.id.attr_five_way_nav, ConfigurationInfo.INPUT_FEATURE_FIVE_WAY_NAV, appHwPref);
+           displayTextView(R.id.attr_gles_version, appHwPref, GLES_VERSION);
         }
     }
     
     void displayFlag(int viewId, int flagMask, ConfigurationInfo[] appHwPref) {
-       if(appHwPref == null) {
-               return;
-       }
-       boolean flag = false;
-       for (int i = 0; i < appHwPref.length; i++) {
-               ConfigurationInfo pref = appHwPref[i];
-               if((pref.reqInputFeatures & flagMask) != 0) {
-                       flag = true;
-                       break;
-               }
+        if(appHwPref == null) {
+            return;
+        }
+        boolean flag = false;
+        for (int i = 0; i < appHwPref.length; i++) {
+            ConfigurationInfo pref = appHwPref[i];
+            if((pref.reqInputFeatures & flagMask) != 0) {
+                flag = true;
+                break;
+            }
         }
         if(flag) {
             displayTextView(viewId, "true");
         } else {
-               displayTextView(viewId, "false");
+            displayTextView(viewId, "false");
         }
     }
     
@@ -140,6 +142,9 @@ public class AppHwPref extends Activity {
             case NAVIGATION:
                 str = getNavigationStr(config[i]);
                 break;
+            case GLES_VERSION:
+                str = config[i].getGlEsVersion();
+                break;
             }
             if(str != null) {
                 list.add(str);