Search in sources :

Example 46 with ActionBar

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);
        }
    }
}
Also used : ForegroundColorSpan(android.text.style.ForegroundColorSpan) ActionBar(android.app.ActionBar) CharacterStyle(android.text.style.CharacterStyle) SpannableStringBuilder(android.text.SpannableStringBuilder)

Example 47 with ActionBar

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);
    }
}
Also used : ForegroundColorSpan(android.text.style.ForegroundColorSpan) ActionBar(android.app.ActionBar) CharacterStyle(android.text.style.CharacterStyle) SpannableStringBuilder(android.text.SpannableStringBuilder)

Example 48 with ActionBar

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);
        }
    }
}
Also used : ActionBar(android.app.ActionBar)

Example 49 with ActionBar

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);
}
Also used : LayoutInflater(android.view.LayoutInflater) View(android.view.View) ActionBar(android.app.ActionBar)

Example 50 with ActionBar

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);
}
Also used : AdRequest(com.google.ads.AdRequest) FrameLayout(android.widget.FrameLayout) AdView(com.google.ads.AdView) ActionBar(android.app.ActionBar)

Aggregations

ActionBar (android.app.ActionBar)158 View (android.view.View)37 Intent (android.content.Intent)19 AdapterView (android.widget.AdapterView)11 TextView (android.widget.TextView)11 ListView (android.widget.ListView)9 SharedPreferences (android.content.SharedPreferences)8 Uri (android.net.Uri)7 ArrayAdapter (android.widget.ArrayAdapter)7 FrameLayout (android.widget.FrameLayout)7 SpannableString (android.text.SpannableString)6 BitmapRegionTileSource (com.android.photos.BitmapRegionTileSource)6 GridLayoutManager (android.support.v7.widget.GridLayoutManager)5 RecyclerView (android.support.v7.widget.RecyclerView)5 CircularProgressButton (com.dd.CircularProgressButton)5 CircularProgressButton (com.marshalchen.common.uimodule.circularProgressButton.CircularProgressButton)5 SuppressLint (android.annotation.SuppressLint)4 Bundle (android.os.Bundle)4 ViewPager (android.support.v4.view.ViewPager)4 MenuInflater (android.view.MenuInflater)4