@Override
 public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
   inflater.inflate(R.menu.menu, menu);
   ActionBar bar = getActivity().getActionBar();
   if (bar != null) {
     bar.setTitle(getResources().getString(R.string.station_select_activity_title));
     bar.setLogo(R.drawable.ic_qicheng);
     bar.setDisplayHomeAsUpEnabled(true);
   }
 }
  private void handleSetLogo(String url) {
    if (actionBar == null) {
      Log.w(TAG, "ActionBar is not enabled");
      return;
    }

    Drawable logo = getDrawableFromUrl(url);
    if (logo != null) {
      actionBar.setLogo(logo);
    }
  }
Beispiel #3
0
 protected void setupActionBar() {
   final ActionBar actionBar = getActionBar();
   if (actionBar == null) return;
   actionBar.setDisplayShowTitleEnabled(true);
   actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
   actionBar.setDisplayUseLogoEnabled(true);
   actionBar.setLogo(R.drawable.icon);
   actionBar.setBackgroundDrawable(getResources().getDrawable(R.drawable.actionbar_bg));
   actionBar.setDisplayHomeAsUpEnabled(true);
   actionBar.setHomeButtonEnabled(true);
 }
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.activity_view_code);
   this.app = (ExamplesApplicationContext) this.getApplicationContext();
   this.setTitle(this.app.selectedExample().getHeaderText() + " code");
   this.codeVisualizer = (WebView) this.findViewById(R.id.webViewCode);
   final ActionBar actionBar = this.getActionBar();
   actionBar.setDisplayHomeAsUpEnabled(true);
   actionBar.setLogo(new ColorDrawable(getResources().getColor(android.R.color.transparent)));
   String fileName = this.getIntent().getStringExtra("file_name");
   this.loadSourceCode(fileName.toLowerCase());
 }
Beispiel #5
0
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.login);
    actionBar = getActionBar();
    actionBar.setDisplayHomeAsUpEnabled(false);
    actionBar.setDisplayShowHomeEnabled(true);
    actionBar.setDisplayShowTitleEnabled(false);
    actionBar.setHomeButtonEnabled(true);
    actionBar.setLogo(getResources().getDrawable(R.drawable.ic_back));

    username = (EditText) findViewById(R.id.login_username_edit);
    passwd = (EditText) findViewById(R.id.login_passwd_edit);
  }
  /** Called when the activity is first created. */
  @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
  @SuppressLint("NewApi")
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_capture);
    CameraManager.init(getApplication());
    viewfinderView = (ViewfinderView) findViewById(R.id.viewfinder_view);

    hasSurface = false;
    inactivityTimer = new InactivityTimer(this);

    actionBar = getActionBar();
    actionBar.setDisplayHomeAsUpEnabled(false);
    actionBar.setDisplayShowHomeEnabled(true);
    actionBar.setDisplayShowTitleEnabled(false);
    actionBar.setHomeButtonEnabled(true);
    actionBar.setLogo(getResources().getDrawable(R.drawable.ic_back));
  }
 @Override
 public void setLogo(Drawable logo) {
   mActionBar.setLogo(logo);
 }
 @Override
 public void setLogo(int resId) {
   mActionBar.setLogo(resId);
 }