Skip to content

Commit

Permalink
Code refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Philipp0002 committed Jul 29, 2024
1 parent 24c333a commit ba9dab4
Show file tree
Hide file tree
Showing 17 changed files with 38 additions and 32 deletions.
4 changes: 2 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
android:name=".XADGPSApplication"
tools:targetApi="31">
<activity
android:name=".LoginActivity"
android:name=".ui.LoginActivity"
android:exported="false" />
<activity
android:name=".MainActivity"
android:name=".ui.MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
import java.util.Optional;
import java.util.stream.Collectors;

import de.raffaelhahn.xadgps_client.NotifyDevice;
import de.raffaelhahn.xadgps_client.OperatingMode;
import de.raffaelhahn.xadgps_client.model.NotifyDevice;
import de.raffaelhahn.xadgps_client.model.OperatingMode;
import de.raffaelhahn.xadgps_client.R;
import de.raffaelhahn.xadgps_client.Constants;
import de.raffaelhahn.xadgps_client.async.GetDeviceListAsync;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
package de.raffaelhahn.xadgps_client;
package de.raffaelhahn.xadgps_client.model;

import android.content.Context;
import android.util.Log;

import org.json.JSONException;
import org.json.JSONObject;

import java.lang.reflect.Field;
import java.util.Iterator;
import de.raffaelhahn.xadgps_client.R;

public class Device extends NotifyDevice {
public String sn;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package de.raffaelhahn.xadgps_client;
package de.raffaelhahn.xadgps_client.model;

import android.content.Context;
import android.util.Log;

import org.json.JSONObject;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package de.raffaelhahn.xadgps_client;
package de.raffaelhahn.xadgps_client.model;

public enum OperatingMode {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
import java.util.Timer;
import java.util.TimerTask;

import de.raffaelhahn.xadgps_client.Device;
import de.raffaelhahn.xadgps_client.OperatingMode;
import de.raffaelhahn.xadgps_client.model.Device;
import de.raffaelhahn.xadgps_client.model.OperatingMode;
import de.raffaelhahn.xadgps_client.async.AsyncCallback;
import de.raffaelhahn.xadgps_client.Constants;
import de.raffaelhahn.xadgps_client.async.GetDeviceListAsync;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import android.app.Activity;
import androidx.core.app.ActivityCompat;

import de.raffaelhahn.xadgps_client.Device;
import de.raffaelhahn.xadgps_client.NotifyDevice;
import de.raffaelhahn.xadgps_client.model.Device;
import de.raffaelhahn.xadgps_client.model.NotifyDevice;
import de.raffaelhahn.xadgps_client.R;
import de.raffaelhahn.xadgps_client.Constants;
import de.raffaelhahn.xadgps_client.background.BackgroundWorkService;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package de.raffaelhahn.xadgps_client;
package de.raffaelhahn.xadgps_client.ui;

import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand All @@ -18,6 +17,9 @@
import java.util.ArrayList;
import java.util.Optional;

import de.raffaelhahn.xadgps_client.R;
import de.raffaelhahn.xadgps_client.Utils;
import de.raffaelhahn.xadgps_client.model.Device;
import de.raffaelhahn.xadgps_client.services.DeviceListService;
import de.raffaelhahn.xadgps_client.services.MovementMonitorService;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package de.raffaelhahn.xadgps_client;
package de.raffaelhahn.xadgps_client.ui;

import android.os.Bundle;

Expand All @@ -12,11 +12,10 @@
import android.view.View;
import android.view.ViewGroup;

import org.osmdroid.util.GeoPoint;
import org.osmdroid.views.overlay.Marker;

import java.util.ArrayList;

import de.raffaelhahn.xadgps_client.R;
import de.raffaelhahn.xadgps_client.model.Device;
import de.raffaelhahn.xadgps_client.services.DeviceListService;

public class DevicesFragment extends Fragment implements DeviceListService.DeviceListUpdateListener {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package de.raffaelhahn.xadgps_client;
package de.raffaelhahn.xadgps_client.ui;

import android.view.LayoutInflater;
import android.view.View;
Expand All @@ -9,6 +9,9 @@

import java.util.ArrayList;

import de.raffaelhahn.xadgps_client.R;
import de.raffaelhahn.xadgps_client.model.Device;

public class DevicesRecyclerAdapter extends RecyclerView.Adapter<DevicesRecyclerAdapter.DeviceViewHolder> {

private ArrayList<Device> deviceList = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package de.raffaelhahn.xadgps_client;
package de.raffaelhahn.xadgps_client.ui;

import androidx.appcompat.app.AppCompatActivity;

Expand All @@ -14,8 +14,11 @@

import java.util.Locale;

import de.raffaelhahn.xadgps_client.Constants;
import de.raffaelhahn.xadgps_client.R;
import de.raffaelhahn.xadgps_client.async.AsyncCallback;
import de.raffaelhahn.xadgps_client.async.LoginAsync;
import de.raffaelhahn.xadgps_client.model.OperatingMode;

public class LoginActivity extends AppCompatActivity {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package de.raffaelhahn.xadgps_client;
package de.raffaelhahn.xadgps_client.ui;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
Expand All @@ -14,6 +14,8 @@

import org.osmdroid.config.Configuration;

import de.raffaelhahn.xadgps_client.Constants;
import de.raffaelhahn.xadgps_client.R;
import de.raffaelhahn.xadgps_client.services.DeviceListService;

public class MainActivity extends AppCompatActivity {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package de.raffaelhahn.xadgps_client;
package de.raffaelhahn.xadgps_client.ui;

import android.Manifest;
import android.content.Context;
Expand Down Expand Up @@ -31,6 +31,9 @@

import java.util.ArrayList;

import de.raffaelhahn.xadgps_client.Constants;
import de.raffaelhahn.xadgps_client.R;
import de.raffaelhahn.xadgps_client.model.Device;
import de.raffaelhahn.xadgps_client.services.DeviceListService;

public class TrackingFragment extends Fragment implements DeviceListService.DeviceListUpdateListener {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_login.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="32dp"
tools:context=".LoginActivity">
tools:context=".ui.LoginActivity">


<androidx.constraintlayout.widget.ConstraintLayout
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/colorSurface"
tools:context=".MainActivity">
tools:context=".ui.MainActivity">

<androidx.fragment.app.FragmentContainerView
android:id="@+id/fragment_container_view"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/fragment_devices.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".DevicesFragment"
tools:context=".ui.DevicesFragment"
android:fitsSystemWindows="true">

<androidx.recyclerview.widget.RecyclerView
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/fragment_tracking.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".TrackingFragment">
tools:context=".ui.TrackingFragment">

<org.osmdroid.views.MapView
android:id="@+id/map"
Expand Down

0 comments on commit ba9dab4

Please sign in to comment.