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

The following examples show how to use android.support.v7.app.ActionBar#setDisplayUseLogoEnabled() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CrossPromoActivity.java    From BusyBox with Apache License 2.0 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_cross_promo);

    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.setDisplayHomeAsUpEnabled(true);
        actionBar.setDisplayShowHomeEnabled(true);
        actionBar.setDisplayUseLogoEnabled(false);
        actionBar.setHomeButtonEnabled(true);
        actionBar.setTitle(R.string.app_name);
    }

    initRemoteConfig();
    fetch();
}
 
Example 2
Source File: ChatActivity.java    From Yahala-Messenger with MIT License 6 votes vote down vote up
@Override
public void applySelfActionBar() {
    if (parentActivity == null) {
        return;
    }

    try {
        ActionBar actionBar = parentActivity.getSupportActionBar();
        actionBar.setDisplayShowTitleEnabled(true);
        actionBar.setDisplayShowHomeEnabled(false);
        actionBar.setDisplayHomeAsUpEnabled(true);
        actionBar.setDisplayUseLogoEnabled(false);
        actionBar.setDisplayShowCustomEnabled(false);
        actionBar.setCustomView(null);
        updateSubtitle();
        ((LaunchActivity) parentActivity).fixBackButton();
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
Example 3
Source File: MainActivity.java    From opencdk-appwidget with Apache License 2.0 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.layout_main);

    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.setHomeButtonEnabled(true);
        actionBar.setDisplayUseLogoEnabled(false);
        actionBar.setDisplayShowHomeEnabled(true);

        actionBar.setDisplayHomeAsUpEnabled(false);
        actionBar.setTitle(R.string.app_name);
    }

    if (savedInstanceState == null) {
        getSupportFragmentManager().beginTransaction().add(R.id.container, new PlaceholderFragment()).commit();
    }

    handleIntent();
}
 
Example 4
Source File: AboutActivity.java    From Rumble with GNU General Public License v3.0 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_settings_about);
    setTitle(R.string.settings_about);

    ActionBar actionBar = getSupportActionBar();
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setDisplayUseLogoEnabled(false);
    actionBar.setDisplayShowHomeEnabled(false);

    TextView aboutVersion = (TextView)findViewById(R.id.about_version);
    aboutVersion.setText(RumbleApplication.BUILD_VERSION);


    TextView aboutProject = (TextView)findViewById(R.id.about_project);
    aboutProject.setText("DisruptedSystems (http://disruptedsystems.org/)");

    TextView aboutDeveloper = (TextView)findViewById(R.id.about_developer);
    aboutDeveloper.setText("Marlinski (http://marlinski.org/)");
}
 
Example 5
Source File: StatisticActivity.java    From Rumble with GNU General Public License v3.0 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_settings_statistic);
    setTitle(R.string.settings_statistic);

    ActionBar actionBar = getSupportActionBar();
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setDisplayUseLogoEnabled(false);
    actionBar.setDisplayShowHomeEnabled(false);

    CheckBox checkBox = (CheckBox)findViewById(R.id.stat_check_box);
    checkBox.setChecked(RumblePreferences.UserOkWithSharingAnonymousData(this));
    checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
        @Override
        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            RumblePreferences.setUserPreferenceWithSharingData(StatisticActivity.this, isChecked);
        }
    });
}
 
Example 6
Source File: DebugActivity.java    From Rumble with GNU General Public License v3.0 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_settings_debug);
    setTitle(R.string.settings_debug);

    ActionBar actionBar = getSupportActionBar();
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setDisplayUseLogoEnabled(false);
    actionBar.setDisplayShowHomeEnabled(false);

    CheckBox checkBox = (CheckBox)findViewById(R.id.debug_check_box);
    checkBox.setChecked(RumblePreferences.isLogcatDebugEnabled(this));
    checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
        @Override
        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            RumblePreferences.setLogcatDebugging(DebugActivity.this, isChecked);
            EventLogger.getInstance().init();
        }
    });
}
 
Example 7
Source File: MiscellaneousActivity.java    From Rumble with GNU General Public License v3.0 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_settings_misc);
    setTitle(R.string.settings_misc);

    ActionBar actionBar = getSupportActionBar();
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setDisplayUseLogoEnabled(false);
    actionBar.setDisplayShowHomeEnabled(false);

    CheckBox checkBox = (CheckBox)findViewById(R.id.setting_startonboot);
    checkBox.setChecked(RumblePreferences.startOnBoot(this));
    checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
        @Override
        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            RumblePreferences.setStartOnBoot(MiscellaneousActivity.this, isChecked);
        }
    });
}
 
Example 8
Source File: DrawerActivity.java    From MaterialViewPager with Apache License 2.0 6 votes vote down vote up
@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 9
Source File: MainActivity.java    From Yahala-Messenger with MIT License 5 votes vote down vote up
@Override
public void applySelfActionBar() {
    try {
        if (parentActivity == null) {
            return;
        }
        final ActionBar actionBar = parentActivity.getSupportActionBar();
        //  actionBar.hide();
        //ImageView view = (ImageView) fragmentView.findViewById(16908332);
        // if (view == null) {
        ImageView view = (ImageView) fragmentView.findViewById(R.id.home);
        // }
        if (view != null) {
            view.setPadding(OSUtilities.dp(6), 0, OSUtilities.dp(6), 0);
        }
        actionBar.setDisplayShowTitleEnabled(true);
        actionBar.setDisplayShowHomeEnabled(true);
        actionBar.setDisplayHomeAsUpEnabled(false);
        actionBar.setDisplayUseLogoEnabled(false);

        actionBar.setCustomView(null);
        actionBar.setSubtitle(null);
        actionBar.setTitle(LocaleController.getString("AppName", R.string.AppName));

    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
Example 10
Source File: BaseActivity.java    From opencdk-appwidget with Apache License 2.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);

	ActionBar actionBar = getSupportActionBar();
	if (actionBar != null) {
		actionBar.setLogo(R.drawable.ic_launcher);

		actionBar.setHomeButtonEnabled(true);
		actionBar.setDisplayUseLogoEnabled(false);
		actionBar.setDisplayShowHomeEnabled(false);

		actionBar.setDisplayHomeAsUpEnabled(true);
	}
}
 
Example 11
Source File: BaseActivity.java    From AndroidMVVMSample with Apache License 2.0 5 votes vote down vote up
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.setDisplayHomeAsUpEnabled(true);
        actionBar.setDisplayShowHomeEnabled(false);
        actionBar.setDisplayShowTitleEnabled(true);
        actionBar.setDisplayUseLogoEnabled(false);
    }

    loadingDialog = new LoadingDialog(this);
}
 
Example 12
Source File: LicenceActivity.java    From Rumble with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setTitle(R.string.settings_freedom);

    ActionBar actionBar = getSupportActionBar();
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setDisplayUseLogoEnabled(false);
    actionBar.setDisplayShowHomeEnabled(false);

    WebView webview = new WebView(this);
    webview.getSettings().setBuiltInZoomControls(true);
    setContentView(webview);
    webview.loadUrl("file:///android_asset/GNU_GPL_v3-standalone.html");
}
 
Example 13
Source File: SettingsActivity.java    From Rumble with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_settings);
    setTitle("Settings");

    ActionBar actionBar = getSupportActionBar();
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setDisplayUseLogoEnabled(false);
    actionBar.setDisplayShowHomeEnabled(false);

    LinearLayout storage = (LinearLayout)findViewById(R.id.setting_storage);
    storage.setOnClickListener(openActivity(StorageActivity.class));

    LinearLayout stat = (LinearLayout)findViewById(R.id.setting_statistic);
    stat.setOnClickListener(openActivity(StatisticActivity.class));

    LinearLayout misc = (LinearLayout)findViewById(R.id.setting_misc);
    misc.setOnClickListener(openActivity(MiscellaneousActivity.class));

    LinearLayout about = (LinearLayout)findViewById(R.id.setting_about);
    about.setOnClickListener(openActivity(AboutActivity.class));

    LinearLayout debug = (LinearLayout)findViewById(R.id.setting_debug);
    debug.setOnClickListener(openActivity(DebugActivity.class));

    LinearLayout licence = (LinearLayout)findViewById(R.id.setting_licence);
    licence.setOnClickListener(openActivity(LicenceActivity.class));
}
 
Example 14
Source File: CustomViewActionbarActivity.java    From UltimateAndroid with Apache License 2.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    ActionBar actionBar = getSupportActionBar();
    //使自定义的普通View能在title栏显示, actionBar.setCustomView能起作用.
    actionBar.setDisplayShowCustomEnabled(true);
    actionBar.setCustomView(getCustomActionBarView());
    actionBar.setDisplayHomeAsUpEnabled(false);
    actionBar.setDisplayShowTitleEnabled(false);
    actionBar.setDisplayUseLogoEnabled(false);
    actionBar.setDisplayShowHomeEnabled(false);
}
 
Example 15
Source File: ActionbarextrasModule.java    From actionbarextras with MIT License 5 votes vote down vote up
/**
 * Set whether to display the activity logo rather than the activity icon.
 * @param icon
 */
private void handleDisplayUseLogoEnabled(Boolean useLogo){
	ActionBar actionBar = getActionBar();
	
	if (actionBar == null){
		return;
	}
	
	actionBar.setDisplayUseLogoEnabled(useLogo);
}
 
Example 16
Source File: MainActivity.java    From AnotherRSS with The Unlicense 4 votes vote down vote up
/**
 * Beinhaltet alle Start-Funktionen der App.
 * Funktionen:
 * <ul>
 *     <li>Alarm (neu) Starten</li>
 *     <li>Datenbank bereinigen (gelöschte Feeds entfernen)</li>
 *     <li>Ein BroadcastReceiver() wird registriert, um nach neuen Feeds durch den Alarm zu horchen</li>
 * </ul>
 * Außerdem wird das Icon in die ActionBar eingefügt.
 *
 * @param savedInstanceState
 */
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Log.d(AnotherRSS.TAG, "onCreate");
    ctx = this;
    mPreferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());

    setContentView(R.layout.activity_main);
    umm = (UiModeManager) getSystemService(Context.UI_MODE_SERVICE);
    AnotherRSS.alarm.restart(this);;

    try {
        ActionBar ab = getSupportActionBar();
        if (ab != null) {
            ab.setDisplayShowHomeEnabled(true);
            ab.setHomeButtonEnabled(true);
            ab.setDisplayUseLogoEnabled(true);
            ab.setLogo(R.drawable.ic_launcher);
            ab.setTitle(" " + getString(R.string.app_name));
        }
    } catch (Exception e) {
        e.printStackTrace();
    }

    alarmReceiver = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {
            String action = intent.getAction();
            if (action.equals(getString(R.string.serviceHasNews))) {
                int countNews = intent.getIntExtra("count", 0);
                Toast.makeText(
                        ctx,
                        getString(R.string.newFeeds) + ": " + countNews,
                        Toast.LENGTH_SHORT
                ).show();
            }
        }
    };

    videoView = (VideoView) findViewById(R.id.videoView);
    webView = (WebView) findViewById(R.id.webView);
    progressBar = (ProgressBar) findViewById(R.id.progressBar);

    IntentFilter filter = new IntentFilter();
    filter.addAction(getString(R.string.serviceHasNews));
    registerReceiver(alarmReceiver, filter);
}