Пример #1
0
  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();
    }
  }
Пример #2
0
  @Override
  public void onResume() {
    super.onResume();

    // TODO async query
    Cursor c = Preferences.getRecentStatusMessages(getActivity());
    mAdapter.changeCursor(c);
  }
Пример #3
0
 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());
 }
Пример #4
0
  @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;
  }