List of usage examples for android.support.v4.app ActionBar getCustomView
public abstract View getCustomView();
From source file:com.todoroo.astrid.actfm.TagUpdatesActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { ThemeService.applyTheme(this); super.onCreate(savedInstanceState); setContentView(R.layout.tag_updates_activity); ActionBar actionBar = getSupportActionBar(); actionBar.setDisplayHomeAsUpEnabled(true); actionBar.setDisplayShowTitleEnabled(false); actionBar.setDisplayShowCustomEnabled(true); actionBar.setCustomView(R.layout.header_title_view); ((TextView) actionBar.getCustomView().findViewById(R.id.title)).setText(R.string.TAd_contextEditTask); }
From source file:com.todoroo.astrid.actfm.TagSettingsActivity.java
private void refreshSettingsPage() { tagName.setText(tagData.getValue(TagData.NAME)); ActionBar ab = getSupportActionBar(); if (ab != null) { View customView = ab.getCustomView(); TextView titleView = (TextView) customView.findViewById(R.id.title); if (isNewTag) { titleView.setText(getString(R.string.tag_new_list)); } else {/*from w w w . ja v a2s. c om*/ titleView.setText(getString(R.string.tag_settings_title)); } } else { if (isNewTag) { setTitle(getString(R.string.tag_new_list)); } else { setTitle(getString(R.string.tag_settings_title)); } } picture.setUrl(tagData.getValue(TagData.PICTURE)); if (!isNewTag) { ImageView shortcut = (ImageView) findViewById(R.id.create_shortcut); shortcut.setImageBitmap(FilterListFragment.superImposeListIcon(this, picture.getImageBitmap(), tagData.getValue(TagData.NAME))); } String peopleJson = tagData.getValue(TagData.MEMBERS); updateMembers(peopleJson); tagDescription.setText(tagData.getValue(TagData.TAG_DESCRIPTION)); }
From source file:com.todoroo.astrid.actfm.TagUpdatesFragment.java
protected void setUpUpdateList() { if (getActivity() instanceof TagUpdatesActivity) { ActionBar ab = ((AstridActivity) getActivity()).getSupportActionBar(); String title = (tagData == null) ? getString(R.string.TLA_all_activity) : getString(R.string.tag_updates_title, tagData.getValue(TagData.NAME)); ((TextView) ab.getCustomView().findViewById(R.id.title)).setText(title); }/*from ww w . j a va 2 s .co m*/ final ImageButton commentButton = (ImageButton) getView().findViewById(R.id.commentButton); addCommentField = (EditText) getView().findViewById(R.id.commentField); addCommentField.setOnEditorActionListener(new OnEditorActionListener() { @Override public boolean onEditorAction(TextView view, int actionId, KeyEvent event) { if (actionId == EditorInfo.IME_NULL && addCommentField.getText().length() > 0) { addComment(); return true; } return false; } }); addCommentField.addTextChangedListener(new TextWatcher() { @Override public void afterTextChanged(Editable s) { commentButton.setVisibility((s.length() > 0) ? View.VISIBLE : View.GONE); } @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { // } @Override public void onTextChanged(CharSequence s, int start, int before, int count) { // } }); commentButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { addComment(); } }); final ClearImageCallback clearImage = new ClearImageCallback() { @Override public void clearImage() { picture = null; resetPictureButton(); } }; pictureButton = (ImageButton) getView().findViewById(R.id.picture); pictureButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (picture != null) ActFmCameraModule.showPictureLauncher(TagUpdatesFragment.this, clearImage); else ActFmCameraModule.showPictureLauncher(TagUpdatesFragment.this, null); } }); refreshUpdatesList(); refreshActivity(false); // start a pull in the background }
From source file:com.todoroo.astrid.taskrabbit.TaskRabbitActivity.java
public void showAddListPopover() { if (!Preferences.getBoolean(TASK_RABBIT_POPOVER_PREF, false)) { ActionBar actionBar = getSupportActionBar(); HelpInfoPopover.showPopover(this, actionBar.getCustomView().findViewById(R.id.menu_nav), R.string.help_popover_taskrabbit_type, null); Preferences.setBoolean(TASK_RABBIT_POPOVER_PREF, true); }/*from w w w . ja va2s . co m*/ }
From source file:com.todoroo.astrid.taskrabbit.TaskRabbitActivity.java
/** Initialize UI components */ private void setUpUIComponents() { if (taskTitle == null) { taskTitle = (EditText) findViewById(R.id.task_title); taskControls = (LinearLayout) findViewById(R.id.task_controls); descriptionControls = (LinearLayout) findViewById(R.id.description_controls); taskButton = (Button) findViewById(R.id.task_button); taskButton.setOnClickListener(new OnClickListener() { public void onClick(View v) { submitTaskRabbit();//ww w . j a va 2 s.c o m } }); ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.setDisplayHomeAsUpEnabled(true); actionBar.setDisplayShowTitleEnabled(false); actionBar.setDisplayShowCustomEnabled(true); actionBar.setCustomView(R.layout.task_rabbit_header_view); View customView = actionBar.getCustomView(); menuNav = customView.findViewById(R.id.menu_nav); menuNavDisclosure = (ImageView) customView.findViewById(R.id.menu_disclosure_arrow); menuTitle = (TextView) customView.findViewById(R.id.task_rabbit_title); menuNav.setOnClickListener(menuClickListener); createMenuPopover(); } setUpControls(); } }