private void finish(String text) { Activity parent = getActivity(); if (parent != null) { if (text.trim().length() <= 0) text = text.trim(); Preferences.setStatusMessage(text); Preferences.addRecentStatusMessage(parent, text); // start the message center to push the status message MessageCenterService.updateStatus(parent); parent.finish(); } }
@Override public void onResume() { super.onResume(); // TODO async query Cursor c = Preferences.getRecentStatusMessages(getActivity()); mAdapter.changeCursor(c); }
public static void setTextStyle(TextView textView) { Context context = textView.getContext(); String size = Preferences.getFontSize(context); int sizeId; if (size.equals("small")) sizeId = android.R.style.TextAppearance_Small; else if (size.equals("large")) sizeId = android.R.style.TextAppearance_Large; else sizeId = android.R.style.TextAppearance; TextViewCompat.setTextAppearance(textView, sizeId); // setEmojiconSize((int) getTextSize()); }
@Override public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.status_fragment, container, false); mStatus = (EditText) view.findViewById(android.R.id.input); // TODO retrieve current status from server? mStatus.setText(Preferences.getStatusMessage()); view.findViewById(R.id.button_ok).setOnClickListener(this); view.findViewById(R.id.button_cancel).setOnClickListener(this); return view; }