diff --git a/sensorhub-android-app/res/layout/activity_edit_server_profile.xml b/sensorhub-android-app/res/layout/activity_edit_server_profile.xml index b42e699..87f7256 100644 --- a/sensorhub-android-app/res/layout/activity_edit_server_profile.xml +++ b/sensorhub-android-app/res/layout/activity_edit_server_profile.xml @@ -1,31 +1,26 @@ - - - - - - + android:layout_height="?attr/actionBarSize" + android:background="@color/toolbar_bg" + app:titleTextColor="@color/toolbar_title" + app:navigationIcon="@drawable/ic_arrow_back" /> + android:layout_height="0dp" + android:layout_weight="1" + android:fillViewport="true"> - + diff --git a/sensorhub-android-app/src/org/sensorhub/android/server/EditServerProfileActivity.java b/sensorhub-android-app/src/org/sensorhub/android/server/EditServerProfileActivity.java index 4b347f1..c711003 100644 --- a/sensorhub-android-app/src/org/sensorhub/android/server/EditServerProfileActivity.java +++ b/sensorhub-android-app/src/org/sensorhub/android/server/EditServerProfileActivity.java @@ -51,6 +51,7 @@ protected void onCreate(Bundle savedInstanceState) { setupListeners(); if (isEdit) populateFields(); updateSslVisibility(); + updateEndpointAutofill(); MaterialButton saveButton = findViewById(R.id.btn_save); saveButton.setOnClickListener(v -> saveProfile()); @@ -101,6 +102,17 @@ private void updateSslVisibility() { } } + + private void updateEndpointAutofill() { + profileTypeToggle.addOnButtonCheckedListener((group, checkedId, isChecked) -> { + if (!isChecked) return; + if (checkedId == R.id.btn_type_consys) { + endpointInput.setText("/sensorhub/api"); + } else if (checkedId == R.id.btn_type_sos) { + endpointInput.setText("/sensorhub/sos"); + } + }); + } private void populateFields() { nameInput.setText(profile.name); hostInput.setText(profile.host);