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

purpose of them
This commit is contained in:
Schoumi 2016-11-02 17:05:47 +01:00
parent b000e6b84b
commit 41d60365ec
22 changed files with 70 additions and 6 deletions

View File

@ -46,6 +46,11 @@ import fr.mobdev.lpcprog.fragment.USBListFragment;
import fr.mobdev.lpcprog.listener.ServerListener; import fr.mobdev.lpcprog.listener.ServerListener;
import fr.mobdev.lpcprog.objects.USBDevice; 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, public class MainActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener,
USBListFragment.USBInteractionListener, USBListFragment.USBInteractionListener,
AddPartFragment.OnAddInteractionListener AddPartFragment.OnAddInteractionListener

View File

@ -43,7 +43,10 @@ import fr.mobdev.lpcprog.managers.IspManager;
import fr.mobdev.lpcprog.managers.NetworkManager; import fr.mobdev.lpcprog.managers.NetworkManager;
import fr.mobdev.lpcprog.objects.Binary; import fr.mobdev.lpcprog.objects.Binary;
import fr.mobdev.lpcprog.objects.Server; 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> { public class BinariesAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
private static final int SECTION = 0; private static final int SECTION = 0;

View File

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

View File

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

View File

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

View File

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

View File

@ -48,6 +48,9 @@ import fr.mobdev.lpcprog.objects.Server;
import fr.mobdev.lpcprog.objects.USBDevice; import fr.mobdev.lpcprog.objects.USBDevice;
import fr.mobdev.lpcprog.managers.UsbCommManager; 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 { public class DeviceFragment extends Fragment {
private UsbCommManager comm; private UsbCommManager comm;

View File

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

View File

@ -36,8 +36,8 @@ import fr.mobdev.lpcprog.managers.DatabaseManager;
import fr.mobdev.lpcprog.objects.Server; 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 { public class ServersFragment extends Fragment {
private ServerListener serverListener; private ServerListener serverListener;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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