예제 #1
0
 private void update() {
   if (syncText != null) {
     this.syncText.setPermissions(permissions);
     if ((permissions & PermissionManager.FLAG_WRITE) == PermissionManager.FLAG_WRITE) {
       editText.setVisibility(VISIBLE);
       overlay.setVisibility(GONE);
       editText.setInputType(inputType);
       editText.setEnabled(true);
       syncText.acceptSuggestions();
     } else if ((permissions & PermissionManager.FLAG_SUGGEST) == PermissionManager.FLAG_SUGGEST) {
       editText.setVisibility(VISIBLE);
       overlay.setVisibility(GONE);
       editText.setInputType(inputType);
       editText.setEnabled(true);
     } else if ((permissions & PermissionManager.FLAG_READ) == PermissionManager.FLAG_READ) {
       editText.setVisibility(VISIBLE);
       overlay.setVisibility(GONE);
       syncText.rejectSuggestions();
       editText.setInputType(EditorInfo.TYPE_NULL);
       editText.setEnabled(false);
     } else {
       editText.setVisibility(GONE);
       overlay.setVisibility(VISIBLE);
       syncText.rejectSuggestions();
       editText.setInputType(EditorInfo.TYPE_NULL);
       editText.setEnabled(false);
     }
   }
   if (!editable) {
     editText.disable();
   } else {
     editText.enable();
   }
 }
예제 #2
0
 public void acceptSuggestions(String src) {
   syncText.acceptSuggestions(src);
 }