diff --git a/app/build.gradle b/app/build.gradle index ef32e1d..cb36861 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -3,7 +3,7 @@ plugins { } android { - compileSdkVersion 30 + compileSdkVersion 31 buildToolsVersion "30.0.3" packagingOptions { exclude 'META-INF/LICENSE.txt' @@ -12,7 +12,7 @@ android { defaultConfig { applicationId "eu.csc.vehown" minSdkVersion 26 - targetSdkVersion 30 + targetSdkVersion 31 versionCode 1 versionName "1.0" multiDexEnabled true @@ -23,8 +23,10 @@ android { annotationProcessorOptions { arguments += [ "room.schemaLocation":"$projectDir/schemas".toString(), - "room.incremental":"true", - "room.expandProjection":"true"] +//The following options were not recognized by any processor +// "room.incremental":"true", +// "room.expandProjection":"true" + ] } } } @@ -88,19 +90,19 @@ dependencies { implementation 'androidx.navigation:navigation-ui:2.3.5' implementation 'androidx.legacy:legacy-support-v4:1.0.0' implementation 'androidx.recyclerview:recyclerview:1.2.1' - implementation 'androidx.preference:preference:1.1.1' + implementation 'androidx.preference:preference:1.2.0' - implementation 'androidx.preference:preference:1.1.1' + //implementation 'eu.csc.odpconfigurationserver:dto:1.0-SNAPSHOT' testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test.ext:junit:1.1.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.3' androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' - //Lombok - implementation 'org.projectlombok:lombok:1.18.20' - annotationProcessor 'org.projectlombok:lombok:1.18.20' - androidTestImplementation 'org.projectlombok:lombok:1.18.20' - testAnnotationProcessor 'org.projectlombok:lombok:1.18.20' + //Lombok + implementation "org.projectlombok:lombok:$lombok_Version" + annotationProcessor "org.projectlombok:lombok:$lombok_Version" + androidTestImplementation "org.projectlombok:lombok:$lombok_Version" + testAnnotationProcessor "org.projectlombok:lombok:$lombok_Version" //room implementation 'android.arch.persistence.room:runtime:1.1.1' @@ -122,11 +124,8 @@ dependencies { // compile files('libs/org.eclipse.paho.client.mqttv3-1.1.1.jar') implementation 'com.android.support:multidex:1.0.3' - implementation 'eu.csc.core:coregtdm:1.0-SNAPSHOT' - implementation files('libs/log4j-1.2.17.jar') - //implementation files('libs/asnrt-2020.07.jar') - - + implementation "eu.csc.core:coregtdm:$coregtdm_version" //was 1.0-SNAPSHOT + implementation files('../libs/log4j-1.2.17.jar') implementation project(":services:core") implementation project(":services:localstorage") diff --git a/app/libs/amqp-client-5.12.0.jar b/app/libs/amqp-client-5.12.0.jar deleted file mode 100644 index 9874b5f..0000000 Binary files a/app/libs/amqp-client-5.12.0.jar and /dev/null differ diff --git a/app/libs/log4j-1.2.17.jar b/app/libs/log4j-1.2.17.jar deleted file mode 100644 index 068867e..0000000 Binary files a/app/libs/log4j-1.2.17.jar and /dev/null differ diff --git a/app/libs/slf4j-android-1.7.10.jar b/app/libs/slf4j-android-1.7.10.jar deleted file mode 100644 index 90067a3..0000000 Binary files a/app/libs/slf4j-android-1.7.10.jar and /dev/null differ diff --git a/app/src/androidTest/java/eu/csc/vehown/ExampleInstrumentedTest.java b/app/src/androidTest/java/eu/csc/vehown/ExampleInstrumentedTest.java index 8dcc42b..917c25f 100644 --- a/app/src/androidTest/java/eu/csc/vehown/ExampleInstrumentedTest.java +++ b/app/src/androidTest/java/eu/csc/vehown/ExampleInstrumentedTest.java @@ -1,14 +1,11 @@ package eu.csc.vehown; -import android.content.Context; - - -import androidx.test.InstrumentationRegistry; -import androidx.test.runner.AndroidJUnit4; +import androidx.test.core.app.ApplicationProvider; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; /** * Instrumented test, which will execute on an Android device. @@ -19,8 +16,6 @@ import static org.junit.Assert.*; public class ExampleInstrumentedTest { @Test public void useAppContext() { - // Context of the app under test. - Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); - assertEquals("eu.csc.vehown", appContext.getPackageName()); + assertEquals("eu.csc.vehown", ApplicationProvider.getApplicationContext().getPackageName()); } } \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index b546fd5..1b9a69d 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -26,59 +26,9 @@ uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android android:theme="@style/Theme.VehicleOwner" android:usesCleartextTraffic="true" tools:targetApi="n"> - + - - - - - - - - - - - - - - - - - - - - - - - - - + android:name=".ui.settings.SettingsActivity" + android:label="@string/title_activity_settings"/> + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/ic_launcher-playstore.png b/app/src/main/ic_launcher-playstore.png index fbd3803..8310f1a 100644 Binary files a/app/src/main/ic_launcher-playstore.png and b/app/src/main/ic_launcher-playstore.png differ diff --git a/app/src/main/ic_phone_call_image-playstore.png b/app/src/main/ic_phone_call_image-playstore.png deleted file mode 100644 index 4b7107e..0000000 Binary files a/app/src/main/ic_phone_call_image-playstore.png and /dev/null differ diff --git a/app/src/main/ic_settings-playstore.png b/app/src/main/ic_settings-playstore.png deleted file mode 100644 index f65f4a0..0000000 Binary files a/app/src/main/ic_settings-playstore.png and /dev/null differ diff --git a/app/src/main/java/eu/csc/vehown/services/persistence/ExampleDataClient.java b/app/src/main/java/eu/csc/vehown/services/persistence/ExampleDataClient.java index 5d3c34b..7645a91 100644 --- a/app/src/main/java/eu/csc/vehown/services/persistence/ExampleDataClient.java +++ b/app/src/main/java/eu/csc/vehown/services/persistence/ExampleDataClient.java @@ -1,8 +1,7 @@ package eu.csc.vehown.services.persistence; -import asn.GTLease.Lease; +import asn.GTMaintenance.Lease; import eu.csc.vehown.data.model.*; -import eu.csc.vehown.persist.localstorage.ExampleVehicle; import java.text.SimpleDateFormat; import java.util.*; diff --git a/app/src/main/java/eu/csc/vehown/services/rest/LeaseApiClient.java b/app/src/main/java/eu/csc/vehown/services/rest/LeaseApiClient.java new file mode 100644 index 0000000..25a28a3 --- /dev/null +++ b/app/src/main/java/eu/csc/vehown/services/rest/LeaseApiClient.java @@ -0,0 +1,13 @@ +package eu.csc.vehown.services.rest; + +import eu.csc.vehown.services.rest.dto.CustomLeaseGenDto; +import okhttp3.ResponseBody; +import retrofit2.Call; +import retrofit2.http.Body; +import retrofit2.http.POST; + +public interface LeaseApiClient { + + @POST("api/leasgen/custom") + Call customLease(@Body CustomLeaseGenDto dto); +} diff --git a/app/src/main/java/eu/csc/vehown/services/rest/RetrofitApiClientFactory.java b/app/src/main/java/eu/csc/vehown/services/rest/RetrofitApiClientFactory.java index 0952eba..5af77f6 100644 --- a/app/src/main/java/eu/csc/vehown/services/rest/RetrofitApiClientFactory.java +++ b/app/src/main/java/eu/csc/vehown/services/rest/RetrofitApiClientFactory.java @@ -12,6 +12,7 @@ import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory; import retrofit2.converter.gson.GsonConverterFactory; import java.io.IOException; +import java.net.URL; public class RetrofitApiClientFactory { @@ -24,6 +25,19 @@ public class RetrofitApiClientFactory { + public static LeaseApiClient getLeaseClient(String url) { + + Retrofit retrofit = new Retrofit.Builder() + .baseUrl(url) + .addConverterFactory(GsonConverterFactory.create(JSONHelper.getGson())) + + .addCallAdapterFactory(RxJava2CallAdapterFactory.create()) + .build(); + + + return retrofit.create(LeaseApiClient.class); + } + public static RetrofitApiClient getClient(Context context) { diff --git a/app/src/main/java/eu/csc/vehown/services/rest/dto/CustomLeaseGenDto.java b/app/src/main/java/eu/csc/vehown/services/rest/dto/CustomLeaseGenDto.java new file mode 100644 index 0000000..fb5cff0 --- /dev/null +++ b/app/src/main/java/eu/csc/vehown/services/rest/dto/CustomLeaseGenDto.java @@ -0,0 +1,25 @@ +package eu.csc.vehown.services.rest.dto; + +import lombok.Data; +import lombok.ToString; + +import java.util.List; + +@Data +@ToString +public class CustomLeaseGenDto { + + private String token; + + private String issuer; + + private String user; + + private Long startTime; + + private Long expirationTime; + + private List systems; + + +} diff --git a/app/src/main/java/eu/csc/vehown/ugp/UGPService.java b/app/src/main/java/eu/csc/vehown/ugp/UGPService.java index 3a83ca0..e132898 100644 --- a/app/src/main/java/eu/csc/vehown/ugp/UGPService.java +++ b/app/src/main/java/eu/csc/vehown/ugp/UGPService.java @@ -11,10 +11,10 @@ import asn.GTDF.DtcInfo; import asn.GTDF.IdentifierType; import asn.GTP.ActionType; import asn.GTP.SessionType; -import eu.csc.data.IDataConsts; +import eu.csc.asn.GTException; import eu.csc.gtdm.ConfigException; import eu.csc.gtdm.ConfigProvider; -import eu.csc.gtdm.GTException; +import eu.csc.gtdm.ICoreConsts; import eu.csc.gtp.IGTPCnfNegative; import eu.csc.gtp.IGTPCnfPositive; import eu.csc.gtp.IGTPCnfPublishDtc; @@ -31,7 +31,7 @@ import java.util.Locale; import static eu.csc.vehown.ui.modal.Helper.errorDialog; -public class UGPService extends Service implements IDataConsts, Runnable { +public class UGPService extends Service implements ICoreConsts, Runnable { public static final String HOST = "host"; private static final CSCLog LOG = CSCLogFactory.getLog(UGPService.class); @@ -103,9 +103,9 @@ public class UGPService extends Service implements IDataConsts, Runnable { @Override public void run() { System.setProperty("gtdm.odp", this.getExternalFilesDir(null).getAbsolutePath()); - cp = ConfigProvider.get(); + cp = ConfigProvider.getOrCreate(); try { - cp.readGeneralConfigs(false); + cp.readGTBasicGeneralConfigs(false); File dirCerts = new File(cp.getDirCurrent(), "certs"); ugpClient = new UGPClient(dirCerts, certName, host, PORT_UGP, 0); ugpClient.startIt(null); @@ -155,11 +155,11 @@ public class UGPService extends Service implements IDataConsts, Runnable { }; private Event createEvent(DtcInfo d) { - String id = cp.getDtcBaseName(locale, d.getDtcBaseId(), NameType.shortname); + String id = cp.getDtcBaseName(locale, d.getDtcBaseId(), NameType.SHORTNAME); Event e = new Event(id); e.setId(id); - e.setDescription(cp.getDtcBaseName(Locale.ENGLISH, d.getDtcBaseId(), NameType.longname)); - e.setEcuId(cp.getName(locale, IdentifierType.ecu, d.getEcuId(), NameType.shortname)); + e.setDescription(cp.getDtcBaseName(Locale.ENGLISH, d.getDtcBaseId(), NameType.LONGNAME)); + e.setEcuId(cp.getName(locale, IdentifierType.ecu, d.getEcuId(), NameType.SHORTNAME)); e.setVehicle(vehicle); e.setTimestamp(d.getTimestamp()); if (d.getStatus().getConfirmedDTC()) { diff --git a/app/src/main/java/eu/csc/vehown/ui/main/MainActivity.java b/app/src/main/java/eu/csc/vehown/ui/main/MainActivity.java index 1b8cc22..a8b9174 100644 --- a/app/src/main/java/eu/csc/vehown/ui/main/MainActivity.java +++ b/app/src/main/java/eu/csc/vehown/ui/main/MainActivity.java @@ -25,8 +25,10 @@ import eu.csc.vehown.services.notifications.NotificationService; import eu.csc.vehown.ugp.WifiConnectedReceiver; +import eu.csc.vehown.ui.svi.DashboardActivity; import eu.csc.vehown.ui.svi.RegisterSVIActivity; import eu.csc.vehown.ui.settings.SettingsActivity; +import eu.csc.vehown.ui.svi.SVIVehicleItemDetailActivity; public class MainActivity extends AppCompatActivity { @@ -98,6 +100,9 @@ for(int i = 0; i<10; ++i){ Intent intent = null; switch (item.getItemId()) { + case R.id.nav_dashboard: + intent = new Intent(this, DashboardActivity.class); + break; case R.id.nav_register: intent = new Intent(this, RegisterSVIActivity.class); break; @@ -108,7 +113,7 @@ for(int i = 0; i<10; ++i){ break; case R.id.nav_svivehicles: - //intent = new Intent(this, SVIVehicleItemListActivity.class); + //intent = new Intent(this, SVIVehicleItemDetailActivity.class); break; default: break; diff --git a/app/src/main/java/eu/csc/vehown/ui/registerCustomer/FirstFragment.java b/app/src/main/java/eu/csc/vehown/ui/registerCustomer/FirstFragment.java deleted file mode 100644 index c56d50c..0000000 --- a/app/src/main/java/eu/csc/vehown/ui/registerCustomer/FirstFragment.java +++ /dev/null @@ -1,33 +0,0 @@ -package eu.csc.vehown.ui.registerCustomer; - -import android.os.Bundle; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; - -import androidx.annotation.NonNull; -import androidx.fragment.app.Fragment; -import eu.csc.vehown.R; - -public class FirstFragment extends Fragment { - - @Override - public View onCreateView( - LayoutInflater inflater, ViewGroup container, - Bundle savedInstanceState - ) { - // Inflate the layout for this fragment - return inflater.inflate(R.layout.fragment_first, container, false); - } - - public void onViewCreated(@NonNull View view, Bundle savedInstanceState) { - super.onViewCreated(view, savedInstanceState); - - view.findViewById(R.id.button_first).setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - // NavHostFragment.findNavController(FirstFragment.this) .navigate(R.id.action_FirstFragment_to_SecondFragment); - } - }); - } -} \ No newline at end of file diff --git a/app/src/main/java/eu/csc/vehown/ui/registerCustomer/SecondFragment.java b/app/src/main/java/eu/csc/vehown/ui/registerCustomer/SecondFragment.java deleted file mode 100644 index aa43f96..0000000 --- a/app/src/main/java/eu/csc/vehown/ui/registerCustomer/SecondFragment.java +++ /dev/null @@ -1,33 +0,0 @@ -package eu.csc.vehown.ui.registerCustomer; - -import android.os.Bundle; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; - -import androidx.annotation.NonNull; -import androidx.fragment.app.Fragment; -import eu.csc.vehown.R; - -public class SecondFragment extends Fragment { - - @Override - public View onCreateView( - LayoutInflater inflater, ViewGroup container, - Bundle savedInstanceState - ) { - // Inflate the layout for this fragment - return inflater.inflate(R.layout.fragment_second, container, false); - } - - public void onViewCreated(@NonNull View view, Bundle savedInstanceState) { - super.onViewCreated(view, savedInstanceState); - - view.findViewById(R.id.button_second).setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - // NavHostFragment.findNavController(SecondFragment.this) .navigate(R.id.action_SecondFragment_to_FirstFragment); - } - }); - } -} \ No newline at end of file diff --git a/app/src/main/java/eu/csc/vehown/ui/svi/DashboardActivity.java b/app/src/main/java/eu/csc/vehown/ui/svi/DashboardActivity.java new file mode 100644 index 0000000..0521fd5 --- /dev/null +++ b/app/src/main/java/eu/csc/vehown/ui/svi/DashboardActivity.java @@ -0,0 +1,119 @@ +package eu.csc.vehown.ui.svi; + +import android.os.Bundle; +import android.util.Log; +import androidx.appcompat.app.AppCompatActivity; +import asn.GTMaintenance.Lease; +import eu.csc.asn.Asn1FileBase; +import eu.csc.vehown.databinding.ActivityDashboardBinding; +import eu.csc.vehown.services.rest.LeaseApiClient; +import eu.csc.vehown.services.rest.RetrofitApiClientFactory; +import eu.csc.vehown.services.rest.dto.CustomLeaseGenDto; +import okhttp3.ResponseBody; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +import java.io.*; +import java.util.Arrays; + +public class DashboardActivity extends AppCompatActivity { + + private static final String TAG = "DashboardActivity"; + ActivityDashboardBinding binding; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + binding = ActivityDashboardBinding.inflate(getLayoutInflater()); + setContentView(binding.getRoot()); + + binding.btnRequestLease.setOnClickListener(v -> { + CustomLeaseGenDto customLease = new CustomLeaseGenDto(); + customLease.setIssuer("CSC"); + customLease.setUser("CSC"); + customLease.setStartTime(0L); + customLease.setExpirationTime(4398046511103L); + customLease.setSystems(Arrays.asList("obd-ii", "imu")); + LeaseApiClient client = RetrofitApiClientFactory.getLeaseClient("http://192.168.178.69:8042/"); + Call call = client.customLease(customLease); + call.enqueue(new Callback() { + @Override + public void onResponse(Call call, Response response) { + if (response.isSuccessful()) { + Log.d(TAG, "server contacted and has file"); + + File writtenToDisk = writeResponseBodyToDisk(response.body()); + try { + Lease lease = Asn1FileBase.getInstance().open(Lease.class, writtenToDisk); + Log.i(TAG, lease.toString()); + } catch (IOException e) { + Log.e(TAG, e.getMessage()); + } + + + Log.d(TAG, "file download was a success? " + writtenToDisk); + } else { + Log.d(TAG, "server contact failed"); + } + } + + @Override + public void onFailure(Call call, Throwable t) { + Log.e(TAG, "error"); + } + }); + }); + } + + private File writeResponseBodyToDisk(ResponseBody body) { + try { + // todo change the file location/name according to your needs + File asnFile = new File(getExternalFilesDir(null) + File.separator + "lease.asn"); + + InputStream inputStream = null; + OutputStream outputStream = null; + + try { + byte[] fileReader = new byte[4096]; + + long fileSize = body.contentLength(); + long fileSizeDownloaded = 0; + + inputStream = body.byteStream(); + outputStream = new FileOutputStream(asnFile); + + while (true) { + int read = inputStream.read(fileReader); + + if (read == -1) { + break; + } + + outputStream.write(fileReader, 0, read); + + fileSizeDownloaded += read; + + Log.d(TAG, "file download: " + fileSizeDownloaded + " of " + fileSize); + } + + outputStream.flush(); + + return asnFile; + } catch (IOException e) { + return null; + } finally { + if (inputStream != null) { + inputStream.close(); + } + + if (outputStream != null) { + outputStream.close(); + } + } + } catch (IOException e) { + return null; + } + } +} \ No newline at end of file diff --git a/app/src/main/java/eu/csc/vehown/ui/svi/SVIVehicleItemDetailActivity.java b/app/src/main/java/eu/csc/vehown/ui/svi/SVIVehicleItemDetailActivity.java index 6ecc71d..82e27d8 100644 --- a/app/src/main/java/eu/csc/vehown/ui/svi/SVIVehicleItemDetailActivity.java +++ b/app/src/main/java/eu/csc/vehown/ui/svi/SVIVehicleItemDetailActivity.java @@ -15,7 +15,7 @@ import eu.csc.vehown.R; * An activity representing a single SVIVehicleItem detail screen. This * activity is only used on narrow width devices. On tablet-size devices, * item details are presented side-by-side with a list of items - * in a {@link SVIVehicleItemListActivity}. + * in a . */ public class SVIVehicleItemDetailActivity extends AppCompatActivity { @@ -26,15 +26,6 @@ public class SVIVehicleItemDetailActivity extends AppCompatActivity { Toolbar toolbar = (Toolbar) findViewById(R.id.detail_toolbar); setSupportActionBar(toolbar); - FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); - fab.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - Snackbar.make(view, "Replace with your own detail action", Snackbar.LENGTH_LONG) - .setAction("Action", null).show(); - } - }); - // Show the Up button in the action bar. ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { diff --git a/app/src/main/java/eu/csc/vehown/ui/test/First4Fragment.java b/app/src/main/java/eu/csc/vehown/ui/test/First4Fragment.java deleted file mode 100644 index 5d7c4d9..0000000 --- a/app/src/main/java/eu/csc/vehown/ui/test/First4Fragment.java +++ /dev/null @@ -1,35 +0,0 @@ -package eu.csc.vehown.ui.test; - -import android.os.Bundle; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; - -import androidx.annotation.NonNull; -import androidx.fragment.app.Fragment; -import androidx.navigation.fragment.NavHostFragment; -import eu.csc.vehown.R; - -public class First4Fragment extends Fragment { - - @Override - public View onCreateView( - LayoutInflater inflater, ViewGroup container, - Bundle savedInstanceState - ) { - // Inflate the layout for this fragment - return inflater.inflate(R.layout.fragment_first4, container, false); - } - - public void onViewCreated(@NonNull View view, Bundle savedInstanceState) { - super.onViewCreated(view, savedInstanceState); - - view.findViewById(R.id.button_first).setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - NavHostFragment.findNavController(First4Fragment.this) - .navigate(R.id.action_First4Fragment_to_Second4Fragment); - } - }); - } -} \ No newline at end of file diff --git a/app/src/main/java/eu/csc/vehown/ui/test/Second4Fragment.java b/app/src/main/java/eu/csc/vehown/ui/test/Second4Fragment.java deleted file mode 100644 index aa4d695..0000000 --- a/app/src/main/java/eu/csc/vehown/ui/test/Second4Fragment.java +++ /dev/null @@ -1,35 +0,0 @@ -package eu.csc.vehown.ui.test; - -import android.os.Bundle; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; - -import androidx.annotation.NonNull; -import androidx.fragment.app.Fragment; -import androidx.navigation.fragment.NavHostFragment; -import eu.csc.vehown.R; - -public class Second4Fragment extends Fragment { - - @Override - public View onCreateView( - LayoutInflater inflater, ViewGroup container, - Bundle savedInstanceState - ) { - // Inflate the layout for this fragment - return inflater.inflate(R.layout.fragment_second4, container, false); - } - - public void onViewCreated(@NonNull View view, Bundle savedInstanceState) { - super.onViewCreated(view, savedInstanceState); - - view.findViewById(R.id.button_second).setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - NavHostFragment.findNavController(Second4Fragment.this) - .navigate(R.id.action_Second4Fragment_to_First4Fragment); - } - }); - } -} \ No newline at end of file diff --git a/app/src/main/java/eu/csc/vehown/ui/test/Test3Activity.java b/app/src/main/java/eu/csc/vehown/ui/test/Test3Activity.java deleted file mode 100644 index 86425e4..0000000 --- a/app/src/main/java/eu/csc/vehown/ui/test/Test3Activity.java +++ /dev/null @@ -1,30 +0,0 @@ -package eu.csc.vehown.ui.test; - -import android.os.Bundle; -import com.google.android.material.floatingactionbutton.FloatingActionButton; -import com.google.android.material.snackbar.Snackbar; -import androidx.appcompat.app.AppCompatActivity; -import androidx.appcompat.widget.Toolbar; -import android.view.View; - -import eu.csc.vehown.R; - -public class Test3Activity extends AppCompatActivity { - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_test3); - Toolbar toolbar = findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - - FloatingActionButton fab = findViewById(R.id.fab); - fab.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG) - .setAction("Action", null).show(); - } - }); - } -} \ No newline at end of file diff --git a/app/src/main/java/eu/csc/vehown/ui/test/TestActivity.java b/app/src/main/java/eu/csc/vehown/ui/test/TestActivity.java deleted file mode 100644 index 5a660fb..0000000 --- a/app/src/main/java/eu/csc/vehown/ui/test/TestActivity.java +++ /dev/null @@ -1,14 +0,0 @@ -package eu.csc.vehown.ui.test; - -import androidx.appcompat.app.AppCompatActivity; -import android.os.Bundle; -import eu.csc.vehown.R; - -public class TestActivity extends AppCompatActivity { - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_test); - } -} \ No newline at end of file diff --git a/app/src/main/java/eu/csc/vehown/ui/tp/AcceptTreatmentPlanFragment.java b/app/src/main/java/eu/csc/vehown/ui/tp/AcceptTreatmentPlanFragment.java index 2ee761f..7c1c25d 100644 --- a/app/src/main/java/eu/csc/vehown/ui/tp/AcceptTreatmentPlanFragment.java +++ b/app/src/main/java/eu/csc/vehown/ui/tp/AcceptTreatmentPlanFragment.java @@ -13,8 +13,8 @@ import androidx.annotation.NonNull; import androidx.appcompat.widget.Toolbar; import androidx.fragment.app.Fragment; import androidx.lifecycle.ViewModelProvider; -import asn.GTLease.Lease; -import eu.csc.gtdm.GTException; +import asn.GTMaintenance.Lease; +import eu.csc.asn.GTException; import eu.csc.gtp.IGTPCnfNegative; import eu.csc.log.CSCLog; import eu.csc.log.CSCLogFactory; diff --git a/app/src/main/java/eu/csc/vehown/ui/tp/TreatmentPlanViewModel.java b/app/src/main/java/eu/csc/vehown/ui/tp/TreatmentPlanViewModel.java index 8304f3d..3a7f81a 100644 --- a/app/src/main/java/eu/csc/vehown/ui/tp/TreatmentPlanViewModel.java +++ b/app/src/main/java/eu/csc/vehown/ui/tp/TreatmentPlanViewModel.java @@ -2,7 +2,6 @@ package eu.csc.vehown.ui.tp; import androidx.lifecycle.MutableLiveData; import androidx.lifecycle.ViewModel; -import asn.GTLease.Lease; import eu.csc.vehown.data.model.TreatmentLease; import eu.csc.vehown.data.model.TreatmentPlan; import eu.csc.vehown.services.rest.data.GrantedLeaseResponse; @@ -10,7 +9,6 @@ import lombok.Getter; import java.text.NumberFormat; import java.util.Currency; -import java.util.Date; @Getter public class TreatmentPlanViewModel extends ViewModel { @@ -18,8 +16,6 @@ public class TreatmentPlanViewModel extends ViewModel { private TreatmentPlan treatmentPlan; private MutableLiveData lease = new MutableLiveData<>(); private MutableLiveData isBusy = new MutableLiveData<>(); - - //private MutableLiveData selectedAppointment = new MutableLiveData<>(); // @@ -47,11 +43,7 @@ public class TreatmentPlanViewModel extends ViewModel { NumberFormat format = NumberFormat.getCurrencyInstance(); format.setMaximumFractionDigits(0); format.setCurrency(Currency.getInstance("EUR")); - format.format(1000000); - - return format.format(treatmentPlan.getEstimatedCost()); - } } diff --git a/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml deleted file mode 100644 index 4c78f7f..0000000 --- a/app/src/main/res/drawable-v24/ic_launcher_foreground.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml deleted file mode 100644 index 956b344..0000000 --- a/app/src/main/res/drawable/ic_launcher_background.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/drawable/ic_launcher_foreground.xml b/app/src/main/res/drawable/ic_launcher_foreground.xml index 4c78f7f..426957f 100644 --- a/app/src/main/res/drawable/ic_launcher_foreground.xml +++ b/app/src/main/res/drawable/ic_launcher_foreground.xml @@ -4,25 +4,25 @@ android:height="108dp" android:viewportWidth="108" android:viewportHeight="108" - android:tint="#FFFFFF"> + android:tint="#FFFFFF"> - - + - - - - + - - diff --git a/app/src/main/res/drawable/ic_phone_call_image_background.xml b/app/src/main/res/drawable/ic_phone_call_image_background.xml deleted file mode 100644 index ca3826a..0000000 --- a/app/src/main/res/drawable/ic_phone_call_image_background.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/drawable/ic_phone_call_image_foreground.xml b/app/src/main/res/drawable/ic_phone_call_image_foreground.xml deleted file mode 100644 index fd17352..0000000 --- a/app/src/main/res/drawable/ic_phone_call_image_foreground.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - diff --git a/app/src/main/res/drawable/ic_settings_foreground.xml b/app/src/main/res/drawable/ic_settings.xml similarity index 100% rename from app/src/main/res/drawable/ic_settings_foreground.xml rename to app/src/main/res/drawable/ic_settings.xml diff --git a/app/src/main/res/drawable/ic_settings_background.xml b/app/src/main/res/drawable/ic_settings_background.xml deleted file mode 100644 index ca3826a..0000000 --- a/app/src/main/res/drawable/ic_settings_background.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/layout/activity_dashboard.xml b/app/src/main/res/layout/activity_dashboard.xml new file mode 100644 index 0000000..1673920 --- /dev/null +++ b/app/src/main/res/layout/activity_dashboard.xml @@ -0,0 +1,41 @@ + + + +