package com.actionbarsherlock.tests.app;
import java.util.concurrent.CountDownLatch;
import android.os.Bundle;
import android.view.ViewGroup.LayoutParams;
import android.widget.TextView;
import com.actionbarsherlock.app.SherlockActivity;
public TextView customView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.blank);
}
final CountDownLatch latch = new CountDownLatch(1);
runOnUiThread(new Runnable() {
@Override
getSupportActionBar().setDisplayShowCustomEnabled(false);
customView = new TextView(FeatureCustomView.this);
customView.setText("Custom View!");
customView.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
getSupportActionBar().setCustomView(customView);
latch.countDown();
}
});
latch.await();
}
final CountDownLatch latch = new CountDownLatch(1);
runOnUiThread(new Runnable() {
@Override
getSupportActionBar().setDisplayShowCustomEnabled(true);
latch.countDown();
}
});
latch.await();
}
}