add some menu items to setup screen

This commit is contained in:
Daniel Gultsch 2023-02-26 19:36:26 +01:00
parent b8f3472af0
commit 6ef2997b5e
No known key found for this signature in database
GPG key ID: F43D18AD2A0982C2
4 changed files with 28 additions and 4 deletions

View file

@ -15,10 +15,13 @@ public class SignInFragment extends AbstractSetupFragment {
public View onCreateView(
@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
super.onCreateView(inflater, container, savedInstanceState);
FragmentSignInBinding binding =
final FragmentSignInBinding binding =
DataBindingUtil.inflate(inflater, R.layout.fragment_sign_in, container, false);
binding.setSetupViewModel(setupViewModel);
binding.setLifecycleOwner(getViewLifecycleOwner());
final var menu = binding.materialToolbar.getMenu();
menu.findItem(R.id.scan_qr_code).setVisible(true);
menu.findItem(R.id.certificate_login).setVisible(true);
return binding.getRoot();
}
}

View file

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M9.5,6.5v3h-3v-3H9.5M11,5H5v6h6V5L11,5zM9.5,14.5v3h-3v-3H9.5M11,13H5v6h6V13L11,13zM17.5,6.5v3h-3v-3H17.5M19,5h-6v6h6V5L19,5zM13,13h1.5v1.5H13V13zM14.5,14.5H16V16h-1.5V14.5zM16,13h1.5v1.5H16V13zM13,16h1.5v1.5H13V16zM14.5,17.5H16V19h-1.5V17.5zM16,16h1.5v1.5H16V16zM17.5,14.5H19V16h-1.5V14.5zM17.5,17.5H19V19h-1.5V17.5zM22,7h-2V4h-3V2h5V7zM22,22v-5h-2v3h-3v2H22zM2,22h5v-2H4v-3H2V22zM2,2v5h2V4h3V2H2z" />
</vector>

View file

@ -2,9 +2,19 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/account_settings"
android:icon="@drawable/ic_settings_24dp"
android:title="@string/account_settings"
android:id="@+id/scan_qr_code"
android:icon="@drawable/ic_qr_code_scanner_24dp"
android:title="@string/scan_qr_code"
android:visible="false"
app:showAsAction="ifRoom" />
<item
android:id="@+id/account_settings"
android:title="@string/account_settings"
app:showAsAction="never" />
<item
android:id="@+id/certificate_login"
android:title="@string/certificate_login"
android:visible="false"
app:showAsAction="never" />
</menu>

View file

@ -1041,5 +1041,6 @@
<string name="use_opportunistic_tls">Opportunistic TLS (STARTTLS)</string>
<string name="info_required">Info required</string>
<string name="invalid">Invalid!</string>
<string name="certificate_login">Certificate login</string>
</resources>