@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); Fragment fragment; String tag; if (getIntent().getExtras().containsKey(TaskCommentsFragment.EXTRA_TASK)) { fragment = new TaskCommentsFragment(); tag = "taskupdates_fragment"; // $NON-NLS-1$ } else { fragment = new TagCommentsFragment(); tag = "tagupdates_fragment"; // $NON-NLS-1$ } FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); transaction.add(R.id.comments_fragment_container, fragment, tag); transaction.commit(); }
private void initializeActionBar() { mActionBar = getSupportActionBar(); mActionBar.setDisplayShowCustomEnabled(true); mActionBar.setCustomView(R.layout.actionbar_custom); View customView = mActionBar.getCustomView(); mActionBarMessageList = customView.findViewById(R.id.actionbar_message_list); mActionBarMessageView = customView.findViewById(R.id.actionbar_message_view); mActionBarSubject = (MessageTitleView) customView.findViewById(R.id.message_title_view); mActionBarTitle = (TextView) customView.findViewById(R.id.actionbar_title_first); mActionBarSubTitle = (TextView) customView.findViewById(R.id.actionbar_title_sub); mActionBarUnread = (TextView) customView.findViewById(R.id.actionbar_unread_count); mActionBarProgress = (ProgressBar) customView.findViewById(R.id.actionbar_progress); mActionButtonIndeterminateProgress = getLayoutInflater().inflate(R.layout.actionbar_indeterminate_progress_actionview, null); mActionBar.setDisplayHomeAsUpEnabled(true); }
public void setActionBar() { try { com.actionbarsherlock.app.ActionBar actionBar = getSupportActionBar(); getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setHomeButtonEnabled(true); actionBar.setDisplayShowHomeEnabled(false); actionBar.setDisplayShowTitleEnabled(false); actionBar.setCustomView(R.layout.chatactionbar); actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM); pic = (ImageView) actionBar.getCustomView().findViewById(R.id.ab_userpic); name = (TextView) actionBar.getCustomView().findViewById(R.id.ab_userName); LinearLayout backfrChat = (LinearLayout) actionBar.getCustomView().findViewById(R.id.ll_backFromChat); tv_userStatus = (TextView) actionBar.getCustomView().findViewById(R.id.ab_userStatus); LinearLayout ll_userprofile = (LinearLayout) actionBar.getCustomView().findViewById(R.id.ll_calluserProfile); btn_filetransfer = (Button) actionBar.getCustomView().findViewById(R.id.btnattechment); btn_filetransfer.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub viewAttechmentPopup(v); } }); backfrChat.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub callBack(); } }); ll_userprofile.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { callUserProfileActivity(); } }); vv = detailFragment.getView(); bodyInput = (EditText) vv.findViewById(R.id.embedded_text_editor); Fl_Emoticon_Holder = (FrameLayout) vv.findViewById(R.id.fl_emojicons); btn_emoticon_show = (ImageButton) vv.findViewById(R.id.ib_enable_emoticon_frame); String user_number = prefs.getString(stored_chatuserNumber, "No Value"); if (user_number.contains("@")) { String[] nu = user_number.split("@"); nu = nu[0].split(":"); user_number = nu[1]; } supportnum = prefs.getString(stored_supportnumber, ""); String nu = detailFragment.stripNumber(user_number); String fileuri = Environment.getExternalStorageDirectory() + "/R4W/ProfilePic/" + nu + ".png"; Log.d("fileuri", fileuri + " !"); Log.d("supportnum", supportnum); Log.d("nu", nu); if (nu.equals(supportnum)) { pic.setImageResource(R.drawable.roaminglogo); } else { File imageDirectoryprofile = new File(fileuri); if (imageDirectoryprofile.exists()) { pic.setImageURI(Uri.parse(fileuri)); } else { pic.setImageResource(R.drawable.ic_contact_picture_180_holo_light); } } String username = nu; if (dbContacts == null) { dbContacts = new DBContacts(MessageActivity.this); } String nameServer = "", nameContact = ""; dbContacts.openToRead(); Cursor cursor = dbContacts.fetch_contact_from_R4W(nu); if (cursor.getCount() > 0) { cursor.moveToFirst(); nameServer = cursor.getString(5).toString(); nameContact = cursor.getString(2).toString(); cursor.close(); dbContacts.close(); Log.d("nameServer", nameServer + " in"); Log.d("nameContact", nameContact + " in"); if (!nameServer.equals("***no name***")) { username = nameServer; } else { username = nameContact; } name.setText(username); } else { name.setText(nu); } } catch (Exception e) { // TODO: handle exception } }