use of android.app.ActionBar in project Anki-Android by Ramblurr.
the class CompatV11 method setSubtitle.
@Override
public void setSubtitle(Activity activity, String title, boolean inverted) {
ActionBar ab = activity.getActionBar();
if (ab != null) {
if (inverted) {
CharacterStyle span = new ForegroundColorSpan(activity.getResources().getColor(inverted ? R.color.white : R.color.black));
SpannableStringBuilder ssb = new SpannableStringBuilder(title);
ssb.setSpan(span, 0, ssb.length(), 0);
ab.setSubtitle(ssb);
} else {
ab.setSubtitle(title);
}
}
}
use of android.app.ActionBar in project Anki-Android by Ramblurr.
the class CompatV11 method setTitle.
@Override
public void setTitle(Activity activity, String title, boolean inverted) {
ActionBar ab = activity.getActionBar();
if (ab != null) {
CharacterStyle span = new ForegroundColorSpan(activity.getResources().getColor(inverted ? R.color.white : R.color.black));
SpannableStringBuilder ssb = new SpannableStringBuilder(title);
ssb.setSpan(span, 0, ssb.length(), 0);
ab.setTitle(ssb);
}
}
use of android.app.ActionBar in project android-menudrawer by SimonVT.
the class ActionBarHelperNative method setActionBarDescription.
public static void setActionBarDescription(Object info, Activity activity, int contentDescRes) {
final SetIndicatorInfo sii = (SetIndicatorInfo) info;
if (sii.setHomeAsUpIndicator != null) {
try {
final ActionBar actionBar = activity.getActionBar();
sii.setHomeActionContentDescription.invoke(actionBar, contentDescRes);
} catch (Throwable t) {
if (ActionBarHelper.DEBUG)
Log.e(TAG, "Couldn't set content description via JB-MR2 API", t);
}
}
}
use of android.app.ActionBar in project Android-Developers-Samples by johnjohndoe.
the class DoneButtonActivity method onCreate.
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// BEGIN_INCLUDE (inflate_set_custom_view)
// Inflate a "Done" custom action bar view to serve as the "Up" affordance.
final LayoutInflater inflater = (LayoutInflater) getActionBar().getThemedContext().getSystemService(LAYOUT_INFLATER_SERVICE);
final View customActionBarView = inflater.inflate(R.layout.actionbar_custom_view_done, null);
customActionBarView.findViewById(R.id.actionbar_done).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// "Done"
finish();
}
});
// Show the custom action bar view and hide the normal Home icon and title.
final ActionBar actionBar = getActionBar();
actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM, ActionBar.DISPLAY_SHOW_CUSTOM | ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_SHOW_TITLE);
actionBar.setCustomView(customActionBarView);
// END_INCLUDE (inflate_set_custom_view)
setContentView(R.layout.activity_done_button);
}
use of android.app.ActionBar in project TextureViewDemo by dalinaum.
the class CameraSurfaceTextureListener method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.content);
ActionBar actionBar = getActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
final AdView adView = new AdView(this, AdSize.SMART_BANNER, "a1513f5a0d88abc");
final FrameLayout adContainer = (FrameLayout) findViewById(R.id.adContainer);
adContainer.addView(adView);
AdRequest adRequest = new AdRequest();
// adRequest.addTestDevice(AdRequest.TEST_EMULATOR);
adView.loadAd(adRequest);
mCameraSurfaceTextureListener = new CameraSurfaceTextureListener(this);
mTextureView = (TextureView) findViewById(R.id.texture_view);
mTextureView.setSurfaceTextureListener(mCameraSurfaceTextureListener);
}
Aggregations