Java Code Examples for android.support.v7.app.ActionBar.setDisplayUseLogoEnabled()

The following are Jave code examples for showing how to use setDisplayUseLogoEnabled() of the android.support.v7.app.ActionBar class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: GitHub   File: DrawerActivity.java   View Source Code Vote up 6 votes
@Override
protected void onStart() {
    super.onStart();

    mDrawer = (DrawerLayout) findViewById(R.id.drawer_layout);
    mDrawerToggle = new ActionBarDrawerToggle(this, mDrawer, 0, 0);
    mDrawer.setDrawerListener(mDrawerToggle);

    final ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.setDisplayHomeAsUpEnabled(true);
        actionBar.setDisplayShowHomeEnabled(true);
        actionBar.setDisplayShowTitleEnabled(true);
        actionBar.setDisplayUseLogoEnabled(false);
        actionBar.setHomeButtonEnabled(true);
    }
}
 
Example 2
Project: Neuronizer   File: AppbarCustomizer.java   View Source Code Vote up 5 votes
public static void configureAppbar(Activity activity, boolean showBackArrow) {
    ActionBar actionBar = ((AppCompatActivity) activity).getSupportActionBar();
    if (actionBar != null) {
        actionBar.setDisplayUseLogoEnabled(!showBackArrow);
        actionBar.setDisplayShowHomeEnabled(!showBackArrow);
        actionBar.setDisplayHomeAsUpEnabled(showBackArrow);
        if (!showBackArrow) actionBar.setIcon(R.mipmap.ic_launcher);
    }
}
 
Example 3
Project: Botanist   File: MainActivity.java   View Source Code Vote up 5 votes
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.setDisplayUseLogoEnabled(true);
        actionBar.setDisplayShowHomeEnabled(true);
        getSupportActionBar().setIcon(R.drawable.ic_logo_botanist);
    }
    FloatingActionButton fab = findViewById(R.id.fab);
    fab.setOnClickListener(new View.OnClickListener() {
        /**
         * Handle action button click
         * @param view - current view
         */
        @Override
        public void onClick(View view) {
            startActivity(new Intent(MainActivity.this, NewPlantActivity.class));
        }
    });
    View tipView = findViewById(R.id.daily_tip_cardview);
    tipView.findViewById(R.id.daily_tip_dismiss_button).setOnClickListener(new View.OnClickListener() {
        /**
         * change visibility of CardView to gone if user clicked "Dismiss" button
         * @param v - the view
         */
        @Override
        public void onClick(View v) {
            findViewById(R.id.daily_tip_cardview).setVisibility(View.GONE);
        }
    });
    GridView gridView = findViewById(R.id.plants_grid);
    gridView.setEmptyView(findViewById(R.id.empty_grid_view));
    mController = new MainController(this);
    AppRater.INSTANCE.appLaunched(this);
}
 
Example 4
Project: OSchina_resources_android   File: BaseActivity.java   View Source Code Vote up 5 votes
protected void initActionBar(ActionBar actionBar) {
    if (actionBar == null)
        return;
    if (hasBackButton()) {
        mActionBar.setDisplayHomeAsUpEnabled(true);
        mActionBar.setHomeButtonEnabled(true);
    } else {
        actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_TITLE);
        actionBar.setDisplayUseLogoEnabled(false);
        int titleRes = getActionBarTitle();
        if (titleRes != 0) {
            actionBar.setTitle(titleRes);
        }
    }
}
 
Example 5
Project: TripBuyer   File: LCIMConversationActivity.java   View Source Code Vote up 5 votes
/**
 * 设置 actionBar title 以及 up 按钮事件
 *
 * @param title
 */
protected void initActionBar(String title) {
    ActionBar actionBar = getSupportActionBar();
    if (null != actionBar) {
        if (null != title) {
            actionBar.setTitle(title);
        }
        actionBar.setDisplayUseLogoEnabled(false);
        actionBar.setDisplayHomeAsUpEnabled(true);
        finishActivity(RESULT_OK);
    }
}
 
Example 6
Project: JinsMemeBRIDGE-Android   File: MainActivity.java   View Source Code Vote up 4 votes
void updateActionBar(String title, boolean isRev) {
  Log.d("DEBUG", "updateActionBar 0");

  ActionBar target = getSupportActionBar();
  if (target != null) {
    Log.d("DEBUG", "updateActionBar 1");

    target.setTitle(String.format("  %s", title));
    target.setDisplayHomeAsUpEnabled(false);

    target.setDisplayShowHomeEnabled(true);
    target.setDisplayUseLogoEnabled(false);

    if (isRev) {
      target.setBackgroundDrawable(getDrawable(R.color.no0));
    } else {
      target.setBackgroundDrawable(getDrawable(R.color.no4));
    }

    /*
    switch (batteryStatus) {
      case 1:
        if (isRev) {

        } else {
          target.setLogo(R.drawable.connected_caution);
        }
        break;
      case 2:
        if (isRev) {

        } else {
          target.setLogo(R.drawable.connected_30);
        }
        break;
      case 3:
        if (isRev) {

        } else {
          target.setLogo(R.drawable.connected_50);
        }
        break;
      case 4:
        if (isRev) {

        } else {
          target.setLogo(R.drawable.connected_80);
        }
        break;
      case 5:
        if (isRev) {

        } else {
          target.setLogo(R.drawable.connected_full);
        }
        break;
      default:
        if (isRev) {

        } else {
          target.setLogo(R.drawable.not_connected);
        }
        break;
    }
    */
  }
}