android.app.ActionBar#setDisplayShowHomeEnabled ( )源码实例Demo

下面列出了android.app.ActionBar#setDisplayShowHomeEnabled ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: Bitocle   文件: MainActivity.java
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    ActionBar actionBar = getActionBar();
    actionBar.setTitle(R.string.app_name);
    actionBar.setSubtitle(null);
    actionBar.setDisplayShowHomeEnabled(false);
    actionBar.setHomeButtonEnabled(false);

    fragment = (MainFragment) getSupportFragmentManager().findFragmentById(R.id.main_fragment);

    search = (AutoCompleteTextView) findViewById(R.id.main_header_search);
    View line = findViewById(R.id.main_header_line);
    fragment.setSearch(search);
    fragment.setLine(line);
}
 
源代码2 项目: Bitocle   文件: MainActivity.java
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    ActionBar actionBar = getActionBar();
    actionBar.setTitle(R.string.app_name);
    actionBar.setSubtitle(null);
    actionBar.setDisplayShowHomeEnabled(false);
    actionBar.setHomeButtonEnabled(false);

    fragment = (MainFragment) getSupportFragmentManager().findFragmentById(R.id.main_fragment);

    preferences = getSharedPreferences(getString(R.string.login_sp), MODE_PRIVATE);
    editor = preferences.edit();

    layoutParams = getWindow().getAttributes();

    search = (AutoCompleteTextView) findViewById(R.id.main_header_search);
    View line = findViewById(R.id.main_header_line);
    fragment.setSearch(search);
    fragment.setLine(line);
}
 
源代码3 项目: something.apk   文件: SomeActivity.java
private void configureActionbar(){
    ActionBar bar = getActionBar();
    bar.setHomeButtonEnabled(true);
    bar.setDisplayShowHomeEnabled(false);

    tint = new SystemBarTintManager(this);
    TypedValue tintColor = new TypedValue();
    if(getTheme().resolveAttribute(R.attr.statusBarBackground, tintColor, true)){
        tint.setStatusBarTintEnabled(true);
        tint.setTintColor(tintColor.data);
        defaultActionbarColor = tintColor.data;
        currentActionbarColor = tintColor.data;
    }else{
        tint.setStatusBarTintEnabled(false);
    }

    TypedValue actionbarBackground = new TypedValue();
    if(getTheme().resolveAttribute(R.attr.actionbarBackgroundLayerList, actionbarBackground, false)){
        actionbarBackgroundList = (LayerDrawable) getResources().getDrawable(actionbarBackground.data);
        actionbarBackgroundList.mutate();
        actionbarColor = (ColorDrawable) actionbarBackgroundList.findDrawableByLayerId(R.id.actionbar_background_color);
        actionbarColor.mutate();
        bar.setBackgroundDrawable(actionbarBackgroundList);
    }

}
 
源代码4 项目: coursera-android   文件: DialtactsActivity.java
/**
 * Goes back to usual Phone UI with tags. Previously selected Tag and associated Fragment
 * should be automatically focused again.
 */
private void exitSearchUi() {
    final ActionBar actionBar = getActionBar();

    // Hide the search fragment, if exists.
    if (mSearchFragment != null) {
        mSearchFragment.setUserVisibleHint(false);

        final FragmentTransaction transaction = getFragmentManager().beginTransaction();
        transaction.hide(mSearchFragment);
        transaction.commitAllowingStateLoss();
    }

    // We want to hide SearchView and show Tabs. Also focus on previously selected one.
    actionBar.setDisplayShowCustomEnabled(false);
    actionBar.setDisplayShowHomeEnabled(false);
    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);

    for (int i = 0; i < TAB_INDEX_COUNT; i++) {
        sendFragmentVisibilityChange(i, i == mViewPager.getCurrentItem());
    }

    // Before exiting the search screen, reset swipe state.
    mDuringSwipe = false;
    mUserTabClick = false;

    mViewPager.setVisibility(View.VISIBLE);

    hideInputMethod(getCurrentFocus());

    // Request to update option menu.
    invalidateOptionsMenu();

    // See comments in onActionViewExpanded()
    mSearchView.onActionViewCollapsed();
    mInSearchUi = false;
}
 
源代码5 项目: androidtestdebug   文件: MainActivity.java
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    if(savedInstanceState != null && savedInstanceState.getInt("theme", -1) != -1) {
        mThemeId = savedInstanceState.getInt("theme");
        this.setTheme(mThemeId);
    }
            
    setContentView(R.layout.main);

    Directory.initializeDirectory(new OnDirectoryChanged());
    
    ActionBar bar = getActionBar();

    int i;
    for (i = 0; i < Directory.getCategoryCount(); i++) {
        bar.addTab(bar.newTab().setText(Directory.getCategory(i).getName())
                .setTabListener(this));
    }

    mActionBarView = getLayoutInflater().inflate(
            R.layout.action_bar_custom, null);

    bar.setCustomView(mActionBarView);
    bar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM | ActionBar.DISPLAY_USE_LOGO);
    bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
    bar.setDisplayShowHomeEnabled(true);

    // If category is not saved to the savedInstanceState,
    // 0 is returned by default.
    if(savedInstanceState != null) {
        int category = savedInstanceState.getInt("category");
        bar.selectTab(bar.getTabAt(category));
    }
}
 
源代码6 项目: FreezeYou   文件: FullScreenImageViewerActivity.java
@Override
protected void onCreate(Bundle savedInstanceState) {
    ThemeUtils.processSetTheme(this);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.fsiva_main);
    ActionBar actionBar = getActionBar();
    if (actionBar != null) {
        actionBar.setDisplayShowHomeEnabled(false);
        actionBar.setDisplayShowTitleEnabled(false);
        actionBar.setDisplayHomeAsUpEnabled(true);
    }
    Intent intent = getIntent();
    if (intent != null) {
        ImageView fsiva_main_imageView = findViewById(R.id.fsiva_main_imageView);
        fsiva_main_imageView.setImageBitmap(
                BitmapFactory.decodeFile(intent.getStringExtra("imgPath"))
        );
        fsiva_main_imageView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    } else {
        finish();
    }

}
 
源代码7 项目: kylewbanks.com-AndroidApp   文件: MainActivity.java
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    //Customize the action bar
    ActionBar actionBar = getActionBar();
    if(actionBar != null) {
        actionBar.setDisplayShowHomeEnabled(false);
        actionBar.setDisplayShowTitleEnabled(false);
        actionBar.setDisplayShowCustomEnabled(true);

        LayoutInflater inflater = (LayoutInflater)this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        View v = inflater.inflate(R.layout.header, null);

        Typeface scriptFont = Typeface.createFromAsset(getAssets(), "fonts/script.ttf");
        TextView title = (TextView) v.findViewById(R.id.title);
        title.setTypeface(scriptFont);

        actionBar.setCustomView(v);
    }

    //Initialize Views
    postListView = (AnimatedListView) findViewById(R.id.post_list);
    postListView.setOnItemClickListener(postItemSelectedListener);


    progressBar = (ProgressBar) findViewById(R.id.loader);

    //Register as a Post List update listener
    KWBApplication application = (KWBApplication) getApplication();
    application.registerPostUpdateListener(this);
}
 
源代码8 项目: Conquer   文件: MaterialMenuIcon.java
@Override @TargetApi(14)
protected void setActionBarSettings(Activity activity) {
    ActionBar actionBar = activity.getActionBar();
    actionBar.setDisplayShowHomeEnabled(true);
    actionBar.setHomeButtonEnabled(true);
    actionBar.setDisplayHomeAsUpEnabled(false);
    actionBar.setIcon(getDrawable());
}
 
源代码9 项目: UltimateAndroid   文件: MaterialMenuIcon.java
@Override @TargetApi(14)
protected void setActionBarSettings(Activity activity) {
    ActionBar actionBar = activity.getActionBar();
    actionBar.setDisplayShowHomeEnabled(true);
    actionBar.setHomeButtonEnabled(true);
    actionBar.setDisplayHomeAsUpEnabled(false);
    actionBar.setIcon(getDrawable());
}
 
源代码10 项目: MainScreenShow   文件: FeedBack.java
@Override
protected void onCreate(Bundle savedInstanceState) {
	
	super.onCreate(savedInstanceState);
	ActionBar actionBar = getActionBar();
	actionBar.setDisplayUseLogoEnabled(false);
	actionBar.setDisplayHomeAsUpEnabled(true);
	actionBar.setDisplayShowHomeEnabled(false);
	setContentView(R.layout.activity_feedback);
	
	content = (EditText) findViewById(R.id.edit_fb);
	qq = (EditText) findViewById(R.id.edit_fb_qq);
	
}
 
源代码11 项目: weixin   文件: MainActivity.java
private void initView() {
	ActionBar actionBar = this.getActionBar();
	actionBar.setDisplayShowHomeEnabled(false);
	actionBar.setDisplayShowTitleEnabled(true);
	setOverflowShowingAlways();

	mFragmentManager = getFragmentManager();
	mRg_tab = (RadioGroup) findViewById(R.id.cgt_rg_tab);
	mRg_tab.setOnCheckedChangeListener(this);
}
 
源代码12 项目: CameraV   文件: PreferencesActivity.java
@SuppressWarnings("deprecation")
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		setTitle(R.string.preferences);
		
		ActionBar actionBar = getActionBar();
		actionBar.setDisplayShowTitleEnabled(true);
		actionBar.setDisplayShowHomeEnabled(true);
		actionBar.setDisplayHomeAsUpEnabled(false);
		actionBar.setHomeButtonEnabled(true);
		actionBar.setLogo(this.getResources().getDrawable(R.drawable.ic_action_up));
		actionBar.setDisplayUseLogoEnabled(true);
		
		addPreferencesFromResource(R.xml.preferences);
		
//		lockScreenMode = (ListPreference) findPreference(Preferences.Keys.LOCK_SCREEN_MODE);
//		updateSummaryWithChoice(lockScreenMode, lockScreenMode.getValue(), getResources().getStringArray(R.array.lockScreenOptions_));

		language = (ListPreference) findPreference(Preferences.Keys.LANGUAGE);
		updateSummaryWithChoice(language, language.getValue(), getResources().getStringArray(R.array.languages_));
		
		//originalImage = (ListPreference) findPreference(Models.IUser.ASSET_ENCRYPTION);
		//updateSummaryWithChoice(originalImage, originalImage.getValue(), getResources().getStringArray(R.array.originalImageOptions_));

		panicAction = (ListPreference) findPreference(Preferences.Keys.PANIC_ACTION);
		updateSummaryWithChoice(panicAction, panicAction.getValue(), getResources().getStringArray(R.array.panicActionOptions_));
	}
 
源代码13 项目: SmileEssence   文件: MainActivity.java
public void initializeView() {
    ActionBar bar = getActionBar();
    bar.setDisplayShowHomeEnabled(true);
    bar.setDisplayShowTitleEnabled(false);
    bar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
    viewPager = (ViewPager) findViewById(R.id.viewPager);
    pagerAdapter = new PageListAdapter(this, viewPager);
    initializePages();
}
 
源代码14 项目: weixin   文件: UserDetailedInfoActivity.java
private void initView() {
	ActionBar actionBar = getActionBar();
	actionBar.setDisplayHomeAsUpEnabled(true);
	actionBar.setDisplayShowHomeEnabled(false);
	actionBar.setDisplayShowTitleEnabled(true);
	actionBar.setTitle(R.string.text_menu_userDetailedInfo_title);
	setOverflowShowingAlways();

	mIv_userPhoto = (ImageView) findViewById(R.id.cgt_iv_userDetailedInfo_userPhoto);
	mTv_userName = (TextView) findViewById(R.id.cgt_tv_userDetailedInfo_userName);
	mIv_userSex = (ImageView) findViewById(R.id.cgt_iv_userDetailedInfo_userSex);
	mTv_userWeixin = (TextView) findViewById(R.id.cgt_tv_userDetailedInfo_userWeixin);
	mTv_nickName = (TextView) findViewById(R.id.cgt_tv_userDetailedInfo_nickname);
	mTv_area = (TextView) findViewById(R.id.cgt_tv_userDetailedInfo_area);
	mTv_personalizedSignature = (TextView) findViewById(R.id.cgt_tv_userDetailedInfo_personalizedSignature);
	mLl_personalPhoto_box = (LinearLayout) findViewById(R.id.cgt_ll_userDetailedInfo_personalPhoto_box);
	mLl_personalPhoto = (LinearLayout) findViewById(R.id.cgt_ll_userDetailedInfo_personalPhoto);
	mLl_socialInfo_box = (LinearLayout) findViewById(R.id.cgt_ll_userDetailedInfo_socialInfo_box);
	mLl_socialInfo = (LinearLayout) findViewById(R.id.cgt_ll_userDetailedInfo_socialInfo);
	mBtn_sendMsg = (Button) findViewById(R.id.cgt_btn_userDetailedInfo_sendMsg);
	mBtn_videoChat = (Button) findViewById(R.id.cgt_btn_userDetailedInfo_videoChat);

	mIv_userPhoto.setOnClickListener(this);
	mLl_personalPhoto_box.setOnClickListener(this);
	mLl_socialInfo_box.setOnClickListener(this);
	mBtn_sendMsg.setOnClickListener(this);
	mBtn_videoChat.setOnClickListener(this);
}
 
源代码15 项目: MiBandDecompiled   文件: SettingFirmwareActivity.java
protected void onCreate(Bundle bundle)
{
    super.onCreate(bundle);
    FragmentTransaction fragmenttransaction = getFragmentManager().beginTransaction();
    a = (SettingFirmwareFragment)Fragment.instantiate(this, cn/com/smartdevices/bracelet/ui/SettingFirmwareActivity$SettingFirmwareFragment.getName());
    fragmenttransaction.add(0x1020002, a);
    fragmenttransaction.commit();
    ActionBar actionbar = getActionBar();
    actionbar.setDisplayHomeAsUpEnabled(true);
    actionbar.setDisplayShowHomeEnabled(false);
    actionbar.setDisplayUseLogoEnabled(false);
}
 
源代码16 项目: WeCenterMobile-Android   文件: MainActivity.java
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_main);
	sharedPreferences = new FanfanSharedPreferences(MainActivity.this);
	ActionBar actionBar = getActionBar();
	actionBar.setDisplayShowHomeEnabled(false);
	if (!sharedPreferences.getLogInStatus(false)) {
		draweritems = this.getResources().getStringArray(
				R.array.nologindrawerliststring);
	} else {
		draweritems = this.getResources().getStringArray(
				R.array.drawerliststring);
		// Login();
	}
	mNavigationDrawerFragment = (NavigationDrawerFragment) getFragmentManager()
			.findFragmentById(R.id.navigation_drawer);
	mTitle = getTitle();

	// Set up the drawer.
	mNavigationDrawerFragment.setUp(R.id.navigation_drawer,
			(DrawerLayout) findViewById(R.id.drawer_layout));
	// ���������Զ��������
	UmengUpdateAgent.update(MainActivity.this);
	// �û���������̨����Ƿ����µ����Կ����ߵĻظ���
	FeedbackAgent mAgent = new FeedbackAgent(MainActivity.this);
	mAgent.sync();
	MobclickAgent.updateOnlineConfig(MainActivity.this);
}
 
源代码17 项目: commcare-android   文件: BreadcrumbBarFragment.java
private void configureSimpleNav(Activity activity, ActionBar actionBar) {
    boolean showNav = true;
    if (activity instanceof CommCareActivity) {
        showNav = ((CommCareActivity)activity).isBackEnabled();
    }

    if (showNav) {
        actionBar.setDisplayShowHomeEnabled(true);
        actionBar.setDisplayHomeAsUpEnabled(true);
    }

    actionBar.setDisplayShowTitleEnabled(true);
    String title = getBestTitle(activity);
    actionBar.setTitle(title);
}
 
源代码18 项目: androidtestdebug   文件: MainActivity.java
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    if(savedInstanceState != null && savedInstanceState.getInt("theme", -1) != -1) {
        mThemeId = savedInstanceState.getInt("theme");
        this.setTheme(mThemeId);
    }
            
    setContentView(R.layout.main);

    Directory.initializeDirectory(new OnDirectoryChanged());
    
    ActionBar bar = getActionBar();

    int i;
    for (i = 0; i < Directory.getCategoryCount(); i++) {
        bar.addTab(bar.newTab().setText(Directory.getCategory(i).getName())
                .setTabListener(this));
    }

    mActionBarView = getLayoutInflater().inflate(
            R.layout.action_bar_custom, null);

    bar.setCustomView(mActionBarView);
    bar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM | ActionBar.DISPLAY_USE_LOGO);
    bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
    bar.setDisplayShowHomeEnabled(true);

    // If category is not saved to the savedInstanceState,
    // 0 is returned by default.
    if(savedInstanceState != null) {
        int category = savedInstanceState.getInt("category");
        bar.selectTab(bar.getTabAt(category));
    }
}
 
源代码19 项目: commcare-android   文件: FormHierarchyActivity.java
private void addActionBarBackArrow() {
    if (android.os.Build.VERSION.SDK_INT >= 11) {
        ActionBar bar = getActionBar();
        if (bar != null) {
            bar.setDisplayShowHomeEnabled(true);
            bar.setDisplayHomeAsUpEnabled(true);
        }
    }
}
 
源代码20 项目: androidtestdebug   文件: MainActivity.java
@Override
  public void onCreate(Bundle savedInstanceState) {		
StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder()
	.detectActivityLeaks()
	.penaltyLog().build());

      super.onCreate(savedInstanceState);

      if(savedInstanceState != null && savedInstanceState.getInt("theme", -1) != -1) {
          mThemeId = savedInstanceState.getInt("theme");
          this.setTheme(mThemeId);
      }
              
      setContentView(R.layout.main);

      Directory.initializeDirectory(new OnDirectoryChanged());
      
      ActionBar bar = getActionBar();

      int i;
      for (i = 0; i < Directory.getCategoryCount(); i++) {
          bar.addTab(bar.newTab().setText(Directory.getCategory(i).getName())
                  .setTabListener(this));
      }

      mActionBarView = getLayoutInflater().inflate(
              R.layout.action_bar_custom, null);

      bar.setCustomView(mActionBarView);
      bar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM | ActionBar.DISPLAY_USE_LOGO);
      bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
      bar.setDisplayShowHomeEnabled(true);

      // If category is not saved to the savedInstanceState,
      // 0 is returned by default.
      if(savedInstanceState != null) {
          int category = savedInstanceState.getInt("category");
          bar.selectTab(bar.getTabAt(category));
      }
  }