Methods Summary |
---|
private void | buildSpinnerLayout()
LinearLayout layout = (LinearLayout) findViewById(R.id.spinner_layout);
String[][] mapsStrings = DisplayModifier.getStrings();
mSpinners = new Spinner[mapsStrings.length];
int index = 0;
for (String[] spinnerValues : mapsStrings) {
mSpinners[index] = new DisplayModifierSpinner(index);
mSpinners[index].setAdapter(new ArrayAdapter<String>(this,
android.R.layout.simple_spinner_dropdown_item, spinnerValues));
layout.addView(mSpinners[index]);
index++;
}
Log.d(LOG_TAG, "created " + index + " spinners");
|
protected boolean | forceRecreateBitmaps()
// continually recreate bitmaps to avoid modifying bitmaps currently being drawn
return true;
|
protected void | onCreate(android.os.Bundle savedInstanceState)
super.onCreate(savedInstanceState);
setContentView(R.layout.manual_layout);
onCreateCommon(mRunnable);
mSoftwareView = (MainView) findViewById(R.id.software_view);
mSoftwareView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
mSoftwareView.setBackgroundColor(Color.WHITE);
mSoftwareView.addDrawCallback(mDrawCallback);
mCompareImageView = (ImageView) findViewById(R.id.compare_image_view);
int width = getResources().getDimensionPixelSize(R.dimen.layer_width);
int height = getResources().getDimensionPixelSize(R.dimen.layer_height);
mCompareBitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
mErrorTextView = (TextView) findViewById(R.id.current_error);
((ImageButton) findViewById(R.id.next)).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
DisplayModifier.step();
updateSpinners();
redrawViews();
}
});
((ImageButton) findViewById(R.id.previous)).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
DisplayModifier.stepBack();
updateSpinners();
redrawViews();
}
});
((Button) findViewById(R.id.show_hardware_version))
.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
mCompareImageViewState = COMPARE_VIEW_HARDWARE;
mHandler.post(mRunnable);
}
});
((Button) findViewById(R.id.show_software_version))
.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
mCompareImageViewState = COMPARE_VIEW_SOFTWARE;
mHandler.post(mRunnable);
}
});
((Button) findViewById(R.id.show_error_heatmap)).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
mCompareImageViewState = COMPARE_VIEW_HEATMAP;
mHandler.post(mRunnable);
}
});
buildSpinnerLayout();
|
private void | redrawViews()
mHardwareView.invalidate();
mSoftwareView.invalidate();
|
private void | updateSpinners()
int[] indices = DisplayModifier.getIndices();
for (int i = 0; i < mSpinners.length; i++) {
mSpinners[i].setSelection(indices[i]);
}
|