下面列出了android.app.ActionBar#setDisplayUseLogoEnabled ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
/**
* 设置ActionBar的布局
*
* @param layoutId 布局Id
*/
public void setActionBarLayout(int layoutId) {
ActionBar actionBar = getActionBar();
if (null != actionBar) {
actionBar.setDisplayShowHomeEnabled(false);
actionBar.setDisplayShowCustomEnabled(true);
actionBar.setDisplayShowTitleEnabled(false);
actionBar.setDisplayHomeAsUpEnabled(false);
actionBar.setDisplayUseLogoEnabled(false);
LayoutInflater inflator = (LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View v = inflator.inflate(layoutId, null);
ActionBar.LayoutParams layout = new ActionBar.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
actionBar.setCustomView(v, layout);
}
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.post_view);
//Determine which post we are showing
KWBApplication application = (KWBApplication) getApplication();
Intent intent = getIntent();
post = application.getPostById(intent.getLongExtra("postId", -1));
//Customize the action bar
ActionBar actionBar = getActionBar();
if(actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setDisplayShowHomeEnabled(false);
actionBar.setDisplayShowTitleEnabled(true);
actionBar.setTitle(post.getTitle());
actionBar.setDisplayUseLogoEnabled(false);
}
//Get references to needed UI components
contentView = (WebView) findViewById(R.id.post_content);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_picturewallchoose);
ActionBar actionBar = getActionBar();
actionBar.setDisplayUseLogoEnabled(false);
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setDisplayShowHomeEnabled(false);
handler = new PWCHandler();
pd = ProgressDialog.show(PictureWallChoose.this, null, getString(R.string.action_loading), true);
Message msg = handler.obtainMessage();
msg.obj = "start";
handler.sendMessageDelayed(msg, 500);
sp_tip = getSharedPreferences("tip", 0);
SmartBarUtils.setBackIcon(getActionBar(),
getResources().getDrawable(R.drawable.ic_back));
}
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.user_information_edit);
// ��ӷ��ذ�ť��ActionBar
ActionBar actionBar = getActionBar();
actionBar.setIcon(null);
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setDisplayUseLogoEnabled(false);
actionBar.show();
// ��������Activity�����IJ���
Intent intent = this.getIntent();
Bundle bundle = intent.getExtras();
uid = bundle.getString("uid");
avatar_file = bundle.getString("avatar_file");
// ͼ�ν����ʼ��
init();
}
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.topic_detail);
ActionBar actionBar = getActionBar();
actionBar.setIcon(null);
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setDisplayUseLogoEnabled(false);
actionBar.show();
Intent intent = getIntent();
String topic_id = intent.getStringExtra("topic_id");
int isFocus= intent.getIntExtra("isFocus", 10);
dm = getResources().getDisplayMetrics();
ViewPager pager = (ViewPager) findViewById(R.id.pager);
tabs = (PagerSlidingTabStrip) findViewById(R.id.tabs);
pager.setAdapter(new TopicDetailAdapter(getSupportFragmentManager(),topic_id,isFocus));
tabs.setViewPager(pager);
setTabsValue();
}
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
protected void setupNavDrawer(Bundle savedInstanceState) {
initDrawerItemsMap();
determineDrawerItemsToInclude();
navDrawerList.setOnItemClickListener(getNavDrawerClickListener());
refreshItems();
ActionBar actionBar = activity.getActionBar();
actionBar.setHomeButtonEnabled(true);
actionBar.setDisplayHomeAsUpEnabled(false);
actionBar.setDisplayUseLogoEnabled(false);
actionBar.setIcon(R.drawable.ic_menu_bar);
if (savedInstanceState != null &&
savedInstanceState.getBoolean(KEY_DRAWER_WAS_OPEN)) {
reopenDrawerWhenResumed = true;
}
}
void initActionBar(String title) {
ActionBar actionBar = getActionBar();
if (title != null) {
actionBar.setTitle(title);
}
actionBar.setDisplayUseLogoEnabled(false);
actionBar.setDisplayHomeAsUpEnabled(true);
}
@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);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ActionBar actionBar = getActionBar();
actionBar.setDisplayUseLogoEnabled(false);
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setDisplayShowHomeEnabled(false);
getFragmentManager().beginTransaction()
.replace(android.R.id.content, new SettingMoreFragment())
.commit();
}
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);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.attention_listview);
ActionBar actionBar = getActionBar();
actionBar.setIcon(null);
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setDisplayUseLogoEnabled(false);
actionBar.show();
Intent intent = getIntent();
String UserOrMe = intent.getStringExtra("userorme");
uid = intent.getStringExtra("uid");
if (UserOrMe.equals(GlobalVariables.ATTENEION_ME)) {
url = Config.getValue("AttentionMe");
} else {
url = Config.getValue("AttentionUser");
}
attentionUserModels = new ArrayList<AttentionUserModel>();
imageDownLoader = new ImageDownLoader(AttentionUserActivity.this);
footerLinearLayout = (LinearLayout) LayoutInflater.from(
AttentionUserActivity.this).inflate(R.layout.next_page_footer,
null);
footText = (TextView) footerLinearLayout.findViewById(R.id.footer_text);
isFirstEnter = true;
FanfanSharedPreferences fanfanSharedPreferences = new FanfanSharedPreferences(
AttentionUserActivity.this);
init();
getInformation("1");
}
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.user_information_show);
LinearLayout hidePart = (LinearLayout) findViewById(R.id.llHidePart);
hidePart.setVisibility(View.GONE);
// ��ӷ��ذ�ť��ActionBar
ActionBar actionBar = getActionBar();
actionBar.setIcon(null);
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setDisplayUseLogoEnabled(false);
// actionBar.setDisplayShowHomeEnabled(true);
actionBar.show();
// Bundle bundle = intent.getExtras();
// ��ȡ����activity�Ĵ�������ֵ��
Intent intent = this.getIntent();
uid = intent.getStringExtra("uid");
status = intent
.getIntExtra("status", GlobalVariables.DISAVAILABLE_EDIT);
// �ж�UID�Dz��DZ������ѵ�¼�û�������ǿ��Ա༭�����ع�ע��ť���������ر༭��ť��ʾ��ע��ť��
ffGetUid = new FanfanSharedPreferences(this);
if (uid.equals(ffGetUid.getUid(""))) {
status = GlobalVariables.AVAILABLE_EDIT;
}
init();// ��ʼ������
// ��ȡ����״̬����������״̬����
if (uid != null) {
NetworkState networkState = new NetworkState();
if (networkState.isNetworkConnected(UserInfoShowActivity.this)) {
getUserInfo();
} else {
Toast.makeText(UserInfoShowActivity.this, "�����磬�����ú����ԣ�",
Toast.LENGTH_LONG).show();
}
}
}
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
ActionBar actionBar = getActionBar();
actionBar.setIcon(null);
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setDisplayUseLogoEnabled(false);
actionBar.show();
setContentView(R.layout.topic_activity);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.settings);
// action bar icon as home link
ActionBar actionBar = getActionBar();
actionBar.setSubtitle("Settings");
actionBar.setHomeButtonEnabled(true);
actionBar.setDisplayUseLogoEnabled(false);
actionBar.setDisplayHomeAsUpEnabled(true);
// preferences
prefs = getSharedPreferences("DroidPlay", 0);
// server port
serverPort = (EditText) findViewById(R.id.server_port);
// image transition
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, R.layout.image_transition_item, R.id.transition, AirPlayUtils.getTransitionDescriptions());
imageTransition = (Spinner) findViewById(R.id.image_transition);
imageTransition.setAdapter(adapter);
// load settings
loadSettings();
}
@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_));
}
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
super.onCreateOptionsMenu(menu, inflater);
inflater.inflate(R.menu.activity_home_gallery, menu);
MenuItem menuFilter = menu.findItem(R.id.menu_filter);
Spinner spinner = (Spinner) menuFilter.getActionView();
GalleryFilterAdapter spinnerAdapter = new GalleryFilterAdapter(spinner.getContext(), this.getResources().getTextArray(R.array.filter_options));
spinner.setAdapter(spinnerAdapter);
spinner.setOnItemSelectedListener(this);
mMenuItemBatchOperations = menu.findItem(R.id.menu_select);
miDropbox = menu.findItem(R.id.menu_remote_access_dropbox);
DropboxSyncManager dsm = DropboxSyncManager.getInstance(a);
if (dsm != null && dsm.isSyncing())
miDropbox.setChecked(true);
ActionBar actionBar = getActivity().getActionBar();
actionBar.setDisplayShowTitleEnabled(true);
actionBar.setTitle(R.string.home_gallery_title);
actionBar.setDisplayShowHomeEnabled(true);
actionBar.setDisplayHomeAsUpEnabled(false);
actionBar.setHomeButtonEnabled(true);
actionBar.setLogo(this.getResources().getDrawable(
R.drawable.ic_action_up));
actionBar.setDisplayUseLogoEnabled(true);
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
}
/**
* For the theme chooser
*/
private void initActionBar() {
ActionBar actBar = getActionBar();
actBar.setDisplayUseLogoEnabled(true);
actBar.setDisplayShowTitleEnabled(false);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.comment_list);
ActionBar actionBar = getActionBar();
actionBar.setIcon(null);
actionBar.setTitle("��������");
actionBar.setDisplayUseLogoEnabled(false);
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.show();
Intent intent = getIntent();
id = intent.getStringExtra("artid");
client = new AsyncHttpClient();
myCookieStore = new PersistentCookieStore(this);
client.setCookieStore(myCookieStore);
comment = (EditText) findViewById(R.id.comment);
publish = (ImageButton) findViewById(R.id.publish);
publish.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
RequestParams params = new RequestParams();
params.put("article_id", id);
params.put("message", comment.getText().toString());
params.put("at_uid", atuid);
postcom(params);
comment.setText("");
refresh();
}
});
comitems = new ArrayList<EssayCommentModel>();
imageDownLoader = new ImageDownLoader(this);
comlist = (ListView) findViewById(R.id.comlist);
isFirstEnter = true;
comlist.setOnItemClickListener(this);
comlist.setOnScrollListener(this);
Getcom(id);
}
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
private void setLogoICS(PXStylerContext context, ActionBar actionBar) {
actionBar.setDisplayUseLogoEnabled(true);
actionBar.setLogo(context.getBackgroundImage());
}
private void setUpActionBar() {
ActionBar bar = getActionBar();
bar.setDisplayUseLogoEnabled(true);
bar.setTitle("");
}