added working api Client

This commit is contained in:
yb 2021-05-11 12:52:42 +02:00
parent c2f4dcc0ba
commit 979824e2cb
96 changed files with 478 additions and 2189 deletions

View File

@ -1,6 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="1.7" />
<bytecodeTargetLevel target="1.7">
<module name="PersonalApp.module.EventReportModule" target="11" />
</bytecodeTargetLevel>
</component>
</project>

View File

@ -13,8 +13,6 @@
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
<option value="$PROJECT_DIR$/module" />
<option value="$PROJECT_DIR$/module/EventReportModule" />
<option value="$PROJECT_DIR$/services" />
<option value="$PROJECT_DIR$/services/appserverclient" />
<option value="$PROJECT_DIR$/services/core" />

View File

@ -5,14 +5,17 @@ plugins {
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
defaultConfig {
applicationId "eu.csc.personalapp"
minSdkVersion 19
targetSdkVersion 30
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
@ -46,6 +49,7 @@ dependencies {
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
//Lombok
implementation 'org.projectlombok:lombok:1.18.20'
annotationProcessor 'org.projectlombok:lombok:1.18.20'
@ -54,7 +58,7 @@ dependencies {
implementation 'android.arch.persistence.room:runtime:1.1.1'
annotationProcessor 'android.arch.persistence.room:compiler:1.1.1'
compile fileTree(dir: 'libs', include: '*.jar')
// compile fileTree(dir: 'libs', include: '*.jar')
//implementation project(":module:EventReportModule")
//Retrofit
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
@ -62,5 +66,12 @@ dependencies {
implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
implementation 'io.reactivex.rxjava2:rxjava:2.1.13'
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'
//MQTT
implementation 'com.rabbitmq:amqp-client:5.12.0'
//compile files('libs/org.eclipse.paho.android.service-1.1.1.jar')
// compile files('libs/org.eclipse.paho.client.mqttv3-1.1.1.jar')
implementation 'com.android.support:multidex:1.0.3'
}

Binary file not shown.

Binary file not shown.

View File

@ -5,12 +5,24 @@
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:networkSecurityConfig="@xml/network_security_config"
android:usesCleartextTraffic="true"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.PersonalApp">
<service
android:name=".services.UploadFileServiceIntent"
android:exported="false">
</service>
<service
android:name=".services.rest.UploadFileService"
android:enabled="true"
android:exported="true">
</service>
<activity
android:name=".ui.svi.RegisterSVIActivity"
android:label="@string/title_activity_register_s_v_i"

View File

@ -1,14 +1,22 @@
package eu.csc.personalapp.services;
import android.content.Context;
import android.util.Log;
import eu.csc.personalapp.data.model.RepairShop;
import eu.csc.personalapp.services.storage.LocalStorageClient;
import eu.csc.personalapp.services.storage.StorageFactory;
import okhttp3.ResponseBody;
import java.io.*;
import java.util.ArrayList;
import java.util.List;
public class ServiceManager {
public static final RepairShop exampleRepairShopA = new RepairShop();
private static final String TAG = ServiceManager.class.getSimpleName();
private LocalStorageClient localStorageClient;
public static final RepairShop exampleRepairShopA = new RepairShop("REPAIR");
public static final RepairShop exampleRepairShopB = new RepairShop();
@ -32,4 +40,65 @@ public class ServiceManager {
return result;
}
public File writeResponseBodyToDisk(Context context, ResponseBody body){
//ToDo generateFile with randomName
File outputFile = StorageFactory.getRandomFileName(context);
Log.d(TAG, "filename " + outputFile.getName());
writeResponseBodyToDisk(body.contentLength(),body.byteStream(), outputFile);
return outputFile;
}
public boolean writeResponseBodyToDisk(long filesize, InputStream inputStream, File outputFile) {
try {
// todo change the file location/name according to your needs
OutputStream outputStream = null;
try {
byte[] fileReader = new byte[4096];
long fileSize = filesize;
long fileSizeDownloaded = 0;
outputStream = new FileOutputStream(outputFile);
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 true;
} catch (IOException e) {
return false;
} finally {
if (inputStream != null) {
inputStream.close();
}
if (outputStream != null) {
outputStream.close();
}
}
} catch (IOException e) {
return false;
}
}
}

View File

@ -1,4 +1,4 @@
package eu.csc.ssv.eventreportmodule.ui;
package eu.csc.personalapp.services;
import android.app.IntentService;
import android.content.Intent;
@ -12,19 +12,19 @@ import android.content.Context;
* TODO: Customize class - update intent actions, extra parameters and static
* helper methods.
*/
public class MyIntentService extends IntentService {
public class UploadFileServiceIntent extends IntentService {
// TODO: Rename actions, choose action names that describe tasks that this
// IntentService can perform, e.g. ACTION_FETCH_NEW_ITEMS
private static final String ACTION_FOO = "eu.csc.ssv.eventreportmodule.ui.action.FOO";
private static final String ACTION_BAZ = "eu.csc.ssv.eventreportmodule.ui.action.BAZ";
private static final String ACTION_FOO = "eu.csc.personalapp.services.rest.action.FOO";
private static final String ACTION_BAZ = "eu.csc.personalapp.services.rest.action.BAZ";
// TODO: Rename parameters
private static final String EXTRA_PARAM1 = "eu.csc.ssv.eventreportmodule.ui.extra.PARAM1";
private static final String EXTRA_PARAM2 = "eu.csc.ssv.eventreportmodule.ui.extra.PARAM2";
private static final String EXTRA_PARAM1 = "eu.csc.personalapp.services.rest.extra.PARAM1";
private static final String EXTRA_PARAM2 = "eu.csc.personalapp.services.rest.extra.PARAM2";
public MyIntentService() {
super("MyIntentService");
public UploadFileServiceIntent() {
super("UploadFileServiceIntent");
}
/**
@ -34,8 +34,8 @@ public class MyIntentService extends IntentService {
* @see IntentService
*/
// TODO: Customize helper method
public static void startActionFoo(Context context, String param1, String param2) {
Intent intent = new Intent(context, MyIntentService.class);
public static void startUploadingRequestHelp(Context context, String param1, String param2) {
Intent intent = new Intent(context, UploadFileServiceIntent.class);
intent.setAction(ACTION_FOO);
intent.putExtra(EXTRA_PARAM1, param1);
intent.putExtra(EXTRA_PARAM2, param2);
@ -50,7 +50,7 @@ public class MyIntentService extends IntentService {
*/
// TODO: Customize helper method
public static void startActionBaz(Context context, String param1, String param2) {
Intent intent = new Intent(context, MyIntentService.class);
Intent intent = new Intent(context, UploadFileServiceIntent.class);
intent.setAction(ACTION_BAZ);
intent.putExtra(EXTRA_PARAM1, param1);
intent.putExtra(EXTRA_PARAM2, param2);

View File

@ -0,0 +1,29 @@
package eu.csc.personalapp.services.mqtt;
import android.util.Log;
import java.net.URISyntaxException;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.util.concurrent.BlockingDeque;
import java.util.concurrent.LinkedBlockingDeque;
public abstract class Constants {
public static final String uri = "10.10.101.3";
public static final String CLIENT_ID = "guest";
//private static final String uri = "tcp://10.10.101.3:15670";
//private static final String uri = "10.10.101.3";
private static final int port = 5672;
public static final String MQTT_BROKER_URL = "tcp://10.10.101.3:5672";
public static final String PUBLISH_TOPIC = "amq/topic";
}

View File

@ -0,0 +1,51 @@
package eu.csc.personalapp.services.mqtt;
import android.content.Context;
import android.util.Log;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory;
import com.rabbitmq.client.DeliverCallback;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.concurrent.TimeoutException;
public class MqttClient {
private final static String QUEUE_NAME = "hello";
private final static String HOST = "10.10.101.3";
public void subscribeRepairShopNotifications(){
}
public void sendMessage(String message){
ConnectionFactory factory = new ConnectionFactory();
factory.setHost(HOST);
Connection connection = null;
try {
connection = factory.newConnection();
Channel channel = connection.createChannel();
channel.queueDeclare(QUEUE_NAME, false, false, false, null);
channel.basicPublish("", QUEUE_NAME, null, message.getBytes());
System.out.println(" [x] Sent '" + message + "'");
} catch (IOException e) {
e.printStackTrace();
} catch (TimeoutException e) {
e.printStackTrace();
}
}
}

View File

@ -0,0 +1,67 @@
package eu.csc.personalapp.services.notifications;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.TaskStackBuilder;
import android.content.Context;
import android.content.Intent;
import androidx.core.app.NotificationCompat;
import eu.csc.personalapp.R;
import eu.csc.personalapp.services.persistence.entity.EventEntity;
import eu.csc.personalapp.ui.main.MainActivity;
import eu.csc.personalapp.ui.reportEvent.ReportEventActivity;
public class NotificationService {
private static int notificationID = 42;
private final NotificationCompat.Builder mBuilder;
private NotificationService(Context context) {
mBuilder = new NotificationCompat.Builder(context);
}
public static void createEventNotification(Context context, EventEntity eventEntity){
NotificationService notificationService = new NotificationService(context);
NotificationCompat.Builder builder = notificationService.mBuilder;
builder.setSmallIcon(R.drawable.ic_menu_manage);
builder.setContentTitle("Notification Alert, Click Me!");
builder.setContentText("Hi, This is Android Notification Detail!");
Intent resultIntent = new Intent(context, ReportEventActivity.class);
TaskStackBuilder stackBuilder = TaskStackBuilder.create(context);
stackBuilder.addParentStack(ReportEventActivity.class);
PendingIntent resultPendingIntent = stackBuilder.getPendingIntent(0,PendingIntent.FLAG_UPDATE_CURRENT);
// Adds the Intent that starts the Activity to the top of the stack
builder.setContentIntent(resultPendingIntent);
NotificationManager mNotificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
// notificationID allows you to update the notification later on.
mNotificationManager.notify(notificationID, builder.build());
}
public static void createRepairShopNotification(Context context, String message){
NotificationCompat.Builder mBuilder =
new NotificationCompat.Builder(context)
.setSmallIcon(R.drawable.ic_vehicle)
.setContentTitle("topic")
.setContentText(message);
Intent resultIntent = new Intent(context, MainActivity.class);
TaskStackBuilder stackBuilder = TaskStackBuilder.create(context);
stackBuilder.addParentStack(MainActivity.class);
stackBuilder.addNextIntent(resultIntent);
PendingIntent resultPendingIntent =
stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT);
mBuilder.setContentIntent(resultPendingIntent);
NotificationManager mNotificationManager =
(NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
mNotificationManager.notify(100, mBuilder.build());
}
}

View File

@ -4,13 +4,17 @@ import androidx.room.Database;
import androidx.room.RoomDatabase;
import eu.csc.personalapp.services.persistence.dao.EventDao;
import eu.csc.personalapp.services.persistence.dao.VehicleEntityDao;
import eu.csc.personalapp.services.persistence.entity.Event;
import eu.csc.personalapp.services.persistence.entity.EventEntity;
import eu.csc.personalapp.services.persistence.entity.VehicleEntity;
@Database(entities = {
Event.class,
VehicleEntity.class
}, exportSchema = true, version = 1)
EventEntity.class,
VehicleEntity.class,
},
exportSchema = true,
version = 1)
public abstract class PersonalAppDatabase extends RoomDatabase {
public abstract EventDao eventDao();

View File

@ -1,8 +1,8 @@
package eu.csc.personalapp.services.persistence.dao;
import androidx.room.Dao;
import eu.csc.personalapp.services.persistence.entity.Event;
import eu.csc.personalapp.services.persistence.entity.EventEntity;
@Dao
public interface EventDao extends BaseDao<Event> {
public interface EventDao extends BaseDao<EventEntity> {
}

View File

@ -16,7 +16,7 @@ import java.util.Date;
@NoArgsConstructor
@Entity
public class Event {
public class EventEntity {
@PrimaryKey(autoGenerate = true)
@ -27,4 +27,5 @@ public class Event {
@TypeConverters({TimestampConverter.class})
private Date createdAt;
}

View File

@ -0,0 +1,21 @@
package eu.csc.personalapp.services.persistence.entity;
import androidx.room.ColumnInfo;
import androidx.room.TypeConverters;
import eu.csc.personalapp.services.persistence.converter.TimestampConverter;
import java.util.Date;
public class LeaseEntity {
@ColumnInfo(name = "created_at")
@TypeConverters({TimestampConverter.class})
private Date createdAt;
@ColumnInfo(name = "delivered_at")
private Date deliveredAt = null;
}

View File

@ -1,7 +1,10 @@
package eu.csc.personalapp.services.rest;
import eu.csc.personalapp.services.rest.data.APICustomer;
import eu.csc.personalapp.services.rest.data.APILease;
import eu.csc.personalapp.services.rest.data.GenerateAccessCodeResponse;
import io.reactivex.Single;
import okhttp3.ResponseBody;
import retrofit2.http.GET;
import retrofit2.http.Path;
import retrofit2.http.Query;
@ -14,4 +17,9 @@ public interface RetrofitApiClient {
@Query("api_key") String apiKey);
@GET("leases/{lease}")
Single<ResponseBody> getLease(@Path("lease") String lease);
@GET("api/generateAccessCode")
Single<GenerateAccessCodeResponse> generateAccessCode();
}

View File

@ -6,7 +6,7 @@ import retrofit2.converter.gson.GsonConverterFactory;
public class RetrofitApiClientFactory {
private static final String API_URL = "https://api.themoviedb.org/3/";
private static final String API_URL = "http://10.10.101.40:8000/repair/";
public static RetrofitApiClient getClient() {

View File

@ -0,0 +1,16 @@
package eu.csc.personalapp.services.rest;
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
public class UploadFileService extends Service {
public UploadFileService() {
}
@Override
public IBinder onBind(Intent intent) {
// TODO: Return the communication channel to the service.
throw new UnsupportedOperationException("Not yet implemented");
}
}

View File

@ -0,0 +1,16 @@
package eu.csc.personalapp.services.rest.data;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import java.io.Serializable;
@Getter
@Setter
@NoArgsConstructor
public class APILease implements Serializable {
}

View File

@ -0,0 +1,16 @@
package eu.csc.personalapp.services.rest.data;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import retrofit2.http.GET;
import java.io.Serializable;
@Getter
@Setter
@NoArgsConstructor
public class GenerateAccessCodeResponse implements Serializable {
private String code;
}

View File

@ -12,4 +12,7 @@ public interface LocalStorageClient {
boolean getIsLoggedIn();
}

View File

@ -9,26 +9,47 @@ import eu.csc.personalapp.R;
import eu.csc.personalapp.data.model.LoggedInUser;
import eu.csc.personalapp.services.serialization.JSONHelper;
import java.io.File;
public class LocalStorageClientImpl implements LocalStorageClient{
private SharedPreferences sharedPreferences;
private static final String TAG = LocalStorageClientImpl.class.getSimpleName();
private SharedPreferences sharedPreferences;
private static final String KEY_IS_LOGGED_IN = "prefs_isloggedin";
private static final String KEY_LOGGEDINUSER = "prefs_loggedin_user";
private static final String KEY_LOGGEDINUSERNAME = "prefs_loggedin_username";
private File tokenDir;
private File eventsDir;
protected LocalStorageClientImpl(Context context){
this.sharedPreferences = context.getSharedPreferences(
context.getString(R.string.preference_file_key), Context.MODE_PRIVATE);
this.initiateFilesDir(context.getFilesDir());
}
private void initiateFilesDir(File filesDir) {
this.tokenDir = new File(filesDir, "tokens");
this.eventsDir = new File(filesDir, "events");
this.tokenDir.mkdirs();
this.eventsDir.mkdirs();
}
public File getTokenDir() {
return tokenDir;
}
public LocalStorageClientImpl(Activity activity){
this.sharedPreferences = activity.getSharedPreferences(
activity.getString(R.string.preference_file_key), Context.MODE_PRIVATE);
}
public File getEventsDir() {
return eventsDir;
}
public boolean getIsLoggedIn(){
return sharedPreferences.getBoolean(KEY_IS_LOGGED_IN, false);

View File

@ -1,6 +1,10 @@
package eu.csc.personalapp.services.storage;
import android.app.Activity;
import android.content.Context;
import java.io.File;
import java.util.UUID;
public class StorageFactory {
@ -8,4 +12,12 @@ public class StorageFactory {
return new LocalStorageClientImpl(activity);
}
public static File getRandomFileName(Context context){
String filename = UUID.randomUUID().toString();
return new File(context.getFilesDir(), filename);
}
}

View File

@ -2,6 +2,7 @@ package eu.csc.personalapp.ui.main;
import android.content.Intent;
import android.os.Bundle;
import android.os.StrictMode;
import android.view.View;
import android.view.Menu;
@ -26,9 +27,11 @@ public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
Intent i = new Intent();
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);

View File

@ -1,27 +1,41 @@
package eu.csc.personalapp.ui.main.dboard;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.os.Message;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import androidx.annotation.NonNull;
import androidx.annotation.RequiresApi;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProvider;
import eu.csc.personalapp.R;
import eu.csc.personalapp.services.mqtt.Constants;
import eu.csc.personalapp.services.mqtt.MqttClient;
import eu.csc.personalapp.ui.reportEvent.ReportEventActivity;
import eu.csc.personalapp.ui.reportEvent.ReportEventDTO;
import eu.csc.personalapp.ui.svi.RegisterSVIActivity;
import java.io.UnsupportedEncodingException;
import java.time.Instant;
public class DashboardFragment extends Fragment {
private DashboardViewModel dashboardViewModel;
private Button btnChoosedEventListActivity;
private static final String TAG = DashboardFragment.class.getSimpleName();
@RequiresApi(api = Build.VERSION_CODES.O)
public View onCreateView(@NonNull LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
dashboardViewModel =
@ -34,6 +48,26 @@ public class DashboardFragment extends Fragment {
final Button btnActionRegisterSVI = root.findViewById(R.id.btnActionRegisterSVI);
final Button btnActionReportEvent = root.findViewById(R.id.btnActionReportEvent);
final Button btnActionPublishEvent = root.findViewById(R.id.btnActionPublishEvent);
final Button btnSubscribeEvents = root.findViewById(R.id.btnSubscribeEvents);
btnActionPublishEvent.setOnClickListener(v -> {
Log.d(TAG, "START SEND MESSAGE");
MqttClient c = new MqttClient();
String msg = Instant.now().toString();
c.sendMessage(msg);
// MQTTServices.getInstance().publishMessage();
// MQTTServices.getInstance().connect();
});
btnActionRegisterSVI.setOnClickListener(v -> {
Intent intent = new Intent(this.getContext(), RegisterSVIActivity.class);

View File

@ -15,6 +15,11 @@ import android.view.ViewGroup;
import eu.csc.personalapp.R;
import eu.csc.personalapp.data.model.Event;
import eu.csc.personalapp.data.model.RepairShop;
import eu.csc.personalapp.services.rest.RetrofitApiClient;
import eu.csc.personalapp.services.rest.RetrofitApiClientFactory;
import eu.csc.personalapp.services.rest.data.GenerateAccessCodeResponse;
import io.reactivex.Single;
import lombok.NoArgsConstructor;
import java.util.List;
@ -80,6 +85,12 @@ public class ReportEventFragment extends Fragment {
startActivityForResult(intent, REQUEST_CODE_SELECTEVENTS);
});
btnGenerateAccessCode.setOnClickListener(v->{
Single<GenerateAccessCodeResponse> request = RetrofitApiClientFactory.getClient().generateAccessCode();
tvAccessCode.setText(request.blockingGet().getCode());
});
btnSelectRepairShop.setOnClickListener(v -> {
Intent intent = new Intent(getActivity(), SelectRepairShopActivity.class);

View File

@ -35,6 +35,36 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/btnActionPublishEvent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:textAlignment="center"
android:text="Publish Event"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/btnActionReportEvent"
/>
<Button
android:id="@+id/btnSubscribeEvents"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:textAlignment="center"
android:text="Subscribe Events"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/btnActionPublishEvent"
/>
<Button
android:id="@+id/btnActionRegisterSVI"
android:layout_width="match_parent"

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">10.10.101.40</domain>
</domain-config>
</network-security-config>

View File

@ -16,4 +16,5 @@ org.gradle.jvmargs=-Xmx1024m -Dfile.encoding=UTF-8
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
android.enableJetifier=true

View File

@ -1 +0,0 @@
/build

View File

@ -1,48 +0,0 @@
plugins {
id 'com.android.library'
}
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
minSdkVersion 19
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.navigation:navigation-fragment:2.3.5'
implementation 'androidx.navigation:navigation-ui:2.3.5'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.3.1'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1'
implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.2.0'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}

View File

@ -1,21 +0,0 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

View File

@ -1,26 +0,0 @@
package eu.csc.ssv.eventreportmodule;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("eu.csc.ssv.eventreportmodule.test", appContext.getPackageName());
}
}

View File

@ -1,24 +0,0 @@
<resources>
<!--
TODO: Before you run your application, you need a Google Maps API key.
To get one, follow this link, follow the directions and press "Create" at the end:
https://console.developers.google.com/flows/enableapi?apiid=maps_android_backend&keyType=CLIENT_SIDE_ANDROID&r=AC:C8:66:16:07:4A:52:36:4B:53:6E:37:C7:8F:D2:7E:AE:D9:0C:3B%3Beu.csc.ssv.eventreportmodule.ui.repairshopmap
You can also add your credentials to an existing key, using these values:
Package name:
eu.csc.ssv.eventreportmodule.ui.repairshopmap
SHA-1 certificate fingerprint:
AC:C8:66:16:07:4A:52:36:4B:53:6E:37:C7:8F:D2:7E:AE:D9:0C:3B
Alternatively, follow the directions here:
https://developers.google.com/maps/documentation/android/start#get-key
Once you have your key (it starts with "AIza"), replace the "google_maps_key"
string in this file.
-->
<string name="google_maps_key" templateMergeStrategy="preserve" translatable="false">YOUR_KEY_HERE</string>
</resources>

View File

@ -1,52 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="eu.csc.ssv.eventreportmodule">
<!--
The ACCESS_COARSE/FINE_LOCATION permissions are not required to use
Google Maps Android API v2, but you must specify either coarse or fine
location permissions for the "MyLocation" functionality.
-->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<application>
<activity
android:name=".ui.repairshopmap.ChooseRepairShopActivity"
android:label="@string/title_activity_choose_repair_shop"
android:theme="@style/Theme.PersonalApp.NoActionBar"/>
<service
android:name=".ui.MyIntentService"
android:exported="false"/>
<activity
android:name=".ui.activity.chooseEvent.ChoosedEventListActivity"
android:label="@string/title_choosedevent_list"
android:theme="@style/Theme.PersonalApp.NoActionBar"/>
<activity
android:name=".ui.activity.chooseEvent.ChoosedEventDetailActivity"
android:label="@string/title_choosedevent_detail"
android:parentActivityName=".ui.activity.chooseEvent.ChoosedEventListActivity"
android:theme="@style/Theme.PersonalApp.NoActionBar">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="eu.csc.ssv.eventreportmodule.ui.activity.chooseEvent.ChoosedEventListActivity"/>
</activity>
<activity android:name=".ui.EventReportStart"/>
<!--
The API key for Google Maps-based APIs is defined as a string resource.
(See the file "res/values/google_maps_api.xml").
Note that the API key is linked to the encryption key used to sign the APK.
You need a different API key for each encryption key, including the release key that is used to
sign the APK for publishing.
You can define the keys for the debug and release targets in src/debug/ and src/release/.
-->
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="@string/google_maps_key"/>
<activity
android:name=".ui.EventReportModule"
android:label="@string/title_activity_event_report_module"/>
</application>
</manifest>

View File

@ -1,41 +0,0 @@
package eu.csc.ssv.eventreportmodule.ui;
import android.content.Intent;
import android.os.Bundle;
import com.google.android.material.bottomnavigation.BottomNavigationView;
import androidx.appcompat.app.AppCompatActivity;
import androidx.navigation.NavController;
import androidx.navigation.Navigation;
import androidx.navigation.ui.AppBarConfiguration;
import androidx.navigation.ui.NavigationUI;
import java.util.logging.Logger;
import eu.csc.ssv.eventreportmodule.R;
public class EventReportModule extends AppCompatActivity {
private static final Logger logger = Logger.getLogger(EventReportModule.class.getSimpleName());
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_event_report_module);
BottomNavigationView navView = findViewById(R.id.nav_view);
// Passing each menu ID as a set of Ids because each
// menu should be considered as top level destinations.
AppBarConfiguration appBarConfiguration = new AppBarConfiguration.Builder(
R.id.navigation_home, R.id.navigation_dashboard, R.id.navigation_notifications)
.build();
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment);
NavigationUI.setupActionBarWithNavController(this, navController, appBarConfiguration);
NavigationUI.setupWithNavController(navView, navController);
}
}

View File

@ -1,66 +0,0 @@
package eu.csc.ssv.eventreportmodule.ui;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import java.util.logging.Logger;
import eu.csc.ssv.eventreportmodule.R;
import eu.csc.ssv.eventreportmodule.ui.activity.chooseEvent.ChoosedEventListActivity;
import eu.csc.ssv.eventreportmodule.ui.ui.main.EventReportStartFragment;
public class EventReportStart extends AppCompatActivity {
public static final String EXTRA_EVENT_ID = "223";
private static final Logger logger = Logger.getLogger(EventReportStart.class.getSimpleName());
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.event_report_start_activity);
int[] re = getIntent().getIntArrayExtra(EXTRA_EVENT_ID);
logger.info(String.format("%s=%s", "EVID", re==null?"null":re));
if (savedInstanceState == null) {
getSupportFragmentManager().beginTransaction()
.replace(R.id.container, EventReportStartFragment.newInstance())
.commitNow();
}
if(re==null){
Intent intent = new Intent(this, ChoosedEventListActivity.class);
startActivityForResult(intent, MY_REQUEST_CODE);
}
}
final int MY_REQUEST_CODE = 42;
@Override
protected void onActivityResult(int requestCode,
int resultCode,
Intent data) {
super.onActivityResult(requestCode, resultCode, data);
logger.info(""+ requestCode);
if (requestCode == MY_REQUEST_CODE &&
resultCode == RESULT_OK) {
logger.info(""+ requestCode + "ASDW");
// textView.setText(intent.getStringExtra("text"));
}
}
}

View File

@ -1,88 +0,0 @@
package eu.csc.ssv.eventreportmodule.ui.activity.chooseEvent;
import android.content.Intent;
import android.os.Bundle;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.snackbar.Snackbar;
import androidx.appcompat.widget.Toolbar;
import android.view.View;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.app.ActionBar;
import android.view.MenuItem;
import eu.csc.ssv.eventreportmodule.R;
/**
* An activity representing a single ChoosedEvent 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 ChoosedEventListActivity}.
*/
public class ChoosedEventDetailActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_choosedevent_detail);
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) {
actionBar.setDisplayHomeAsUpEnabled(true);
}
// savedInstanceState is non-null when there is fragment state
// saved from previous configurations of this activity
// (e.g. when rotating the screen from portrait to landscape).
// In this case, the fragment will automatically be re-added
// to its container so we don"t need to manually add it.
// For more information, see the Fragments API guide at:
//
// http://developer.android.com/guide/components/fragments.html
//
if (savedInstanceState == null) {
// Create the detail fragment and add it to the activity
// using a fragment transaction.
Bundle arguments = new Bundle();
arguments.putString(ChoosedEventDetailFragment.ARG_ITEM_ID,
getIntent().getStringExtra(ChoosedEventDetailFragment.ARG_ITEM_ID));
ChoosedEventDetailFragment fragment = new ChoosedEventDetailFragment();
fragment.setArguments(arguments);
getSupportFragmentManager().beginTransaction()
.add(R.id.choosedevent_detail_container, fragment)
.commit();
}
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
if (id == android.R.id.home) {
// This ID represents the Home or Up button. In the case of this
// activity, the Up button is shown. For
// more details, see the Navigation pattern on Android Design:
//
// http://developer.android.com/design/patterns/navigation.html#up-vs-back
//
navigateUpTo(new Intent(this, ChoosedEventListActivity.class));
return true;
}
return super.onOptionsItemSelected(item);
}
}

View File

@ -1,73 +0,0 @@
package eu.csc.ssv.eventreportmodule.ui.activity.chooseEvent;
import android.app.Activity;
import android.os.Bundle;
import com.google.android.material.appbar.CollapsingToolbarLayout;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import eu.csc.ssv.eventreportmodule.R;
import eu.csc.ssv.eventreportmodule.ui.activity.chooseEvent.dummy.DummyContent;
/**
* A fragment representing a single ChoosedEvent detail screen.
* This fragment is either contained in a {@link ChoosedEventListActivity}
* in two-pane mode (on tablets) or a {@link ChoosedEventDetailActivity}
* on handsets.
*/
public class ChoosedEventDetailFragment extends Fragment {
/**
* The fragment argument representing the item ID that this fragment
* represents.
*/
public static final String ARG_ITEM_ID = "item_id";
/**
* The dummy content this fragment is presenting.
*/
private DummyContent.DummyItem mItem;
/**
* Mandatory empty constructor for the fragment manager to instantiate the
* fragment (e.g. upon screen orientation changes).
*/
public ChoosedEventDetailFragment() {
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments().containsKey(ARG_ITEM_ID)) {
// Load the dummy content specified by the fragment
// arguments. In a real-world scenario, use a Loader
// to load content from a content provider.
mItem = DummyContent.ITEM_MAP.get(getArguments().getString(ARG_ITEM_ID));
Activity activity = this.getActivity();
CollapsingToolbarLayout appBarLayout = (CollapsingToolbarLayout) activity.findViewById(R.id.toolbar_layout);
if (appBarLayout != null) {
appBarLayout.setTitle(mItem.content);
}
}
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.choosedevent_detail, container, false);
// Show the dummy content as text in a TextView.
if (mItem != null) {
((TextView) rootView.findViewById(R.id.choosedevent_detail)).setText(mItem.details);
}
return rootView;
}
}

View File

@ -1,152 +0,0 @@
package eu.csc.ssv.eventreportmodule.ui.activity.chooseEvent;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.RecyclerView;
import androidx.appcompat.widget.Toolbar;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.snackbar.Snackbar;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.Spinner;
import android.widget.TextView;
import eu.csc.ssv.eventreportmodule.R;
import eu.csc.ssv.eventreportmodule.ui.activity.chooseEvent.dummy.DummyContent;
import java.util.List;
/**
* An activity representing a list of ChoosedEvents. This activity
* has different presentations for handset and tablet-size devices. On
* handsets, the activity presents a list of items, which when touched,
* lead to a {@link ChoosedEventDetailActivity} representing
* item details. On tablets, the activity presents the list of items and
* item details side-by-side using two vertical panes.
*/
public class ChoosedEventListActivity extends AppCompatActivity {
/**
* Whether or not the activity is in two-pane mode, i.e. running on a tablet
* device.
*/
private boolean mTwoPane;
public static final String EXTRA_SELECTED_EVENTS = "sesas";
String[] listItems = {"A","B"};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_choosedevent_list);
Spinner sp=(Spinner)findViewById(R.id.spinner);
ArrayAdapter<String> adapter=new ArrayAdapter<String>(this,R.layout.spinner_layout,R.id.txt, listItems);
sp.setAdapter(adapter);
adapter.notifyDataSetChanged();
if (findViewById(R.id.choosedevent_detail_container) != null) {
// The detail container view will be present only in the
// large-screen layouts (res/values-w900dp).
// If this view is present, then the
// activity should be in two-pane mode.
mTwoPane = true;
}
Button bt = findViewById(R.id.bt);
bt.setOnClickListener(v -> {
Intent intent = new Intent();
intent.putExtra(EXTRA_SELECTED_EVENTS, listItems);
setResult(Activity.RESULT_OK, intent);
finish();
});
View recyclerView = findViewById(R.id.choosedevent_list);
assert recyclerView != null;
setupRecyclerView((RecyclerView) recyclerView);
}
private void setupRecyclerView(@NonNull RecyclerView recyclerView) {
recyclerView.setAdapter(new SimpleItemRecyclerViewAdapter(this, DummyContent.ITEMS, mTwoPane));
}
public static class SimpleItemRecyclerViewAdapter
extends RecyclerView.Adapter<SimpleItemRecyclerViewAdapter.ViewHolder> {
private final ChoosedEventListActivity mParentActivity;
private final List<DummyContent.DummyItem> mValues;
private final boolean mTwoPane;
private final View.OnClickListener mOnClickListener = new View.OnClickListener() {
@Override
public void onClick(View view) {
DummyContent.DummyItem item = (DummyContent.DummyItem) view.getTag();
if (mTwoPane) {
Bundle arguments = new Bundle();
arguments.putString(ChoosedEventDetailFragment.ARG_ITEM_ID, item.id);
ChoosedEventDetailFragment fragment = new ChoosedEventDetailFragment();
fragment.setArguments(arguments);
mParentActivity.getSupportFragmentManager().beginTransaction()
.replace(R.id.choosedevent_detail_container, fragment)
.commit();
} else {
Context context = view.getContext();
Intent intent = new Intent(context, ChoosedEventDetailActivity.class);
intent.putExtra(ChoosedEventDetailFragment.ARG_ITEM_ID, item.id);
context.startActivity(intent);
}
}
};
SimpleItemRecyclerViewAdapter(ChoosedEventListActivity parent,
List<DummyContent.DummyItem> items,
boolean twoPane) {
mValues = items;
mParentActivity = parent;
mTwoPane = twoPane;
}
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext())
.inflate(R.layout.choosedevent_list_content, parent, false);
return new ViewHolder(view);
}
@Override
public void onBindViewHolder(final ViewHolder holder, int position) {
holder.mIdView.setText(mValues.get(position).id);
holder.mContentView.setText(mValues.get(position).content);
holder.itemView.setTag(mValues.get(position));
holder.itemView.setOnClickListener(mOnClickListener);
}
@Override
public int getItemCount() {
return mValues.size();
}
class ViewHolder extends RecyclerView.ViewHolder {
final TextView mIdView;
final TextView mContentView;
ViewHolder(View view) {
super(view);
mIdView = (TextView) view.findViewById(R.id.id_text);
mContentView = (TextView) view.findViewById(R.id.content);
}
}
}
}

View File

@ -1,72 +0,0 @@
package eu.csc.ssv.eventreportmodule.ui.activity.chooseEvent.dummy;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Helper class for providing sample content for user interfaces created by
* Android template wizards.
* <p>
* TODO: Replace all uses of this class before publishing your app.
*/
public class DummyContent {
/**
* An array of sample (dummy) items.
*/
public static final List<DummyItem> ITEMS = new ArrayList<DummyItem>();
/**
* A map of sample (dummy) items, by ID.
*/
public static final Map<String, DummyItem> ITEM_MAP = new HashMap<String, DummyItem>();
private static final int COUNT = 25;
static {
// Add some sample items.
for (int i = 1; i <= COUNT; i++) {
addItem(createDummyItem(i));
}
}
private static void addItem(DummyItem item) {
ITEMS.add(item);
ITEM_MAP.put(item.id, item);
}
private static DummyItem createDummyItem(int position) {
return new DummyItem(String.valueOf(position), "Item " + position, makeDetails(position));
}
private static String makeDetails(int position) {
StringBuilder builder = new StringBuilder();
builder.append("Details about Item: ").append(position);
for (int i = 0; i < position; i++) {
builder.append("\nMore details information here.");
}
return builder.toString();
}
/**
* A dummy item representing a piece of content.
*/
public static class DummyItem {
public final String id;
public final String content;
public final String details;
public DummyItem(String id, String content, String details) {
this.id = id;
this.content = content;
this.details = details;
}
@Override
public String toString() {
return content;
}
}
}

View File

@ -1,43 +0,0 @@
package eu.csc.ssv.eventreportmodule.ui.repairshopmap;
import androidx.lifecycle.ViewModelProvider;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import eu.csc.ssv.eventreportmodule.R;
public class ChooseRepairShop extends Fragment {
private ChooseRepairShopViewModel mViewModel;
public static final String ChooseRepairShop_REQUEST_CODE = "rsd";
public static ChooseRepairShop newInstance() {
return new ChooseRepairShop();
}
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
return inflater.inflate(R.layout.choose_repair_shop_fragment, container, false);
}
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
mViewModel = new ViewModelProvider(this).get(ChooseRepairShopViewModel.class);
// TODO: Use the ViewModel
}
}

View File

@ -1,26 +0,0 @@
package eu.csc.ssv.eventreportmodule.ui.repairshopmap;
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.ssv.eventreportmodule.R;
public class ChooseRepairShopActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_choose_repair_shop);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
}
}

View File

@ -1,7 +0,0 @@
package eu.csc.ssv.eventreportmodule.ui.repairshopmap;
import androidx.lifecycle.ViewModel;
public class ChooseRepairShopViewModel extends ViewModel {
// TODO: Implement the ViewModel
}

View File

@ -1,35 +0,0 @@
package eu.csc.ssv.eventreportmodule.ui.repairshopmap;
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.ssv.eventreportmodule.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);
}
});
}
}

View File

@ -1,59 +0,0 @@
package eu.csc.ssv.eventreportmodule.ui.repairshopmap;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MarkerOptions;
import eu.csc.ssv.eventreportmodule.R;
public class MapsFragment extends Fragment {
private OnMapReadyCallback callback = new OnMapReadyCallback() {
/**
* Manipulates the map once available.
* This callback is triggered when the map is ready to be used.
* This is where we can add markers or lines, add listeners or move the camera.
* In this case, we just add a marker near Sydney, Australia.
* If Google Play services is not installed on the device, the user will be prompted to
* install it inside the SupportMapFragment. This method will only be triggered once the
* user has installed Google Play services and returned to the app.
*/
@Override
public void onMapReady(GoogleMap googleMap) {
LatLng sydney = new LatLng(-34, 151);
googleMap.addMarker(new MarkerOptions().position(sydney).title("Marker in Sydney"));
googleMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));
}
};
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater,
@Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_maps, container, false);
}
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
SupportMapFragment mapFragment =
(SupportMapFragment) getChildFragmentManager().findFragmentById(R.id.map);
if (mapFragment != null) {
mapFragment.getMapAsync(callback);
}
}
}

View File

@ -1,35 +0,0 @@
package eu.csc.ssv.eventreportmodule.ui.repairshopmap;
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.ssv.eventreportmodule.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);
}
});
}
}

View File

@ -1,64 +0,0 @@
package eu.csc.ssv.eventreportmodule.ui.treatment;
import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import eu.csc.ssv.eventreportmodule.R;
import eu.csc.ssv.eventreportmodule.ui.treatment.dummy.DummyContent.DummyItem;
import java.util.List;
/**
* {@link RecyclerView.Adapter} that can display a {@link DummyItem}.
* TODO: Replace the implementation with code for your data type.
*/
public class MyTreatmentTimeRecyclerViewAdapter extends RecyclerView.Adapter<MyTreatmentTimeRecyclerViewAdapter.ViewHolder> {
private final List<DummyItem> mValues;
public MyTreatmentTimeRecyclerViewAdapter(List<DummyItem> items) {
mValues = items;
}
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext())
.inflate(R.layout.treatment_time_item, parent, false);
return new ViewHolder(view);
}
@Override
public void onBindViewHolder(final ViewHolder holder, int position) {
holder.mItem = mValues.get(position);
holder.mIdView.setText(mValues.get(position).id);
holder.mContentView.setText(mValues.get(position).content);
}
@Override
public int getItemCount() {
return mValues.size();
}
public class ViewHolder extends RecyclerView.ViewHolder {
public final View mView;
public final TextView mIdView;
public final TextView mContentView;
public DummyItem mItem;
public ViewHolder(View view) {
super(view);
mView = view;
mIdView = (TextView) view.findViewById(R.id.item_number);
mContentView = (TextView) view.findViewById(R.id.content);
}
@Override
public String toString() {
return super.toString() + " '" + mContentView.getText() + "'";
}
}
}

View File

@ -1,72 +0,0 @@
package eu.csc.ssv.eventreportmodule.ui.treatment;
import android.content.Context;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import eu.csc.ssv.eventreportmodule.R;
import eu.csc.ssv.eventreportmodule.ui.treatment.dummy.DummyContent;
/**
* A fragment representing a list of Items.
*/
public class TreatmentTimeFragment extends Fragment {
// TODO: Customize parameter argument names
private static final String ARG_COLUMN_COUNT = "column-count";
// TODO: Customize parameters
private int mColumnCount = 3;
/**
* Mandatory empty constructor for the fragment manager to instantiate the
* fragment (e.g. upon screen orientation changes).
*/
public TreatmentTimeFragment() {
}
// TODO: Customize parameter initialization
@SuppressWarnings("unused")
public static TreatmentTimeFragment newInstance(int columnCount) {
TreatmentTimeFragment fragment = new TreatmentTimeFragment();
Bundle args = new Bundle();
args.putInt(ARG_COLUMN_COUNT, columnCount);
fragment.setArguments(args);
return fragment;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null) {
mColumnCount = getArguments().getInt(ARG_COLUMN_COUNT);
}
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.treatment_time_item_list, container, false);
// Set the adapter
if (view instanceof RecyclerView) {
Context context = view.getContext();
RecyclerView recyclerView = (RecyclerView) view;
if (mColumnCount <= 1) {
recyclerView.setLayoutManager(new LinearLayoutManager(context));
} else {
recyclerView.setLayoutManager(new GridLayoutManager(context, mColumnCount));
}
recyclerView.setAdapter(new MyTreatmentTimeRecyclerViewAdapter(DummyContent.ITEMS));
}
return view;
}
}

View File

@ -1,72 +0,0 @@
package eu.csc.ssv.eventreportmodule.ui.treatment.dummy;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Helper class for providing sample content for user interfaces created by
* Android template wizards.
* <p>
* TODO: Replace all uses of this class before publishing your app.
*/
public class DummyContent {
/**
* An array of sample (dummy) items.
*/
public static final List<DummyItem> ITEMS = new ArrayList<DummyItem>();
/**
* A map of sample (dummy) items, by ID.
*/
public static final Map<String, DummyItem> ITEM_MAP = new HashMap<String, DummyItem>();
private static final int COUNT = 25;
static {
// Add some sample items.
for (int i = 1; i <= COUNT; i++) {
addItem(createDummyItem(i));
}
}
private static void addItem(DummyItem item) {
ITEMS.add(item);
ITEM_MAP.put(item.id, item);
}
private static DummyItem createDummyItem(int position) {
return new DummyItem(String.valueOf(position), "Item " + position, makeDetails(position));
}
private static String makeDetails(int position) {
StringBuilder builder = new StringBuilder();
builder.append("Details about Item: ").append(position);
for (int i = 0; i < position; i++) {
builder.append("\nMore details information here.");
}
return builder.toString();
}
/**
* A dummy item representing a piece of content.
*/
public static class DummyItem {
public final String id;
public final String content;
public final String details;
public DummyItem(String id, String content, String details) {
this.id = id;
this.content = content;
this.details = details;
}
@Override
public String toString() {
return content;
}
}
}

View File

@ -1,35 +0,0 @@
package eu.csc.ssv.eventreportmodule.ui.ui.dashboard;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProvider;
import eu.csc.ssv.eventreportmodule.R;
public class DashboardFragment extends Fragment {
private DashboardViewModel dashboardViewModel;
public View onCreateView(@NonNull LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
dashboardViewModel =
new ViewModelProvider(this).get(DashboardViewModel.class);
View root = inflater.inflate(R.layout.fragment_dashboard, container, false);
final TextView textView = root.findViewById(R.id.text_dashboard);
dashboardViewModel.getText().observe(getViewLifecycleOwner(), new Observer<String>() {
@Override
public void onChanged(@Nullable String s) {
textView.setText(s);
}
});
return root;
}
}

View File

@ -1,19 +0,0 @@
package eu.csc.ssv.eventreportmodule.ui.ui.dashboard;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;
public class DashboardViewModel extends ViewModel {
private MutableLiveData<String> mText;
public DashboardViewModel() {
mText = new MutableLiveData<>();
mText.setValue("This is dashboard fragment");
}
public LiveData<String> getText() {
return mText;
}
}

View File

@ -1,35 +0,0 @@
package eu.csc.ssv.eventreportmodule.ui.ui.home;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProvider;
import eu.csc.ssv.eventreportmodule.R;
public class HomeFragment extends Fragment {
private HomeViewModel homeViewModel;
public View onCreateView(@NonNull LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
homeViewModel =
new ViewModelProvider(this).get(HomeViewModel.class);
View root = inflater.inflate(R.layout.fragment_home, container, false);
final TextView textView = root.findViewById(R.id.text_home);
homeViewModel.getText().observe(getViewLifecycleOwner(), new Observer<String>() {
@Override
public void onChanged(@Nullable String s) {
textView.setText(s);
}
});
return root;
}
}

View File

@ -1,19 +0,0 @@
package eu.csc.ssv.eventreportmodule.ui.ui.home;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;
public class HomeViewModel extends ViewModel {
private MutableLiveData<String> mText;
public HomeViewModel() {
mText = new MutableLiveData<>();
mText.setValue("This is home fragment");
}
public LiveData<String> getText() {
return mText;
}
}

View File

@ -1,41 +0,0 @@
package eu.csc.ssv.eventreportmodule.ui.ui.main;
import androidx.lifecycle.ViewModelProvider;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import eu.csc.ssv.eventreportmodule.R;
public class EventReportStartFragment extends Fragment {
private EventReportStartViewModel mViewModel;
public static EventReportStartFragment newInstance() {
return new EventReportStartFragment();
}
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
return inflater.inflate(R.layout.event_report_main_fragment, container, false);
}
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
mViewModel = new ViewModelProvider(this).get(EventReportStartViewModel.class);
// TODO: Use the ViewModel
}
}

View File

@ -1,7 +0,0 @@
package eu.csc.ssv.eventreportmodule.ui.ui.main;
import androidx.lifecycle.ViewModel;
public class EventReportStartViewModel extends ViewModel {
// TODO: Implement the ViewModel
}

View File

@ -1,34 +0,0 @@
package eu.csc.ssv.eventreportmodule.ui.ui.notifications;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProvider;
import eu.csc.ssv.eventreportmodule.R;
public class NotificationsFragment extends Fragment {
private NotificationsViewModel notificationsViewModel;
public View onCreateView(@NonNull LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
notificationsViewModel =
new ViewModelProvider(this).get(NotificationsViewModel.class);
View root = inflater.inflate(R.layout.fragment_notifications, container, false);
final TextView textView = root.findViewById(R.id.text_notifications);
notificationsViewModel.getText().observe(getViewLifecycleOwner(), new Observer<String>() {
@Override
public void onChanged(@Nullable String s) {
textView.setText(s);
}
});
return root;
}
}

View File

@ -1,19 +0,0 @@
package eu.csc.ssv.eventreportmodule.ui.ui.notifications;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;
public class NotificationsViewModel extends ViewModel {
private MutableLiveData<String> mText;
public NotificationsViewModel() {
mText = new MutableLiveData<>();
mText.setValue("This is notifications fragment");
}
public LiveData<String> getText() {
return mText;
}
}

View File

@ -1,9 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M3,13h8L11,3L3,3v10zM3,21h8v-6L3,15v6zM13,21h8L21,11h-8v10zM13,3v6h8L21,3h-8z" />
</vector>

View File

@ -1,9 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M10,20v-6h4v6h5v-8h3L12,3 2,12h3v8z" />
</vector>

View File

@ -1,9 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M12,22c1.1,0 2,-0.9 2,-2h-4c0,1.1 0.89,2 2,2zM18,16v-5c0,-3.07 -1.64,-5.64 -4.5,-6.32L13.5,4c0,-0.83 -0.67,-1.5 -1.5,-1.5s-1.5,0.67 -1.5,1.5v0.68C7.63,5.36 6,7.92 6,11v5l-2,2v1h16v-1l-2,-2z" />
</vector>

View File

@ -1,37 +0,0 @@
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:baselineAligned="false"
android:divider="?android:attr/dividerHorizontal"
android:orientation="horizontal"
android:showDividers="middle"
tools:context=".ui.activity.chooseEvent.ChoosedEventListActivity">
<!--
This layout is a two-pane layout for the ChoosedEvents master/detail flow.
-->
<androidx.recyclerview.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/choosedevent_list"
android:name="eu.csc.ssv.eventreportmodule.ui.activity.chooseEvent.ChoosedEventListFragment"
android:layout_width="@dimen/item_width"
android:layout_height="match_parent"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
app:layoutManager="LinearLayoutManager"
tools:context="eu.csc.ssv.eventreportmodule.ui.activity.chooseEvent.ChoosedEventListActivity"
tools:listitem="@layout/choosedevent_list_content" />
<FrameLayout
android:id="@+id/choosedevent_detail_container"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="3" />
</LinearLayout>

View File

@ -1,25 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.repairshopmap.ChooseRepairShopActivity">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/Theme.PersonalApp.AppBarOverlay">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/Theme.PersonalApp.PopupOverlay" />
</com.google.android.material.appbar.AppBarLayout>
<include layout="@layout/content_choose_repair_shop" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -1,54 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context=".ui.activity.chooseEvent.ChoosedEventDetailActivity"
tools:ignore="MergeRootFrame">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/app_bar"
android:layout_width="match_parent"
android:layout_height="@dimen/app_bar_height"
android:fitsSystemWindows="true"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/toolbar_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
app:contentScrim="?attr/colorPrimary"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
app:toolbarId="@+id/toolbar">
<androidx.appcompat.widget.Toolbar
android:id="@+id/detail_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>
<androidx.core.widget.NestedScrollView
android:id="@+id/choosedevent_detail_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|start"
android:layout_margin="@dimen/fab_margin"
app:layout_anchor="@+id/choosedevent_detail_container"
app:layout_anchorGravity="top|end"
app:srcCompat="@android:drawable/stat_notify_chat" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -1,70 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context=".ui.activity.chooseEvent.ChoosedEventListActivity">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout android:orientation="horizontal"
android:layout_width="match_parent" android:id="@+id/lvEL"
android:layout_height="wrap_content">
<TextView
android:id="@+id/txt"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginRight="10dp"
/>
<Button
android:id="@+id/bt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:focusable="false"
android:padding="10sp"
>
</Button>
<Spinner
android:id="@+id/spinner"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
</LinearLayout>
<FrameLayout
android:id="@+id/frameLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/lvEL"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<include layout="@layout/choosedevent_list" />
</FrameLayout>
</RelativeLayout>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin"
app:srcCompat="@android:drawable/ic_dialog_email" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -1,33 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="?attr/actionBarSize">
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/nav_view"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="0dp"
android:layout_marginEnd="0dp"
android:background="?android:attr/windowBackground"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:menu="@menu/bottom_nav_menu" />
<fragment
android:id="@+id/nav_host_fragment"
android:name="androidx.navigation.fragment.NavHostFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:defaultNavHost="true"
app:layout_constraintBottom_toTopOf="@id/nav_view"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:navGraph="@navigation/mobile_navigation" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -1,34 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.MainActivity">
<com.google.android.material.appbar.AppBarLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:theme="@style/Theme.PersonalApp.AppBarOverlay">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/Theme.PersonalApp.PopupOverlay"/>
</com.google.android.material.appbar.AppBarLayout>
<include layout="@layout/content_main"/>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin"
app:srcCompat="@android:drawable/ic_dialog_email"/>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -1,18 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.repairshopmap.ChooseRepairShop">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Hello" />
<ListView
android:id="@+id/list"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
</FrameLayout>

View File

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/choosedevent_detail"
style="?android:attr/textAppearanceLarge"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="16dp"
android:textIsSelectable="true"
tools:context=".ui.activity.chooseEvent.ChoosedEventDetailFragment" />

View File

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.recyclerview.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/choosedevent_list"
android:name="eu.csc.ssv.eventreportmodule.ui.activity.chooseEvent.ChoosedEventListFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
app:layoutManager="LinearLayoutManager"
tools:context=".ui.activity.chooseEvent.ChoosedEventListActivity"
tools:listitem="@layout/choosedevent_list_content" />

View File

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/id_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/text_margin"
android:textAppearance="?attr/textAppearanceListItem" />
<TextView
android:id="@+id/content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/text_margin"
android:textAppearance="?attr/textAppearanceListItem" />
</LinearLayout>

View File

@ -1,55 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<ListView
android:layout_width="match_parent"
android:layout_weight="1"
></ListView>
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<LinearLayout android:layout_weight="2"
android:layout_column="0"
android:id="@+id/layout2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<Button
android:id="@+id/button1"
style="?android:attr/buttonStyleSmall"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:text="Button" />
<Button
android:id="@+id/button2"
style="?android:attr/buttonStyleSmall"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:text="Button" />
</LinearLayout>
</TableRow>
</TableLayout>

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
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"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -1,47 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/event_report_start"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.EventReportStart">
<TableLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TableRow>
<TextView android:text="Repairshop"></TextView>
<Button android:text="Choose" android:id="@+id/btnChooseRepairshop"></Button>
</TableRow>
<TableRow>
<FrameLayout android:id="@+id/frmRepairShop"
android:layout_height="50dp"
android:layout_width="match_parent"></FrameLayout>
</TableRow>
<TableRow>
<TableLayout>
<TableRow>
<TextView android:text="Times" android:layout_column="0" android:layout_height="wrap_content"></TextView></TableRow>
<TableRow>
<Button android:text="Ad"></Button>
</TableRow>
</TableLayout>
</TableRow>
<TableRow>
</TableRow>
</TableLayout>
<TextView
android:id="@+id/message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="EventReportStartFragment"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.EventReportStart" />

View File

@ -1,22 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.ui.dashboard.DashboardFragment">
<TextView
android:id="@+id/text_dashboard"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:textAlignment="center"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -1,28 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".FirstFragment">
<TextView
android:id="@+id/textview_first"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello_first_fragment"
app:layout_constraintBottom_toTopOf="@id/button_first"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/button_first"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/next"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/textview_first" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -1,31 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".First2Fragment">
<TextView
android:id="@+id/textview_first"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello_first_fragment"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toTopOf="@id/button_first"
/>
<Button
android:id="@+id/button_first"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/next"
app:layout_constraintTop_toBottomOf="@id/textview_first"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -1,22 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.ui.home.HomeFragment">
<TextView
android:id="@+id/text_home"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:textAlignment="center"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.repairshopmap.MapsFragment" />

View File

@ -1,22 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.ui.notifications.NotificationsFragment">
<TextView
android:id="@+id/text_notifications"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:textAlignment="center"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -1,27 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".SecondFragment">
<TextView
android:id="@+id/textview_second"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toTopOf="@id/button_second"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/button_second"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/previous"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/textview_second" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -1,30 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".Second2Fragment">
<TextView
android:id="@+id/textview_second"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toTopOf="@id/button_second"
/>
<Button
android:id="@+id/button_second"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/previous"
app:layout_constraintTop_toBottomOf="@id/textview_second"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<TextView
android:id="@+id/txt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp"
/>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/item_number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/text_margin"
android:textAppearance="?attr/textAppearanceListItem" />
<TextView
android:id="@+id/content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/text_margin"
android:textAppearance="?attr/textAppearanceListItem" />
</LinearLayout>

View File

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.recyclerview.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/list"
android:name="eu.csc.ssv.eventreportmodule.ui.treatment.TreatmentTimeFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
app:layoutManager="LinearLayoutManager"
tools:context=".ui.treatment.TreatmentTimeFragment"
tools:listitem="@layout/treatment_time_item" />

View File

@ -1,19 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/navigation_home"
android:icon="@drawable/ic_home_black_24dp"
android:title="@string/title_home" />
<item
android:id="@+id/navigation_dashboard"
android:icon="@drawable/ic_dashboard_black_24dp"
android:title="@string/title_dashboard" />
<item
android:id="@+id/navigation_notifications"
android:icon="@drawable/ic_notifications_black_24dp"
android:title="@string/title_notifications" />
</menu>

View File

@ -1,25 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/mobile_navigation"
app:startDestination="@+id/navigation_home">
<fragment
android:id="@+id/navigation_home"
android:name="eu.csc.ssv.eventreportmodule.ui.ui.home.HomeFragment"
android:label="@string/title_home"
tools:layout="@layout/fragment_home" />
<fragment
android:id="@+id/navigation_dashboard"
android:name="eu.csc.ssv.eventreportmodule.ui.ui.dashboard.DashboardFragment"
android:label="@string/title_dashboard"
tools:layout="@layout/fragment_dashboard" />
<fragment
android:id="@+id/navigation_notifications"
android:name="eu.csc.ssv.eventreportmodule.ui.ui.notifications.NotificationsFragment"
android:label="@string/title_notifications"
tools:layout="@layout/fragment_notifications" />
</navigation>

View File

@ -1,48 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/nav_graph"
app:startDestination="@id/FirstFragment">
<fragment
android:id="@+id/FirstFragment"
android:name="eu.csc.ssv.eventreportmodule.ui.repairshopmap.FirstFragment"
android:label="@string/first_fragment_label"
tools:layout="@layout/fragment_first">
<action
android:id="@+id/action_FirstFragment_to_SecondFragment"
app:destination="@id/SecondFragment"/>
</fragment>
<fragment
android:id="@+id/SecondFragment"
android:name="eu.csc.ssv.eventreportmodule.ui.repairshopmap.SecondFragment"
android:label="@string/second_fragment_label"
tools:layout="@layout/fragment_second">
<action
android:id="@+id/action_SecondFragment_to_FirstFragment"
app:destination="@id/FirstFragment"/>
</fragment>
<fragment
android:id="@+id/First2Fragment"
android:name="eu.csc.ssv.eventreportmodule.ui.First2Fragment"
android:label="@string/first_fragment_label"
tools:layout="@layout/fragment_first2">
<action
android:id="@+id/action_First2Fragment_to_Second2Fragment"
app:destination="@id/Second2Fragment"/>
</fragment>
<fragment
android:id="@+id/Second2Fragment"
android:name="eu.csc.ssv.eventreportmodule.ui.Second2Fragment"
android:label="@string/second_fragment_label"
tools:layout="@layout/fragment_second2">
<action
android:id="@+id/action_Second2Fragment_to_First2Fragment"
app:destination="@id/First2Fragment"/>
</fragment>
</navigation>

View File

@ -1,9 +0,0 @@
<resources>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
<dimen name="text_margin">16dp</dimen>
<dimen name="fab_margin">16dp</dimen>
<dimen name="app_bar_height">200dp</dimen>
<dimen name="item_width">200dp</dimen>
</resources>

View File

@ -1,18 +0,0 @@
<resources>
<string name="title_activity_event_report_module">MainActivity</string>
<string name="title_home">Home</string>
<string name="title_dashboard">Dashboard</string>
<string name="title_notifications">Notifications</string>
<string name="title_choosedevent_list">ChoosedEvents</string>
<string name="title_choosedevent_detail">ChoosedEvent Detail</string>
<string name="title_activity_choose_repair_shop">ChooseRepairShopActivity</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="hello_first_fragment">Hello first fragment</string>
<string name="hello_second_fragment">Hello second fragment. Arg: %1$s</string>
<string name="title_activity_main">MainActivity</string>
</resources>

View File

@ -1,13 +0,0 @@
<resources>
<style name="Theme.PersonalApp" parent="Theme.MaterialComponents.Light"/>
<style name="Theme.PersonalApp.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="Theme.PersonalApp.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar"/>
<style name="Theme.PersonalApp.PopupOverlay" parent="ThemeOverlay.AppCompat.Light"/>
</resources>

View File

@ -1,20 +0,0 @@
<resources>
<!--
TODO: Before you release your application, you need a Google Maps API key.
To do this, you can either add your release key credentials to your existing
key, or create a new key.
Note that this file specifies the API key for the release build target.
If you have previously set up a key for the debug target with the debug signing certificate,
you will also need to set up a key for your release certificate.
Follow the directions here:
https://developers.google.com/maps/documentation/android/signup
Once you have your key (it starts with "AIza"), replace the "google_maps_key"
string in this file.
-->
<string name="google_maps_key" templateMergeStrategy="preserve" translatable="false">YOUR_KEY_HERE</string>
</resources>

View File

@ -1,17 +0,0 @@
package eu.csc.ssv.eventreportmodule;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
}

View File

@ -1,5 +1,5 @@
include ':services:core'
include ':module:EventReportModule'
include ':services:appserverclient'
include ':services:localstorage'