Refactoring

This commit is contained in:
tl 2022-07-13 11:00:58 +02:00
parent 373d0c161b
commit 321a67c44a
34 changed files with 178 additions and 234 deletions

View File

@ -1,6 +1,5 @@
package eu.csc.vehown.ui.base;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.FragmentActivity;
import android.content.Intent;
@ -9,8 +8,8 @@ import android.util.Log;
import eu.csc.vehown.R;
import eu.csc.vehown.ui.fragments.details.FragmentDetailDevice;
import eu.csc.vehown.ui.registration.devices.DeviceRegistrationFragment;
import eu.csc.vehown.ui.registration.vehicle.FragmentVehicleRegistration;
import eu.csc.vehown.ui.registration.device.DeviceRegistrationFragment;
import eu.csc.vehown.ui.registration.vehicle.VehicleRegistrationFragment;
import static eu.csc.vehown.ui.fragments.details.AbstractDetailFragment.ARG_ITEM_ID;
import static eu.csc.vehown.ui.fragments.details.AbstractDetailFragment.ARG_RESULT_CODE;
@ -74,7 +73,7 @@ public class ActivityBaseDetailContent extends AbstractAppCompatActivity {
case ARG_ITEM_TYPE_VEHICLE:
Log.d("DATA", id);
//switchFragment(R.id.flContent, FragmentDetailVehicle.newInstance(id));
switchFragment(R.id.flContent, FragmentVehicleRegistration.editCurrentItem(id));
switchFragment(R.id.flContent, VehicleRegistrationFragment.editCurrentItem(id));
break;
case ARG_ITEM_TYPE_DEVICE:
switchFragment(R.id.flContent, FragmentDetailDevice.newInstance(id));

View File

@ -1,6 +1,5 @@
package eu.csc.vehown.ui.base;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.Toast;
@ -14,11 +13,10 @@ import androidx.navigation.ui.AppBarConfiguration;
import androidx.navigation.ui.NavigationUI;
import eu.csc.vehown.R;
import eu.csc.vehown.databinding.ActivityBaseRegistrationBinding;
import static eu.csc.vehown.ui.fragments.details.AbstractDetailFragment.ARG_ITEM_ID;
import eu.csc.vehown.ui.registration.vehicle.VehicleRegistrationFragment;
/**
* @see eu.csc.vehown.ui.registration.vehicle.FragmentVehicleRegistration
* @see VehicleRegistrationFragment
*/
public class BaseRegistrationActivity extends AppCompatActivity implements ICallbackInterface {

View File

@ -7,23 +7,12 @@ import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.navigation.NavController;
import androidx.navigation.Navigation;
import androidx.navigation.ui.AppBarConfiguration;
import androidx.navigation.ui.NavigationUI;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import com.google.android.material.navigation.NavigationView;
import eu.csc.vehown.R;
import eu.csc.vehown.ui.md.CustomerVehicleDetailFragment;
import eu.csc.vehown.ui.md.ItemDetailHostActivity;
public class ActivityLocalContentNavigation extends AppCompatActivity {
@ -38,7 +27,7 @@ public class ActivityLocalContentNavigation extends AppCompatActivity {
// NavigationView navigationView = findViewById(R.id.nav_view_local_content);
// Passing each menu ID as a set of Ids because each
// menu should be considered as top level destinations.
actionBarDrawerToggle = new ActionBarDrawerToggle(this, drawer, R.string.nav_open, R.string.nav_close);
actionBarDrawerToggle = new ActionBarDrawerToggle(this, drawer, R.string.open, R.string.close);
// pass the Open and Close toggle for the drawer layout listener
// to toggle the button

View File

@ -9,7 +9,7 @@ import lombok.Getter;
import java.util.List;
public class ShowVehicleAndDevicesViewModel extends AbstractBaseViewModel {
public class VehicleAndDevicesViewModel extends AbstractBaseViewModel {
@Getter
private final MutableLiveData<List<Vehicle>> mVehicles;
@ -17,7 +17,7 @@ public class ShowVehicleAndDevicesViewModel extends AbstractBaseViewModel {
@Getter
private final MutableLiveData<List<CustomerDevice>> mDevices;
public ShowVehicleAndDevicesViewModel(LocalStorageClient localStorage) {
public VehicleAndDevicesViewModel(LocalStorageClient localStorage) {
super(localStorage);
mDevices = new MutableLiveData<>();
mVehicles = new MutableLiveData<>();

View File

@ -31,17 +31,17 @@ import java.util.List;
import java.util.Objects;
/**
* @see ShowVehicleAndDevicesViewModel
* @see VehicleAndDevicesViewModel
*/
public class ShowVehiclesAndDevicesFragment extends AbstractFragment {
public class VehiclesAndDevicesFragment extends AbstractFragment {
private FragmentShowVehiclesAndDevicesBinding binding;
private ShowVehicleAndDevicesViewModel model;
private VehicleAndDevicesViewModel model;
private ActivityResultLauncher<Intent> launcherEditVehicle, launcherEditDevice;
private static final int LAUNCH_ACTIVITY_REGISTER_DEVICE = 1;
private static final int LAUNCH_ACTIVITY_REGISTER_VEHICLE = 2;
private final String TAG = ShowVehiclesAndDevicesFragment.class.getSimpleName();
private final String TAG = VehiclesAndDevicesFragment.class.getSimpleName();
@Override
public View onCreateView(@NotNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
@ -61,8 +61,8 @@ public class ShowVehiclesAndDevicesFragment extends AbstractFragment {
return binding.getRoot();
}
private ShowVehicleAndDevicesViewModel loadViewModel() {
return model = new ViewModelProvider(this, new AppViewModelFactory(getContext())).get(ShowVehicleAndDevicesViewModel.class);
private VehicleAndDevicesViewModel loadViewModel() {
return model = new ViewModelProvider(this, new AppViewModelFactory(getContext())).get(VehicleAndDevicesViewModel.class);
}
@ -82,11 +82,11 @@ public class ShowVehiclesAndDevicesFragment extends AbstractFragment {
model.init();
binding.btnAddVehicle.setOnClickListener(v -> {
Log.d(ShowVehiclesAndDevicesFragment.class.getSimpleName(), "Add vehicle");
Log.d(VehiclesAndDevicesFragment.class.getSimpleName(), "Add vehicle");
launcherEditVehicle.launch(RegisterVehicleActivity.createNew(getActivity()));
});
binding.btnAddDevice.setOnClickListener(v -> {
Log.d(ShowVehiclesAndDevicesFragment.class.getSimpleName(), "Add device");
Log.d(VehiclesAndDevicesFragment.class.getSimpleName(), "Add device");
launcherEditDevice.launch(ActivityBaseDetailContent.getDeviceRegistrationInstance(getActivity(), Activity.RESULT_OK));
});
}
@ -111,9 +111,9 @@ public class ShowVehiclesAndDevicesFragment extends AbstractFragment {
private final List<Vehicle> listVehicles = new ArrayList<>();
ShowVehicleAndDevicesViewModel model;
VehicleAndDevicesViewModel model;
VehicleAdapter(List<Vehicle> items, ShowVehicleAndDevicesViewModel model) {
VehicleAdapter(List<Vehicle> items, VehicleAndDevicesViewModel model) {
listVehicles.addAll(items);
this.model = model;
}
@ -135,7 +135,7 @@ public class ShowVehiclesAndDevicesFragment extends AbstractFragment {
Vehicle vehicle = listVehicles.get(position);
holder.itemView.setTag(vehicle);
holder.itemView.setOnClickListener(v -> {
Log.d(ShowVehiclesAndDevicesFragment.class.getSimpleName(), "Edit " + vehicle.getLicensePlate());
Log.d(VehiclesAndDevicesFragment.class.getSimpleName(), "Edit " + vehicle.getLicensePlate());
launcherEditVehicle.launch(ActivityBaseDetailContent.getVehicleDetailInstance(getActivity(), vehicle.getVin()));
});
@ -179,9 +179,9 @@ public class ShowVehiclesAndDevicesFragment extends AbstractFragment {
private final List<CustomerDevice> items = new ArrayList<>();
ShowVehicleAndDevicesViewModel model;
VehicleAndDevicesViewModel model;
DeviceAdapter(List<CustomerDevice> items, ShowVehicleAndDevicesViewModel model) {
DeviceAdapter(List<CustomerDevice> items, VehicleAndDevicesViewModel model) {
this.items.addAll(items);
this.model = model;
@ -205,7 +205,7 @@ public class ShowVehiclesAndDevicesFragment extends AbstractFragment {
var item = items.get(position);
holder.itemView.setTag(item);
holder.itemView.setOnClickListener(v -> {
Log.d(ShowVehiclesAndDevicesFragment.class.getSimpleName(), "" + item);
Log.d(VehiclesAndDevicesFragment.class.getSimpleName(), "" + item);
launcherEditDevice.launch(ActivityBaseDetailContent.getDeviceDetailInstance(getActivity(), item.getSerialNumber()));
});
//holder.img.setImageResource(device.getBitmap());

View File

@ -24,13 +24,11 @@ import android.widget.Toast;
import eu.csc.vehown.R;
import eu.csc.vehown.data.model.Customer;
import eu.csc.vehown.data.model.ICustomer;
import eu.csc.vehown.databinding.DeviceRegistrationFragmentBinding;
import eu.csc.vehown.databinding.FragmentCustomerRegistrationFragmentBinding;
import eu.csc.vehown.ui.base.AbstractFragment;
import eu.csc.vehown.ui.dialogs.DialogInfoFragment;
import eu.csc.vehown.ui.models.LoginFormState;
import eu.csc.vehown.ui.models.LoginResult;
import eu.csc.vehown.ui.registration.devices.DeviceRegistrationViewModel;
import eu.csc.vehown.ui.viewmodels.AppViewModelFactory;
/**

View File

@ -1,4 +1,4 @@
package eu.csc.vehown.ui.registration.devices;
package eu.csc.vehown.ui.registration.device;
import android.app.AlertDialog;
import android.content.DialogInterface;
@ -22,7 +22,7 @@ import android.view.View;
import android.view.ViewGroup;
import eu.csc.vehown.data.model.CustomerDevice;
import eu.csc.vehown.databinding.DeviceRegistrationFragmentBinding;
import eu.csc.vehown.databinding.FragmentDeviceRegistrationBinding;
import eu.csc.vehown.ui.base.AbstractFragment;
import eu.csc.vehown.ui.modal.Helper;
import eu.csc.vehown.ui.models.Result;
@ -34,7 +34,7 @@ import lombok.var;
public class DeviceRegistrationFragment extends AbstractFragment {
private DeviceRegistrationViewModel mViewModel;
private DeviceRegistrationFragmentBinding binding;
private FragmentDeviceRegistrationBinding binding;
private Integer result_code;
@ -54,7 +54,7 @@ public class DeviceRegistrationFragment extends AbstractFragment {
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
binding = DeviceRegistrationFragmentBinding.inflate(inflater, container, false);
binding = FragmentDeviceRegistrationBinding.inflate(inflater, container, false);
View root = binding.getRoot();

View File

@ -1,4 +1,4 @@
package eu.csc.vehown.ui.registration.devices;
package eu.csc.vehown.ui.registration.device;
import android.content.Context;

View File

@ -43,14 +43,14 @@ import java.util.*;
import static android.app.Activity.RESULT_OK;
public class FragmentVehicleRegistration extends Fragment {
public class VehicleRegistrationFragment extends Fragment {
private static final String TAG = FragmentVehicleRegistration.class.getSimpleName();
private static final String TAG = VehicleRegistrationFragment.class.getSimpleName();
private static final int REQUEST_IMAGE_CAPTURE = 11;
private static final int REQUEST_IMAGE_GALLERY = 12;
private FragmentVehicleRegistrationBinding binding;
private FragmentVehicleRegistrationViewModel viewModel;
private VehicleRegistrationViewModel viewModel;
private VehicleBrandAdapter brandAdapter;
private PropulsionTypeAdapter propulsionTypeAdapter;
private List<View> mandatoryFields;
@ -59,17 +59,17 @@ public class FragmentVehicleRegistration extends Fragment {
private Handler handler;
private Runnable timer;
public static FragmentVehicleRegistration newInstance() {
return new FragmentVehicleRegistration();
public static VehicleRegistrationFragment newInstance() {
return new VehicleRegistrationFragment();
}
public static FragmentVehicleRegistration editCurrentItem(String id) {
public static VehicleRegistrationFragment editCurrentItem(String id) {
Bundle args = new Bundle();
args.putString(ItemDetailFragment.ARG_ITEM_ID, id);
FragmentVehicleRegistration result = new FragmentVehicleRegistration();
VehicleRegistrationFragment result = new VehicleRegistrationFragment();
result.setArguments(args);
return result;
}
@ -85,7 +85,7 @@ public class FragmentVehicleRegistration extends Fragment {
id = args.getString(ItemDetailFragment.ARG_ITEM_ID, null);
}
viewModel = new ViewModelProvider(this, new AppViewModelFactory(getContext())).get(FragmentVehicleRegistrationViewModel.class);
viewModel = new ViewModelProvider(this, new AppViewModelFactory(getContext())).get(VehicleRegistrationViewModel.class);
mandatoryFields = new ArrayList<>(Arrays.asList(binding.spBrand, binding.spModel, binding.editPowertrain, binding.editVariant,
binding.editVIN, binding.editLicensePlate, binding.spPropulsion, binding.editRegistrationDate));

View File

@ -22,7 +22,7 @@ import eu.csc.vehown.ui.registration.data.CustomerVehicleRegistrationRepository;
import eu.csc.vehown.ui.viewmodels.AbstractBaseViewModel;
import lombok.Getter;
public class FragmentVehicleRegistrationViewModel extends AbstractBaseViewModel {
public class VehicleRegistrationViewModel extends AbstractBaseViewModel {
@Getter
private final CustomerRegistrationRepository repository;
@ -41,7 +41,7 @@ public class FragmentVehicleRegistrationViewModel extends AbstractBaseViewModel
@Getter
private final MutableLiveData<Vehicle> currentVehicle;
public FragmentVehicleRegistrationViewModel(CustomerRegistrationRepository repository, Context context, LocalStorageClient localStorageClient) {
public VehicleRegistrationViewModel(CustomerRegistrationRepository repository, Context context, LocalStorageClient localStorageClient) {
super(localStorageClient);
vehicleBrands = new MutableLiveData<>();
vehiclePropulsionTypes = new MutableLiveData<>();

View File

@ -10,14 +10,14 @@ import eu.csc.vehown.persist.sharedPreferences.SharedPreferencesFactory;
import eu.csc.vehown.ui.fragments.data.LoginRepository;
import eu.csc.vehown.ui.fragments.ui.login.LoginViewModel;
import eu.csc.vehown.ui.registration.RegistrationViewModel;
import eu.csc.vehown.ui.registration.ShowVehicleAndDevicesViewModel;
import eu.csc.vehown.ui.registration.VehicleAndDevicesViewModel;
import eu.csc.vehown.ui.registration.customer.FragmentCustomerRegistrationViewModel;
import eu.csc.vehown.ui.registration.data.CustomerContentDataSource;
import eu.csc.vehown.ui.registration.data.CustomerRegistrationRepository;
import eu.csc.vehown.ui.registration.data.CustomerVehicleRegistrationRepository;
import eu.csc.vehown.ui.registration.devices.DeviceRegistrationViewModel;
import eu.csc.vehown.ui.registration.device.DeviceRegistrationViewModel;
import eu.csc.vehown.ui.registration.login.CustomerRegistrationViewModel;
import eu.csc.vehown.ui.registration.vehicle.FragmentVehicleRegistrationViewModel;
import eu.csc.vehown.ui.registration.vehicle.VehicleRegistrationViewModel;
/**
* ViewModel provider factory to instantiate LoginViewModel.
@ -48,8 +48,8 @@ public class AppViewModelFactory implements ViewModelProvider.Factory {
LoginRepository.getInstance(new CustomerContentDataSource(), localStorage));
}
if (modelClass.isAssignableFrom(ShowVehicleAndDevicesViewModel.class)) {
return (T) new ShowVehicleAndDevicesViewModel(
if (modelClass.isAssignableFrom(VehicleAndDevicesViewModel.class)) {
return (T) new VehicleAndDevicesViewModel(
localStorage);
}
if (modelClass.isAssignableFrom(CustomerRegistrationViewModel.class)) {
@ -68,8 +68,8 @@ public class AppViewModelFactory implements ViewModelProvider.Factory {
else if(modelClass.isAssignableFrom(FragmentCustomerRegistrationViewModel.class)){
return (T) new FragmentCustomerRegistrationViewModel(localStorage, context, new CustomerContentDataSource());
}
else if(modelClass.isAssignableFrom(FragmentVehicleRegistrationViewModel.class)){
return (T) new FragmentVehicleRegistrationViewModel(CustomerRegistrationRepository.getInstance(
else if(modelClass.isAssignableFrom(VehicleRegistrationViewModel.class)){
return (T) new VehicleRegistrationViewModel(CustomerRegistrationRepository.getInstance(
new CustomerContentDataSource(),
localStorage),context, localStorage);
}

View File

@ -10,15 +10,15 @@
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".ui.registration.ui.login.CustomerRegistrationActivity">
tools:context=".ui.registration.login.CustomerRegistrationActivity">
<EditText
android:id="@+id/username"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="96dp"
android:autofillHints="@string/prompt_email"
android:hint="@string/prompt_email"
android:autofillHints="@string/email"
android:hint="@string/email"
android:inputType="textEmailAddress"
android:selectAllOnFocus="true"
app:layout_constraintEnd_toEndOf="parent"
@ -30,8 +30,8 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:autofillHints="@string/prompt_password"
android:hint="@string/prompt_password"
android:autofillHints="@string/password"
android:hint="@string/password"
android:imeActionLabel="@string/action_sign_in_short"
android:imeOptions="actionDone"
android:inputType="textPassword"

View File

@ -10,7 +10,7 @@
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".ui.registration.ui.login.CustomerRegistrationActivity">
tools:context=".ui.registration.login.CustomerRegistrationActivity">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="840dp"
@ -23,8 +23,8 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="96dp"
android:autofillHints="@string/prompt_email"
android:hint="@string/prompt_email"
android:autofillHints="@string/email"
android:hint="@string/email"
android:inputType="textEmailAddress"
android:selectAllOnFocus="true"
app:layout_constraintEnd_toEndOf="parent"
@ -36,8 +36,8 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:autofillHints="@string/prompt_password"
android:hint="@string/prompt_password"
android:autofillHints="@string/password"
android:hint="@string/password"
android:imeActionLabel="@string/action_sign_in_short"
android:imeOptions="actionDone"
android:inputType="textPassword"

View File

@ -10,7 +10,7 @@
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".ui.registration.ui.login.CustomerRegistrationActivity">
tools:context=".ui.registration.login.CustomerRegistrationActivity">
<EditText
android:id="@+id/edEmail"
@ -18,8 +18,8 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="96dp"
android:autofillHints="@string/prompt_email"
android:hint="@string/prompt_email"
android:autofillHints="@string/email"
android:hint="@string/email"
android:inputType="textEmailAddress"
android:selectAllOnFocus="true"
app:layout_constraintEnd_toEndOf="parent"
@ -32,8 +32,8 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:autofillHints="@string/prompt_firstname"
android:hint="@string/prompt_firstname"
android:autofillHints="@string/first_name"
android:hint="@string/first_name"
android:inputType="text"
android:selectAllOnFocus="true"
app:layout_constraintEnd_toEndOf="parent"
@ -44,8 +44,8 @@
android:id="@+id/edLastname"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:autofillHints="@string/prompt_lastname"
android:hint="@string/prompt_lastname"
android:autofillHints="@string/last_name"
android:hint="@string/last_name"
android:inputType="text"
android:selectAllOnFocus="true"
app:layout_constraintEnd_toEndOf="parent"
@ -58,8 +58,8 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:autofillHints="@string/prompt_Postal"
android:hint="@string/prompt_Postal"
android:autofillHints="@string/zip_postal"
android:hint="@string/zip_postal"
android:imeActionLabel="@string/action_sign_in_short"
android:imeOptions="actionDone"
android:inputType="text"
@ -73,8 +73,8 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:autofillHints="@string/prompt_street"
android:hint="@string/prompt_street"
android:autofillHints="@string/street"
android:hint="@string/street"
android:imeActionLabel="@string/action_sign_in_short"
android:imeOptions="actionDone"
android:inputType="text"
@ -88,8 +88,8 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:autofillHints="@string/prompt_password"
android:hint="@string/prompt_password"
android:autofillHints="@string/password"
android:hint="@string/password"
android:imeActionLabel="@string/action_sign_in_short"
android:imeOptions="actionDone"
android:inputType="textPassword"
@ -103,8 +103,8 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:autofillHints="@string/prompt_password"
android:hint="@string/prompt_password"
android:autofillHints="@string/password"
android:hint="@string/password"
android:imeActionLabel="@string/action_sign_in_short"
android:imeOptions="actionDone"
android:inputType="textPassword"
@ -121,7 +121,7 @@
android:layout_gravity="start"
android:layout_marginTop="16dp"
android:layout_marginBottom="64dp"
android:text="@string/action_register_customer"
android:text="@string/register_customer"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"

View File

@ -31,7 +31,7 @@
android:layout_marginStart="48dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="48dp"
android:text="@string/btn_no_text"
android:text="@string/NO_TEXT"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"

View File

@ -4,7 +4,7 @@
android:id="@+id/llVehicle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp">
android:layout_marginBottom="10dp">
<ImageView
android:id="@+id/img"
@ -19,6 +19,7 @@
android:layout_height="wrap_content"
android:layout_toEndOf="@id/img"
android:layout_toStartOf="@id/btnDelete"
android:layout_marginStart="10dp"
android:textColor="@color/green"
android:textStyle="bold"/>
@ -30,5 +31,6 @@
android:layout_alignParentEnd="true"
app:tint="@android:color/holo_red_light"
app:backgroundTint="@android:color/transparent"
/>
android:contentDescription="@string/image"/>
</RelativeLayout>

View File

@ -16,8 +16,8 @@
android:id="@+id/edEmail"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:autofillHints="@string/prompt_email"
android:hint="@string/prompt_email"
android:autofillHints="@string/email"
android:hint="@string/email"
android:inputType="textEmailAddress"
android:nextFocusDown="@id/edFirstname"
android:selectAllOnFocus="true"
@ -30,8 +30,8 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:autofillHints="@string/prompt_firstname"
android:hint="@string/prompt_firstname"
android:autofillHints="@string/first_name"
android:hint="@string/first_name"
android:inputType="text"
android:nextFocusDown="@id/edLastname"
android:selectAllOnFocus="true"
@ -43,8 +43,8 @@
android:id="@+id/edLastname"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:autofillHints="@string/prompt_lastname"
android:hint="@string/prompt_lastname"
android:autofillHints="@string/last_name"
android:hint="@string/last_name"
android:inputType="text"
android:selectAllOnFocus="true"
app:layout_constraintEnd_toEndOf="parent"
@ -57,8 +57,8 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:autofillHints="@string/prompt_Postal"
android:hint="@string/prompt_Postal"
android:autofillHints="@string/zip_postal"
android:hint="@string/zip_postal"
android:imeActionLabel="@string/action_sign_in_short"
android:imeOptions="actionDone"
android:inputType="text"
@ -74,8 +74,8 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:autofillHints="@string/prompt_street"
android:hint="@string/prompt_street"
android:autofillHints="@string/street"
android:hint="@string/street"
android:imeActionLabel="@string/action_sign_in_short"
android:imeOptions="actionDone"
android:inputType="text"
@ -110,8 +110,8 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:autofillHints="@string/prompt_password"
android:hint="@string/prompt_password"
android:autofillHints="@string/password"
android:hint="@string/password"
android:imeActionLabel="@string/action_sign_in_short"
android:imeOptions="actionDone"
android:inputType="textPassword"
@ -125,8 +125,8 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:autofillHints="@string/prompt_password"
android:hint="@string/prompt_password"
android:autofillHints="@string/password"
android:hint="@string/password"
android:imeActionLabel="@string/action_sign_in_short"
android:imeOptions="actionDone"
android:inputType="textPassword"
@ -143,7 +143,7 @@
android:layout_marginTop="16dp"
android:layout_marginBottom="64dp"
android:enabled="false"
android:text="@string/action_register_customer"
android:text="@string/register_customer"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"

View File

@ -7,7 +7,7 @@
android:layout_height="match_parent"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
tools:context=".ui.registration.devices.DeviceRegistrationFragment">
tools:context=".ui.registration.device.DeviceRegistrationFragment">
<TextView
@ -39,7 +39,7 @@
android:layout_height="wrap_content"
android:enabled="false"
android:text="@string/btn_find"
android:text="@string/find"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
@ -67,7 +67,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:enabled="false"
android:text="@string/btn_store"
android:text="@string/store"
app:layout_constraintTop_toBottomOf="@+id/textField" />
<ProgressBar

View File

@ -54,7 +54,7 @@
android:layout_marginEnd="0dp"
android:layout_marginBottom="0dp"
android:enabled="true"
android:text="@string/text_remember"
android:text="@string/remember"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/edPassword" />
@ -76,7 +76,7 @@
android:id="@+id/btnLogin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/btn_login"
android:text="@string/login"
style="@style/Widget.MaterialComponents.Button.TextButton"
android:enabled="false"/>
@ -86,7 +86,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:text="@string/btn_logout"
android:text="@string/logout"
style="@style/Widget.MaterialComponents.Button.TextButton"
android:enabled="false"/>

View File

@ -26,7 +26,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:hint="@string/prompt_deviceId"
android:hint="@string/deviceId"
android:inputType="text"
android:selectAllOnFocus="true"
/>
@ -36,7 +36,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:hint="@string/prompt_deviceName"
android:hint="@string/deviceName"
android:imeActionLabel="@string/action_sign_in_short"
android:imeOptions="actionDone"
android:inputType="text"

View File

@ -199,7 +199,7 @@
android:id="@+id/btnStore"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/store_register_vehicle"
android:text="@string/register_vehicle"
style="?android:attr/buttonBarButtonStyle"
android:enabled="true"/>
@ -208,7 +208,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:text="@string/undo_register_vehicle"
android:text="@string/undo"
style="?android:attr/buttonBarButtonStyle"
android:enabled="true"/>
@ -217,7 +217,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:text="@string/reload_from_storage_register_vehicle"
android:text="@string/reload"
style="?android:attr/buttonBarButtonStyle"
android:enabled="true"/>
@ -241,7 +241,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:text="@string/unregister_vehicle"
android:text="@string/unregister"
style="?android:attr/buttonBarButtonStyle"
android:enabled="false"/>

View File

@ -1,16 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/tvName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/green"
android:textStyle="bold" />
<TextView

View File

@ -2,7 +2,7 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item android:id="@+id/action_settings"
android:title="@string/action_settings"
android:title="@string/settings"
android:orderInCategory="100"
app:showAsAction="never" />

View File

@ -8,19 +8,19 @@
<item
android:id="@+id/nav_login"
android:icon="@drawable/ic_baseline_login_24"
android:title="@string/menu_login"
android:title="@string/login"
android:onClick="menuItemOnClicked"
/>
<item
android:id="@+id/nav_list_content"
android:icon="@drawable/ic_baseline_dashboard_24"
android:title="@string/menu_list_content"
android:title="@string/content"
android:onClick="menuItemOnClicked"
/>
<item
android:id="@+id/nav_list_vehicles"
android:icon="@drawable/ic_baseline_dashboard_24"
android:title="@string/menu_list_vehicles"
android:title="@string/customer_vehicles"
android:onClick="menuItemOnClicked"
/>
</group>
@ -39,20 +39,20 @@
/><item
android:id="@+id/nav_register_Customer"
android:icon="@drawable/ic_register"
android:title="@string/action_register_customer"
android:title="@string/register_customer"
android:onClick="menuItemOnClicked"
/>
<item
android:id="@+id/nav_register_base"
android:icon="@drawable/ic_register"
android:title="@string/register_base_title"
android:title="@string/registration"
android:onClick="menuItemOnClicked"
/>
<item
android:id="@+id/nav_show_vehicles_devices"
android:icon="@drawable/ic_register"
android:title="@string/show_vehicles_and_devices"
android:title="@string/vehicles_and_devices"
/>
<!--item
android:id="@+id/nav_register_vehicle"

View File

@ -6,15 +6,15 @@
<item
android:id="@+id/navigation_register_customer"
android:icon="@drawable/ic_baseline_how_to_reg_24"
android:title="@string/title_register_customer"/>
android:title="@string/customer"/>
<item
android:id="@+id/navigation_register_vehicle"
android:icon="@drawable/ic_baseline_car_crash_24"
android:title="@string/title_register_vehicle"/>
android:title="@string/vehicle"/>
<item
android:id="@+id/navigation_register_device"
android:icon="@drawable/ic_baseline_add_road_24"
android:title="@string/title_register_device"/>
android:title="@string/device"/>
</menu>

View File

@ -2,7 +2,7 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item android:id="@+id/action_settings"
android:title="@string/action_settings"
android:title="@string/settings"
android:orderInCategory="100"
app:showAsAction="never" />
</menu>

View File

@ -2,7 +2,7 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item android:id="@+id/action_settings"
android:title="@string/action_settings"
android:title="@string/settings"
android:orderInCategory="100"
app:showAsAction="never" />
</menu>

View File

@ -4,6 +4,6 @@
<item
android:id="@+id/action_settings"
android:orderInCategory="100"
android:title="@string/action_settings"
android:title="@string/settings"
app:showAsAction="never" />
</menu>

View File

@ -13,8 +13,8 @@
<fragment
android:id="@+id/nav_show_vehicles_devices"
android:name="eu.csc.vehown.ui.registration.ShowVehiclesAndDevicesFragment"
android:label="@string/show_vehicles_and_devices"
android:name="eu.csc.vehown.ui.registration.VehiclesAndDevicesFragment"
android:label="@string/vehicles_and_devices"
tools:layout="@layout/fragment_show_vehicles_and_devices"/>
<!--fragment

View File

@ -8,19 +8,19 @@
<fragment
android:id="@+id/navigation_home"
android:name="eu.csc.vehown.ui.base.ui.home.HomeFragment"
android:label="@string/title_home"
android:label="@string/home"
tools:layout="@layout/fragment_home" />
<fragment
android:id="@+id/navigation_dashboard"
android:name="eu.csc.vehown.ui.base.ui.dashboard.DashboardFragment"
android:label="@string/title_dashboard"
android:label="@string/dashboard"
tools:layout="@layout/fragment_dashboard" />
<fragment
android:id="@+id/navigation_notifications"
android:name="eu.csc.vehown.ui.base.ui.notifications.NotificationsFragment"
android:label="@string/title_notifications"
android:label="@string/notifications"
tools:layout="@layout/fragment_notifications" />
<fragment
@ -32,13 +32,13 @@
<fragment
android:id="@+id/navigation_register_device"
android:name="eu.csc.vehown.ui.registration.devices.DeviceRegistrationFragment"
android:name="eu.csc.vehown.ui.registration.device.DeviceRegistrationFragment"
android:label="RegisterDeviceFragment"
tools:layout="@layout/fragment_register_device" />
<fragment
android:id="@+id/navigation_register_vehicle"
android:name="eu.csc.vehown.ui.registration.vehicle.FragmentVehicleRegistration"
android:name="eu.csc.vehown.ui.registration.vehicle.VehicleRegistrationFragment"
android:label="RegisterVehicleActivity"
tools:layout="@layout/fragment_vehicle_registration" />
</navigation>

View File

@ -7,7 +7,7 @@
<fragment
android:id="@+id/fragment_item_detail"
android:name="eu.csc.vehown.ui.md.ItemDetailFragment"
android:label="@string/title_item_detail"
android:label="@string/item_detail"
tools:layout="@layout/fragment_item_detail">
<argument
android:name="item_id"

View File

@ -7,12 +7,22 @@
<string name="app_info">info@csc-online.eu</string>
<string name="app_name">ODP-AppVehOwn</string>
<string name="appointment">Appointment</string>
<string name="attachment_api_url">RestApi Url</string>
<string name="back">Back</string>
<string name="choose_from_gallery">Choose from gallery</string>
<string name="city">Zip / City</string>
<string name="close">Close</string>
<string name="content">Content</string>
<string name="customer">Customer</string>
<string name="customer_vehicles">Customer Vehicles</string>
<string name="dashboard">Dashboard</string>
<string name="deny">Deny</string>
<string name="device">Device</string>
<string name="devices">Devices</string>
<string name="device_id">Device ID</string>
<string name="device_name">Device Name</string>
<string name="deviceId">ID of your SVI device</string>
<string name="deviceName">Name of your SVI device</string>
<string name="download_lease">Download lease</string>
<string name="ecu">ECU</string>
<string name="email">Email</string>
@ -21,14 +31,26 @@
<string name="event_channel_name">Event Channel</string>
<string name="events_occurred">Event(s) occurred</string>
<string name="events_reported">Event(s) successfully reported to server</string>
<string name="find">Find</string>
<string name="first_name">First Name</string>
<string name="gallery">Gallery</string>
<string name="home">Home</string>
<string name="homepage">Homepage</string>
<string name="id">Id</string>
<string name="image">image</string>
<string name="info_channel_description">This is the Info Channel Description</string>
<string name="info_channel_name">Info Channel</string>
<string name="invalid_password">Password must be >5 characters</string>
<string name="invalid_username">Not a valid username</string>
<string name="item_detail">Item Detail</string>
<string name="language">Language</string>
<string name="last_name">Last Name</string>
<string name="lease_transferred">Lease successfully transferred to SVI.</string>
<string name="license_plate">License Plate</string>
<string name="locale">Locale</string>
<string name="login">Login</string>
<string name="login_failed">"Login failed"</string>
<string name="logout">Logout</string>
<string name="menu_dashboard">Dashboard</string>
<string name="menu_downloaded_events">Downloaded events</string>
<string name="menu_reported_events">Reported events</string>
@ -37,8 +59,11 @@
<string name="missing_X">Missing %1$s</string>
<string name="name">Name</string>
<string name="note">Service Advisor Notes</string>
<string name="notifications">Notifications</string>
<string name="no_event_selected">-no event selected-</string>
<string name="no_repair_shop_selected">-no repair shop selected-</string>
<string name="NO_TEXT">NO_TEXT</string>
<string name="open">Open</string>
<string name="order_no">Order no</string>
<string name="pair_vehicle">Pair with vehicle</string>
<string name="password">Password</string>
@ -46,11 +71,17 @@
<string name="phone">Phone</string>
<string name="powertrain">Powertrain</string>
<string name="preference_file_key">personal_app_sharedprefs</string>
<string name="prompt_deviceId">ID of your SVI device</string>
<string name="prompt_deviceName">Name of your SVI device</string>
<string name="profile">Profile</string>
<string name="propulsion_type">Propulsion Type</string>
<string name="register_customer">Register Customer</string>
<string name="register_svi">Register SVI</string>
<string name="register_svi_pair_vehicle">Register SVI - pair with vehicle</string>
<string name="register_user">Register user</string>
<string name="register_vehicle">Register vehicle</string>
<string name="registration">Registration</string>
<string name="registration_date">Registration Date</string>
<string name="reload">Reload</string>
<string name="remember">Remember</string>
<string name="repeat_password">Repeat Password</string>
<string name="report_events">Report event(s)</string>
<string name="select">Select</string>
@ -60,6 +91,10 @@
<string name="select_repair_shop">Select repair shop</string>
<string name="selected_events">Selected event(s)</string>
<string name="selected_repair_shop">Selected repair shop</string>
<string name="serialnumber">Serialnumber</string>
<string name="settings">Settings</string>
<string name="slideshow">Slideshow</string>
<string name="store">Store</string>
<string name="street">Street / House no.</string>
<string name="submit">Submit</string>
<string name="systems_to_be_tested">System(s) to be tested</string>
@ -71,27 +106,31 @@
<string name="treatment_plan_available">Treatment Plan available</string>
<string name="ugp_service_channel_description">This is the UGP Service Channel Description</string>
<string name="ugp_service_channel_name">UGP Service Channel</string>
<string name="undo">Undo</string>
<string name="unregister">Unregister</string>
<string name="use_dark_mode">Use dark mode</string>
<string name="variant">Variant</string>
<string name="vehicle">Vehicle</string>
<string name="vehicle_brand">Vehicle Brand</string>
<string name="vehicle_model">Vehicle Model</string>
<string name="vehicles">Vehicles</string>
<string name="vehicles_and_devices">Vehicles and Devices</string>
<string name="vin">Vehicle Identification Number</string>
<string name="X_Y">%1$s %2$s</string>
<string name="zip_postal">Zip/Postal</string>
<!-- Strings related to login -->
<string name="action_sign_in">Sign in or register</string>
<string name="action_sign_in_short">Sign in</string>
<string name="welcome">"Welcome !"</string>
<string name="invalid_username">Not a valid username</string>
<string name="invalid_password">Password must be >5 characters</string>
<string name="login_failed">"Login failed"</string>
<!-- Strings used for fragments for navigation -->
<string name="first_fragment_label">First Fragment</string>
<string name="second_fragment_label">Second Fragment</string>
<string name="next">Next</string>
<string name="previous">Previous</string>
<string name="navigation_drawer_open">Open navigation drawer</string>
<string name="navigation_drawer_close">Close navigation drawer</string>
<string name="action_settings">Settings</string>
<string name="title_activity_failure_event">FailureEventActivity</string>
<string name="title_activity_main">MainActivity</string>
<string name="title_activity_register_customer">RegisterCustomerActivity</string>
@ -115,88 +154,8 @@
<string name="attachment_title">Download incoming attachments</string>
<string name="attachment_summary_on">Automatically download attachments for incoming emails</string>
<string name="attachment_summary_off">Only download attachments when manually requested</string>
<string name="title_svivehicleitem_list">SVIVehicleItems</string>
<string name="title_svivehicleitem_detail">SVIVehicleItem Detail</string>
<string name="profile_header">Profile</string>
<string name="profile_locale_title">Locale</string>
<string name="lease_transferred">Lease successfully transferred to SVI.</string>
<string name="title_storedeventitem_list">StoredEventItems</string>
<string name="title_storedeventitem_detail">StoredEventItem Detail</string>
<string name="title_eventitem_list">EventItems</string>
<string name="title_eventitem_detail">EventItem Detail</string>
<string name="license_plate">License Plate</string>
<string name="register_vehicle">Register vehicle</string>
<string name="language">Language</string>
<string name="vehicle_brand">Vehicle Brand</string>
<string name="vehicle_model">Vehicle Model</string>
<string name="propulsion_type">Propulsion Type</string>
<string name="registration_date">Registration Date</string>
<string name="use_dark_mode">Use dark mode</string>
<!-- Strings related to login -->
<string name="prompt_email">Email</string>
<string name="prompt_password">Password</string>
<string name="hello_first_fragment">Hello first fragment</string>
<string name="hello_second_fragment">Hello second fragment. Arg: %1$s</string>
<string name="show_vehicles_and_devices">Show vehicles and devices</string>
<string name="vehicles">Vehicles</string>
<string name="devices">Devices</string>
<string name="pref_offline_mode">pref_offline_mode</string>
<string name="prompt_street">Street</string>
<string name="action_register_customer">Register Customer</string>
<string name="prompt_firstname">Firstname</string>
<string name="prompt_lastname">Lastname</string>
<string name="prompt_Postal">Zip/Postal</string>
<string name="store_register_vehicle">Store</string>
<string name="undo_register_vehicle">Undo</string>
<string name="title_item_list">Items</string>
<string name="title_item_detail">Item Detail</string>
<string name="menu_list_vehicles">Customer Vehicles</string>
<string name="reload_from_storage_register_vehicle">Reload</string>
<string name="txt_clear">Clear</string>
<!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</string>
<string name="unregister_vehicle">Unregister</string>
<string name="title_home">Home</string>
<string name="title_dashboard">Dashboard</string>
<string name="title_notifications">Notifications</string>
<string name="register_base_title">Registration</string>
<string name="title_register_device">Device</string>
<string name="btn_registration">Register</string>
<string name="title_register_customer">Customer</string>
<string name="menu_list_content">Content</string>
<string name="nav_header_title">Android Studio</string>
<string name="nav_header_subtitle">android.studio@android.com</string>
<string name="nav_header_desc">Navigation header</string>
<string name="menu_home">Home</string>
<string name="menu_gallery">Gallery</string>
<string name="menu_slideshow">Slideshow</string>
<string name="nav_open">Open</string>
<string name="nav_close">Close</string>
<string name="menu_login">Login</string>
<string name="text_remember">Remember</string>
<string name="title_register_vehicle">Vehicle</string>
<string name="title_brand">Brand</string>
<string name="hint_choose_brand">Choose Or Write Brand</string>
<string name="title_model">Model</string>
<string name="hint_choose_model">Model</string>
<string name="title_propulsion_type">Propulsion Type</string>
<string name="hint_choose_propulsion_type">Propulsion Type</string>
<string name="btn_no_text">NO_TEXT</string>
<string name="attachment_api_url">RestApi Url</string>
<string name="btn_login">Login</string>
<string name="btn_logout">Logout</string>
<string name="btn_find">Find</string>
<string name="btn_store">Store</string>
<string name="X_Y">%1$s %2$s</string>
<!--string-array name="languages">
<item>english</item>
<item>french</item>
<item>spanish</item>
<item>german</item>
</string-array-->
</resources>

View File

@ -4,7 +4,7 @@
<Preference
app:key="profile_header"
app:title="@string/profile_header"
app:title="@string/profile"
app:icon="@drawable/ic_baseline_settings_24"
app:fragment="eu.csc.vehown.ui.settings.SettingsActivity$MessagesFragment"/>

View File

@ -3,7 +3,7 @@
<EditTextPreference
app:key="signature"
app:title="@string/profile_locale_title"
app:title="@string/locale"
app:useSimpleSummaryProvider="true"/>
<ListPreference