当前位置: 首页>>代码示例>>Java>>正文


Java ActionBar.setDisplayShowTitleEnabled方法代码示例

本文整理汇总了Java中android.app.ActionBar.setDisplayShowTitleEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java ActionBar.setDisplayShowTitleEnabled方法的具体用法?Java ActionBar.setDisplayShowTitleEnabled怎么用?Java ActionBar.setDisplayShowTitleEnabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.app.ActionBar的用法示例。


在下文中一共展示了ActionBar.setDisplayShowTitleEnabled方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreate

import android.app.ActionBar; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    if(savedInstanceState != null) {
        if (savedInstanceState.getInt("theme", -1) != -1) {
          mThemeId = savedInstanceState.getInt("theme");
          this.setTheme(mThemeId);
        }
        mTitlesHidden = savedInstanceState.getBoolean("titlesHidden");
    }

    setContentView(R.layout.main);

    ActionBar bar = getActionBar();
    bar.setDisplayShowTitleEnabled(false);

    ContentFragment frag = (ContentFragment) getFragmentManager()
            .findFragmentById(R.id.content_frag);
    if (frag != null) mDualFragments = true;
    
    if (mTitlesHidden) {
        getFragmentManager().beginTransaction()
                .hide(getFragmentManager().findFragmentById(R.id.titles_frag)).commit();
    }
}
 
开发者ID:sdrausty,项目名称:buildAPKsSamples,代码行数:27,代码来源:MainActivity.java

示例2: onCreate

import android.app.ActionBar; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	// FIXME: Observed exception "IllegalAccessException (@MainActivity:onCreate:16) {main}"

       // Init some singletons which need the Context
       Analytics.getInstance().init(this);
       SettingsUtils.getInstance().init(this);

	setContentView(R.layout.activity_main);

	final ActionBar actionBar=getActionBar();
	if (actionBar!=null) {
           actionBar.setDisplayShowTitleEnabled(true);
           //actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
       }

       final IntentFilter filter=new IntentFilter();
       filter.addAction(UsbManager.ACTION_USB_DEVICE_DETACHED);
       filter.addAction(UsbManager.ACTION_USB_DEVICE_ATTACHED);
       registerReceiver(usbReceiver,filter);
}
 
开发者ID:videgro,项目名称:Ships,代码行数:23,代码来源:MainActivity.java

示例3: menuBarsHide

import android.app.ActionBar; //导入方法依赖的package包/类
private void menuBarsHide() {
    Log.d(getClass().getName(), "menuBarsHide");
    ActionBar actionBar = getActionBar();
    if (actionBar == null) {
        Log.d(getClass().getName(), "menuBarsHide ActionBar is null");
        return;
    }

    actionBar.setDisplayShowTitleEnabled(false);
    actionBar.setDisplayShowHomeEnabled(false);
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
    getWindow().clearFlags(
            WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
    getWindow().getDecorView().setSystemUiVisibility(
            View.SYSTEM_UI_FLAG_LOW_PROFILE);
    actionBar.hide(); // slides out
}
 
开发者ID:theopenbit,项目名称:yaacc-code,代码行数:18,代码来源:ImageViewerActivity.java

示例4: menuBarsShow

import android.app.ActionBar; //导入方法依赖的package包/类
private void menuBarsShow() {
    Log.d(getClass().getName(), "menuBarsShow");
    ActionBar actionBar = getActionBar();
    if (actionBar == null) {
        Log.d(getClass().getName(), "menuBarsShow ActionBar is null");
        return;
    }
    actionBar.setDisplayShowTitleEnabled(false);
    actionBar.setDisplayShowHomeEnabled(false);
    getWindow().addFlags(
            WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
    getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
    getWindow().getDecorView().setSystemUiVisibility(
            View.SYSTEM_UI_FLAG_VISIBLE);
    actionBar.show();
}
 
开发者ID:theopenbit,项目名称:yaacc-code,代码行数:17,代码来源:ImageViewerActivity.java

示例5: readyActionBarToCustomView

import android.app.ActionBar; //导入方法依赖的package包/类
protected ActionBar readyActionBarToCustomView(){
    ActionBar ab = getActionBar();
    ab.setDisplayShowHomeEnabled(false);
    ab.setDisplayShowTitleEnabled(false);
    ab.setDisplayShowCustomEnabled(true);

    return ab;
}
 
开发者ID:MobileDev418,项目名称:AndroidBackendlessChat,代码行数:9,代码来源:ChatSDKAbstractChatActivity.java

示例6: onCreate

import android.app.ActionBar; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    setActionBar((Toolbar) findViewById(R.id.toolbar));
    ActionBar actionBar = getActionBar();
    if (actionBar != null) {
        actionBar.setDisplayShowTitleEnabled(false);
    }

    if (getPackageManager().hasSystemFeature(PackageManager.FEATURE_MIDI)) {
        setupMidi();
    }
}
 
开发者ID:sdrausty,项目名称:buildAPKsSamples,代码行数:15,代码来源:MainActivity.java

示例7: onCreate

import android.app.ActionBar; //导入方法依赖的package包/类
@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
//        setContentView(R.layout.chat_list_listview);

        final ActionBar chatting = getActionBar();
//        chatting.setCustomView(R.layout.custom_chat_list);
        chatting.setDisplayShowTitleEnabled(false);
        chatting.setDisplayShowCustomEnabled(true);
        chatting.setDisplayShowHomeEnabled(false);

        backBtn = (Button) findViewById(R.id.backBtn);
    }
 
开发者ID:JoMingyu,项目名称:Daejeon-People,代码行数:14,代码来源:Setting.java

示例8: onCreate

import android.app.ActionBar; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.address_book_listview);

    final ActionBar chatting = getActionBar();
    chatting.setCustomView(R.layout.custom_address_book);
    chatting.setDisplayShowTitleEnabled(false);
    chatting.setDisplayShowCustomEnabled(true);
    chatting.setDisplayShowHomeEnabled(false);

    backBtn = (Button) findViewById(R.id.backBtn);

    AQuery aq = new AQuery(getApplicationContext());

    aq.ajax("http://52.79.134.200/friend", String.class, new AjaxCallback<String>() {
        @Override
        public void callback(String url, String response, AjaxStatus status) {
            if(status.getCode() == 200) {
                try {
                    JSONObject res = new JSONObject(response);
                } catch(JSONException e) {
                    e.printStackTrace();
                }
            } else {

            }
        }
    }.method(AQuery.METHOD_GET).cookie("UserSession", SessionManager.getCookieFromDB(getApplicationContext())));

    backBtn.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            startActivity(new Intent(getApplicationContext(), Main.class));
        }
    });
}
 
开发者ID:JoMingyu,项目名称:Daejeon-People,代码行数:38,代码来源:FriendList.java

示例9: onCreate

import android.app.ActionBar; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState){
    super.onCreate(savedInstanceState);
    setContentView(R.layout.invitation_trip);

    final ActionBar invitation = getActionBar();
    //invitation.setCustomView(R.layout.custom_invitation_trip);
    invitation.setDisplayShowTitleEnabled(false);
    invitation.setDisplayShowCustomEnabled(true);
    invitation.setDisplayShowHomeEnabled(false);
}
 
开发者ID:JoMingyu,项目名称:Daejeon-People,代码行数:12,代码来源:InvitationTrip.java

示例10: onCreate

import android.app.ActionBar; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    setActionBar((Toolbar) findViewById(R.id.toolbar));
    ActionBar actionBar = getActionBar();
    if (actionBar != null) {
        actionBar.setDisplayShowTitleEnabled(false);
    }

    mLog = (TextView) findViewById(R.id.log);
    mScroller = (ScrollView) findViewById(R.id.scroll);

    // Setup MIDI
    MidiManager midiManager = (MidiManager) getSystemService(MIDI_SERVICE);

    // Receiver that prints the messages.
    MidiReceiver loggingReceiver = new LoggingReceiver(this);

    // Receiver that parses raw data into complete messages.
    MidiFramer connectFramer = new MidiFramer(loggingReceiver);

    // Setup a menu to select an input source.
    mLogSenderSelector = new MidiOutputPortSelector(midiManager, this, R.id.spinner_senders) {
        @Override
        public void onPortSelected(final MidiPortWrapper wrapper) {
            super.onPortSelected(wrapper);
            if (wrapper != null) {
                mLogLines.clear();
                MidiDeviceInfo deviceInfo = wrapper.getDeviceInfo();
                if (deviceInfo == null) {
                    log(getString(R.string.header_text));
                } else {
                    log(MidiPrinter.formatDeviceInfo(deviceInfo));
                }
            }
        }
    };
    mLogSenderSelector.getSender().connect(connectFramer);

    // Tell the virtual device to log its messages here..
    MidiScope.setScopeLogger(this);
}
 
开发者ID:sdrausty,项目名称:buildAPKsSamples,代码行数:45,代码来源:MainActivity.java

示例11: onCreate

import android.app.ActionBar; //导入方法依赖的package包/类
@TargetApi(VERSION_CODES.HONEYCOMB)
@Override
public void onCreate(Bundle savedInstanceState) {
    if (BuildConfig.DEBUG) {
        Utils.enableStrictMode();
    }
    super.onCreate(savedInstanceState);
    setContentView(R.layout.image_detail_pager);

    // Fetch screen height and width, to use as our max size when loading images as this
    // activity runs full screen
    final DisplayMetrics displayMetrics = new DisplayMetrics();
    getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
    final int height = displayMetrics.heightPixels;
    final int width = displayMetrics.widthPixels;

    // For this sample we'll use half of the longest width to resize our images. As the
    // image scaling ensures the image is larger than this, we should be left with a
    // resolution that is appropriate for both portrait and landscape. For best image quality
    // we shouldn't divide by 2, but this will use more memory and require a larger memory
    // cache.
    final int longest = (height > width ? height : width) / 2;

    ImageCache.ImageCacheParams cacheParams =
            new ImageCache.ImageCacheParams(this, IMAGE_CACHE_DIR);
    cacheParams.setMemCacheSizePercent(0.25f); // Set memory cache to 25% of app memory

    // The ImageFetcher takes care of loading images into our ImageView children asynchronously
    mImageFetcher = new ImageFetcher(this, longest);
    mImageFetcher.addImageCache(getSupportFragmentManager(), cacheParams);
    mImageFetcher.setImageFadeIn(false);

    // Set up ViewPager and backing adapter
    mAdapter = new ImagePagerAdapter(getSupportFragmentManager(), Images.imageUrls.length);
    mPager = (ViewPager) findViewById(R.id.pager);
    mPager.setAdapter(mAdapter);
    mPager.setPageMargin((int) getResources().getDimension(R.dimen.horizontal_page_margin));
    mPager.setOffscreenPageLimit(2);

    // Set up activity to go full screen
    getWindow().addFlags(LayoutParams.FLAG_FULLSCREEN);

    // Enable some additional newer visibility and ActionBar features to create a more
    // immersive photo viewing experience
    if (Utils.hasHoneycomb()) {
        final ActionBar actionBar = getActionBar();

        // Hide title text and set home as up
        actionBar.setDisplayShowTitleEnabled(false);
        actionBar.setDisplayHomeAsUpEnabled(true);

        // Hide and show the ActionBar as the visibility changes
        mPager.setOnSystemUiVisibilityChangeListener(
                new View.OnSystemUiVisibilityChangeListener() {
                    @Override
                    public void onSystemUiVisibilityChange(int vis) {
                        if ((vis & View.SYSTEM_UI_FLAG_LOW_PROFILE) != 0) {
                            actionBar.hide();
                        } else {
                            actionBar.show();
                        }
                    }
                });

        // Start low profile mode and hide ActionBar
        mPager.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
        actionBar.hide();
    }

    // Set the current item based on the extra passed in to this activity
    final int extraCurrentItem = getIntent().getIntExtra(EXTRA_IMAGE, -1);
    if (extraCurrentItem != -1) {
        mPager.setCurrentItem(extraCurrentItem);
    }
}
 
开发者ID:jjuiddong,项目名称:Android-Practice,代码行数:76,代码来源:ImageDetailActivity.java


注:本文中的android.app.ActionBar.setDisplayShowTitleEnabled方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。