Add Some comments on header of the class to help someone to know the

purpose of them
master
Schoumi 6 years ago
parent b000e6b84b
commit 41d60365ec
  1. 5
      app/src/main/java/fr/mobdev/lpcprog/activity/MainActivity.java
  2. 5
      app/src/main/java/fr/mobdev/lpcprog/adapters/BinariesAdapter.java
  3. 3
      app/src/main/java/fr/mobdev/lpcprog/adapters/DeviceAdapter.java
  4. 3
      app/src/main/java/fr/mobdev/lpcprog/adapters/PartsAdapter.java
  5. 4
      app/src/main/java/fr/mobdev/lpcprog/adapters/ServerAdapter.java
  6. 3
      app/src/main/java/fr/mobdev/lpcprog/fragment/AddPartFragment.java
  7. 3
      app/src/main/java/fr/mobdev/lpcprog/fragment/DeviceFragment.java
  8. 3
      app/src/main/java/fr/mobdev/lpcprog/fragment/PartsFragment.java
  9. 4
      app/src/main/java/fr/mobdev/lpcprog/fragment/ServersFragment.java
  10. 3
      app/src/main/java/fr/mobdev/lpcprog/fragment/USBListFragment.java
  11. 4
      app/src/main/java/fr/mobdev/lpcprog/listener/DownloadListener.java
  12. 3
      app/src/main/java/fr/mobdev/lpcprog/listener/FlashListener.java
  13. 4
      app/src/main/java/fr/mobdev/lpcprog/listener/NetworkListener.java
  14. 4
      app/src/main/java/fr/mobdev/lpcprog/listener/ServerListener.java
  15. 3
      app/src/main/java/fr/mobdev/lpcprog/managers/DatabaseManager.java
  16. 3
      app/src/main/java/fr/mobdev/lpcprog/managers/IspManager.java
  17. 3
      app/src/main/java/fr/mobdev/lpcprog/managers/NetworkManager.java
  18. 4
      app/src/main/java/fr/mobdev/lpcprog/managers/UsbCommManager.java
  19. 3
      app/src/main/java/fr/mobdev/lpcprog/objects/Binary.java
  20. 3
      app/src/main/java/fr/mobdev/lpcprog/objects/Part.java
  21. 3
      app/src/main/java/fr/mobdev/lpcprog/objects/Server.java
  22. 3
      app/src/main/java/fr/mobdev/lpcprog/objects/USBDevice.java

@ -46,6 +46,11 @@ import fr.mobdev.lpcprog.fragment.USBListFragment;
import fr.mobdev.lpcprog.listener.ServerListener;
import fr.mobdev.lpcprog.objects.USBDevice;
/*
The only activity of the app. It Handle all change of fragment depending on user actions
the Menu change with fragment
*/
public class MainActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener,
USBListFragment.USBInteractionListener,
AddPartFragment.OnAddInteractionListener

@ -43,7 +43,10 @@ import fr.mobdev.lpcprog.managers.IspManager;
import fr.mobdev.lpcprog.managers.NetworkManager;
import fr.mobdev.lpcprog.objects.Binary;
import fr.mobdev.lpcprog.objects.Server;
/*
Adapter that handle Binaries List. Binaries are in sections depending on servers. There's only
one list, the class handle sections and items in the adapter
*/
public class BinariesAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
private static final int SECTION = 0;

@ -30,6 +30,9 @@ import java.util.List;
import fr.mobdev.lpcprog.R;
import fr.mobdev.lpcprog.objects.USBDevice;
/*
Adapter use to display devices pluggued on the device through OTG
*/
public class DeviceAdapter extends RecyclerView.Adapter<DeviceHolder> {
private List<USBDevice> devices;

@ -34,6 +34,9 @@ import fr.mobdev.lpcprog.fragment.PartsFragment;
import fr.mobdev.lpcprog.managers.DatabaseManager;
import fr.mobdev.lpcprog.objects.Part;
/*
Adapter use to display list of µc definitions
*/
public class PartsAdapter extends RecyclerView.Adapter<PartHolder>{
private List<Part> parts;

@ -34,6 +34,10 @@ import fr.mobdev.lpcprog.listener.ServerListener;
import fr.mobdev.lpcprog.managers.DatabaseManager;
import fr.mobdev.lpcprog.objects.Server;
/*
Adapter use to display servers in different sections
*/
public class ServerAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
private static final int SECTION = 0;

@ -36,6 +36,9 @@ import fr.mobdev.lpcprog.R;
import fr.mobdev.lpcprog.managers.DatabaseManager;
import fr.mobdev.lpcprog.objects.Part;
/*
Fragment that Handle add µC definitions to the Database
*/
public class AddPartFragment extends Fragment {
private Part part;

@ -48,6 +48,9 @@ import fr.mobdev.lpcprog.objects.Server;
import fr.mobdev.lpcprog.objects.USBDevice;
import fr.mobdev.lpcprog.managers.UsbCommManager;
/*
Fragment that handle action on a specific device that can be flash with some Binaries
*/
public class DeviceFragment extends Fragment {
private UsbCommManager comm;

@ -33,6 +33,9 @@ import fr.mobdev.lpcprog.adapters.PartsAdapter;
import fr.mobdev.lpcprog.managers.DatabaseManager;
import fr.mobdev.lpcprog.objects.Part;
/*
Fragment that display list of different µC definitions
*/
public class PartsFragment extends Fragment {
private OnEditPressListener onEditListener;

@ -36,8 +36,8 @@ import fr.mobdev.lpcprog.managers.DatabaseManager;
import fr.mobdev.lpcprog.objects.Server;
/*
* Activity that allow user to manage the server where he want to upload his images. Server must contains a Binaries file to work with the app
*/
Fragment that allow user to manage the server where he want to upload his images. Server must contains a Binaries file to work with the app
*/
public class ServersFragment extends Fragment {
private ServerListener serverListener;

@ -36,6 +36,9 @@ import fr.mobdev.lpcprog.R;
import fr.mobdev.lpcprog.objects.USBDevice;
import fr.mobdev.lpcprog.managers.UsbCommManager;
/*
Fragment use to display USB device plugged through OTG port
*/
public class USBListFragment extends Fragment {
private List<USBDevice> devices;

@ -23,6 +23,10 @@ import java.util.EventListener;
import fr.mobdev.lpcprog.objects.Binary;
import fr.mobdev.lpcprog.objects.Server;
/*
Listener that handle events during download Binary
*/
public interface DownloadListener extends EventListener {
void downloadCanceled(Server server, Binary binary);
void downloadSuccessful(Server server, Binary binary);

@ -22,6 +22,9 @@ import android.widget.ImageView;
import java.util.EventListener;
/*
Listener that handle ISPManager events
*/
public interface FlashListener extends EventListener{
void onStartFlash();
void onSuccess();

@ -21,7 +21,9 @@ package fr.mobdev.lpcprog.listener;
import java.util.EventListener;
import fr.mobdev.lpcprog.objects.Server;
/*
Listener working with the NetworkManager to handle events
*/
public interface NetworkListener extends EventListener{
void startBinaries();
void startServer(Server server);

@ -19,7 +19,9 @@
package fr.mobdev.lpcprog.listener;
import java.util.EventListener;
/*
Listener that handle server add/delete
*/
public interface ServerListener extends EventListener {
void updateServerList();
}

@ -32,6 +32,9 @@ import fr.mobdev.lpcprog.objects.Binary;
import fr.mobdev.lpcprog.objects.Part;
import fr.mobdev.lpcprog.objects.Server;
/*
Singleton use to manage all database access
*/
public class DatabaseManager extends SQLiteOpenHelper {
private static DatabaseManager instance;

@ -36,6 +36,9 @@ import fr.mobdev.lpcprog.objects.Part;
import fr.mobdev.lpcprog.objects.Server;
import fr.mobdev.lpcprog.objects.USBDevice;
/*
Singleton that handle all ISP functions
*/
public class IspManager {
//defines

@ -41,6 +41,9 @@ import fr.mobdev.lpcprog.listener.NetworkListener;
import fr.mobdev.lpcprog.objects.Binary;
import fr.mobdev.lpcprog.objects.Server;
/*
Singleton that handle all network connection
*/
public class NetworkManager {
private NetworkListener listener;

@ -26,7 +26,9 @@ import java.util.ArrayList;
import java.util.List;
import fr.mobdev.lpcprog.objects.USBDevice;
/*
Manager use to manage usb devices
*/
public class UsbCommManager {
private static UsbCommManager instance = null;

@ -18,6 +18,9 @@
package fr.mobdev.lpcprog.objects;
/*
Object that represent a binary for the app
*/
public class Binary {
public long id;
public String name;

@ -18,6 +18,9 @@
package fr.mobdev.lpcprog.objects;
/*
Object that represent µC definition for the app
*/
public class Part {
public long id;
public long part_id;

@ -22,6 +22,9 @@ import java.net.URL;
import java.util.ArrayList;
import java.util.List;
/*
Object that represent Server for the app
*/
public class Server {
public long id;
public URL url;

@ -20,6 +20,9 @@ package fr.mobdev.lpcprog.objects;
import com.ftdi.j2xx.FT_Device;
/*
Object that represent USBDevice as seen by the app
*/
public class USBDevice {
public int PID;
public int VID;

Loading…
Cancel
Save