Merge change 3351 into donut

* changes:
  Add new text display attribute for gles version number
This commit is contained in:
Android (Google) Code Review
2009-06-09 09:23:51 -07:00
3 changed files with 31 additions and 17 deletions

View File

@@ -77,6 +77,14 @@
<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>

View File

@@ -119,4 +119,5 @@
<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>

View 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);