private TextInputLayout passwordLayout;
private TextView profileName;
private TextInputLayout profileNameLayout;
+ private TextView preferredAccountsFilter;
+ private TextInputLayout preferredAccountsFilterLayout;
private View huePickerView;
/**
mProfile.setName(profileName.getText());
mProfile.setUrl(url.getText());
mProfile.setPostingPermitted(postingPermitted.isChecked());
+ mProfile.setPreferredAccountsFilter(preferredAccountsFilter.getText());
mProfile.setAuthEnabled(useAuthentication.isChecked());
mProfile.setAuthUserName(userName.getText());
mProfile.setAuthPassword(password.getText());
mProfile.setThemeId(huePickerView.getTag());
+ }
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
password = rootView.findViewById(R.id.password);
passwordLayout = rootView.findViewById(R.id.password_layout);
huePickerView = rootView.findViewById(R.id.btn_pick_ring_color);
+ preferredAccountsFilter = rootView.findViewById(R.id.preferred_accounts_filter_filter);
+ preferredAccountsFilterLayout =
+ rootView.findViewById(R.id.preferred_accounts_accounts_filter_layout);
useAuthentication.setOnCheckedChangeListener((buttonView, isChecked) -> {
Log.d("profiles", isChecked ? "auth enabled " : "auth disabled");
if (isChecked) userName.requestFocus();
});
+ preferredAccountsFilter.setText(mProfile.getPreferredAccountsFilter());
+ postingPermitted.setOnCheckedChangeListener(((buttonView, isChecked) -> {
+ preferredAccountsFilterLayout.setVisibility(isChecked ? View.VISIBLE : View.GONE);
+ }));
+
hookClearErrorOnFocusListener(profileName, profileNameLayout);
hookClearErrorOnFocusListener(url, urlLayout);
hookClearErrorOnFocusListener(userName, userNameLayout);
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:animateLayoutChanges="true"
android:orientation="vertical">
<Switch
</LinearLayout>
+ <com.google.android.material.textfield.TextInputLayout
+ android:id="@+id/preferred_accounts_accounts_filter_layout"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="16dp"
+ android:orientation="vertical">
+
+ <com.google.android.material.textfield.TextInputEditText
+ android:id="@+id/preferred_accounts_filter_filter"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:ems="10"
+ android:fontFamily="monospace"
+ android:hint="@string/pref_preferred_autocompletion_account_filter_hint"
+ android:inputType="text" />
+ </com.google.android.material.textfield.TextInputLayout>
+
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"