diff --git a/.idea/encodings.xml b/.idea/encodings.xml index 97626ba..a2f655c 100644 --- a/.idea/encodings.xml +++ b/.idea/encodings.xml @@ -1,6 +1,7 @@ + \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c18940d..169d99b 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,6 +1,6 @@ + package="org.fontys.trackmyprint"> @@ -19,7 +19,7 @@ - + @@ -28,9 +28,8 @@ - - - + + \ No newline at end of file diff --git a/app/src/main/java/com/example/tmp/trackmyprint/userProcessListActivity.java b/app/src/main/java/com/example/tmp/trackmyprint/userProcessListActivity.java deleted file mode 100644 index d478178..0000000 --- a/app/src/main/java/com/example/tmp/trackmyprint/userProcessListActivity.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.example.tmp.trackmyprint; - -import android.content.Intent; -import android.support.v7.app.AppCompatActivity; -import android.os.Bundle; -import android.view.View; -import android.widget.ImageView; -import android.widget.ListView; - -import java.util.ArrayList; -import java.util.List; - -public class userProcessListActivity extends AppCompatActivity { - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_user_process_list); - - List names = new ArrayList<>(); - - user_process_list_adapter b = new user_process_list_adapter(this, names); - ListView lvuser = (ListView) findViewById(R.id.production_proccess); - lvuser.setAdapter(b); - - ImageView checkIn = (ImageView) findViewById(R.id.check_in_status); - checkIn.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - Intent intent = new Intent(userProcessListActivity.this, nfcActivity.class); - startActivity(intent); - } - }); - - } -} \ No newline at end of file diff --git a/app/src/main/java/com/example/tmp/trackmyprint/user_process_list_adapter.java b/app/src/main/java/com/example/tmp/trackmyprint/user_process_list_adapter.java deleted file mode 100644 index 85834f5..0000000 --- a/app/src/main/java/com/example/tmp/trackmyprint/user_process_list_adapter.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.example.tmp.trackmyprint; - -import android.content.Context; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.ArrayAdapter; -import android.widget.TextView; - -import java.util.List; - -/** - * Created by Farshad on 15-12-2016. - */ - -public class user_process_list_adapter extends ArrayAdapter { - - private Context context; - private List user_processes; - - public user_process_list_adapter(Context context, List proccesses){ - - super(context, R.layout.user_process_item, proccesses); - this.context = context; - this.user_processes = proccesses; - - } - - @Override - public View getView(int position, View convertView, ViewGroup parent) { - - production_proccess pp = user_processes.get(position); - View cv = convertView; - - if(cv == null) { - LayoutInflater i = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); - cv = i.inflate(R.layout.user_process_item, null); - } - TextView title = (TextView) cv.findViewById(R.id.production_proccess_title); - title.setText(pp.name); - return cv; - - } - - - - -} diff --git a/app/src/main/java/com/example/tmp/trackmyprint/MainActivity.java b/app/src/main/java/org/fontys/trackmyprint/MainActivity.java similarity index 94% rename from app/src/main/java/com/example/tmp/trackmyprint/MainActivity.java rename to app/src/main/java/org/fontys/trackmyprint/MainActivity.java index f2a4892..ffe3df0 100644 --- a/app/src/main/java/com/example/tmp/trackmyprint/MainActivity.java +++ b/app/src/main/java/org/fontys/trackmyprint/MainActivity.java @@ -1,4 +1,4 @@ -package com.example.tmp.trackmyprint; +package org.fontys.trackmyprint; import android.content.Intent; import android.os.Bundle; @@ -9,6 +9,7 @@ import android.widget.ListView; import android.widget.TextView; +import org.fontys.trackmyprint.adapters.ProductPhaseListAdapter; import org.fontys.trackmyprint.database.Database; import org.fontys.trackmyprint.database.DatabaseException; import org.fontys.trackmyprint.database.DatabaseListener; @@ -28,7 +29,7 @@ public class MainActivity extends AppCompatActivity implements DatabaseListener { private Employee currentEmployee; - private production_proccess_list_adapter adapter; + private ProductPhaseListAdapter adapter; private ImageButton btnScan; @@ -114,7 +115,7 @@ private void updateGUIPhase(Phase p){ } else { - status.setImageResource(R.drawable.checkedinbtn); + status.setImageResource(R.drawable.checkedin_btn); lblScan.setText("Scan a product"); btnScan.setImageResource(R.color.colorScanButton); @@ -124,7 +125,7 @@ private void updateGUIPhase(Phase p){ public void onClick(View v) { if(getCurrentPhase()!= null){ - Intent intent = new Intent(MainActivity.this, nfcActivity.class); + Intent intent = new Intent(MainActivity.this, NFCActivity.class); startActivity(intent); } } @@ -174,7 +175,7 @@ public void onPhasesInitialized(Map phases) listPhases.addAll(phases.values()); - this.adapter = new production_proccess_list_adapter(this, listPhases); + this.adapter = new ProductPhaseListAdapter(this, listPhases); ListView productionProcessListView = (ListView) findViewById(R.id.production_proccess); productionProcessListView.setAdapter(this.adapter); } diff --git a/app/src/main/java/com/example/tmp/trackmyprint/mapActivity.java b/app/src/main/java/org/fontys/trackmyprint/MapActivity.java similarity index 73% rename from app/src/main/java/com/example/tmp/trackmyprint/mapActivity.java rename to app/src/main/java/org/fontys/trackmyprint/MapActivity.java index eabd849..c4abc7f 100644 --- a/app/src/main/java/com/example/tmp/trackmyprint/mapActivity.java +++ b/app/src/main/java/org/fontys/trackmyprint/MapActivity.java @@ -1,9 +1,9 @@ -package com.example.tmp.trackmyprint; +package org.fontys.trackmyprint; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; -public class mapActivity extends AppCompatActivity { +public class MapActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { diff --git a/app/src/main/java/com/example/tmp/trackmyprint/nfcActivity.java b/app/src/main/java/org/fontys/trackmyprint/NFCActivity.java similarity index 98% rename from app/src/main/java/com/example/tmp/trackmyprint/nfcActivity.java rename to app/src/main/java/org/fontys/trackmyprint/NFCActivity.java index b0baa50..53f0fb7 100644 --- a/app/src/main/java/com/example/tmp/trackmyprint/nfcActivity.java +++ b/app/src/main/java/org/fontys/trackmyprint/NFCActivity.java @@ -1,4 +1,4 @@ -package com.example.tmp.trackmyprint; +package org.fontys.trackmyprint; import android.app.Activity; import android.app.PendingIntent; @@ -17,6 +17,8 @@ import android.widget.TextView; import android.widget.Toast; +import org.fontys.trackmyprint.MainActivity; + import java.io.UnsupportedEncodingException; import java.util.Arrays; @@ -26,7 +28,7 @@ * * @author Ralf Wondratschek */ -public class nfcActivity extends AppCompatActivity { +public class NFCActivity extends AppCompatActivity { public static final String MIME_TEXT_PLAIN = "text/plain"; public static final String TAG = "NfcDemo"; diff --git a/app/src/main/java/com/example/tmp/trackmyprint/printDetails.java b/app/src/main/java/org/fontys/trackmyprint/PrintDetailsActivity.java similarity index 73% rename from app/src/main/java/com/example/tmp/trackmyprint/printDetails.java rename to app/src/main/java/org/fontys/trackmyprint/PrintDetailsActivity.java index 10ca91a..912111e 100644 --- a/app/src/main/java/com/example/tmp/trackmyprint/printDetails.java +++ b/app/src/main/java/org/fontys/trackmyprint/PrintDetailsActivity.java @@ -1,9 +1,9 @@ -package com.example.tmp.trackmyprint; +package org.fontys.trackmyprint; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; -public class printDetails extends AppCompatActivity { +public class PrintDetailsActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { diff --git a/app/src/main/java/com/example/tmp/trackmyprint/production_proccess_list_adapter.java b/app/src/main/java/org/fontys/trackmyprint/adapters/ProductPhaseListAdapter.java similarity index 73% rename from app/src/main/java/com/example/tmp/trackmyprint/production_proccess_list_adapter.java rename to app/src/main/java/org/fontys/trackmyprint/adapters/ProductPhaseListAdapter.java index d503aa8..0ccf4d1 100644 --- a/app/src/main/java/com/example/tmp/trackmyprint/production_proccess_list_adapter.java +++ b/app/src/main/java/org/fontys/trackmyprint/adapters/ProductPhaseListAdapter.java @@ -1,4 +1,4 @@ -package com.example.tmp.trackmyprint; +package org.fontys.trackmyprint.adapters; import android.content.Context; import android.view.LayoutInflater; @@ -8,6 +8,8 @@ import android.widget.ImageButton; import android.widget.TextView; +import org.fontys.trackmyprint.MainActivity; +import org.fontys.trackmyprint.R; import org.fontys.trackmyprint.database.entities.Phase; import java.util.List; @@ -16,9 +18,9 @@ * Created by fhict on 08/12/2016. */ -public class production_proccess_list_adapter extends ArrayAdapter { +public class ProductPhaseListAdapter extends ArrayAdapter { - public production_proccess_list_adapter(Context context, List phases) { + public ProductPhaseListAdapter(Context context, List phases) { super(context, R.layout.production_proccess_item, phases); } @@ -37,18 +39,18 @@ public View getView(int position, View convertView, ViewGroup parent) { public void onClick(View v) { if (MainActivity.getInstance().getCurrentPhase() != pp) { MainActivity.getInstance().setCurrentPhase(pp); - checkIn.setImageResource(R.drawable.icon_user_vink); + checkIn.setImageResource(R.drawable.productphase_checked); } else { MainActivity.getInstance().setCurrentPhase(null); - checkIn.setImageResource(R.drawable.checkinbtn); + checkIn.setImageResource(R.drawable.checkin_btn); } } }); if (MainActivity.getInstance().getCurrentPhase() != pp) { - checkIn.setImageResource(R.drawable.checkinbtn); + checkIn.setImageResource(R.drawable.checkin_btn); } else { - checkIn.setImageResource(R.drawable.icon_user_vink); + checkIn.setImageResource(R.drawable.productphase_checked); } return cv; } diff --git a/app/src/main/java/com/example/tmp/trackmyprint/production_proccess.java b/app/src/main/java/org/fontys/trackmyprint/lib/ProductPhase.java similarity index 64% rename from app/src/main/java/com/example/tmp/trackmyprint/production_proccess.java rename to app/src/main/java/org/fontys/trackmyprint/lib/ProductPhase.java index c62c955..3f28e30 100644 --- a/app/src/main/java/com/example/tmp/trackmyprint/production_proccess.java +++ b/app/src/main/java/org/fontys/trackmyprint/lib/ProductPhase.java @@ -1,4 +1,4 @@ -package com.example.tmp.trackmyprint; +package org.fontys.trackmyprint.lib; import org.fontys.trackmyprint.database.entities.Phase; @@ -6,13 +6,13 @@ * Created by fhict on 08/12/2016. */ -public class production_proccess { +public class ProductPhase { public String name; public String iconName; public Phase phase; - public production_proccess(String name, String iconName, Phase phase) { + public ProductPhase(String name, String iconName, Phase phase) { this.phase = phase; this.name = name; this.name = iconName; diff --git a/app/src/main/res/drawable/checkedinbtn.png b/app/src/main/res/drawable/checkedin_btn.png similarity index 100% rename from app/src/main/res/drawable/checkedinbtn.png rename to app/src/main/res/drawable/checkedin_btn.png diff --git a/app/src/main/res/drawable/checkinbtn.png b/app/src/main/res/drawable/checkin_btn.png similarity index 100% rename from app/src/main/res/drawable/checkinbtn.png rename to app/src/main/res/drawable/checkin_btn.png diff --git a/app/src/main/res/drawable/cutting_solid.png b/app/src/main/res/drawable/cutting_oval.png similarity index 100% rename from app/src/main/res/drawable/cutting_solid.png rename to app/src/main/res/drawable/cutting_oval.png diff --git a/app/src/main/res/drawable/detailsorderbtn.png b/app/src/main/res/drawable/detailsorder_btn.png similarity index 100% rename from app/src/main/res/drawable/detailsorderbtn.png rename to app/src/main/res/drawable/detailsorder_btn.png diff --git a/app/src/main/res/drawable/profileimage.png b/app/src/main/res/drawable/dummy_profileimage.png similarity index 100% rename from app/src/main/res/drawable/profileimage.png rename to app/src/main/res/drawable/dummy_profileimage.png diff --git a/app/src/main/res/drawable/icon_1.png b/app/src/main/res/drawable/orderreceived_oval.png similarity index 100% rename from app/src/main/res/drawable/icon_1.png rename to app/src/main/res/drawable/orderreceived_oval.png diff --git a/app/src/main/res/drawable/packing_solid.png b/app/src/main/res/drawable/packing_oval.png similarity index 100% rename from app/src/main/res/drawable/packing_solid.png rename to app/src/main/res/drawable/packing_oval.png diff --git a/app/src/main/res/drawable/printer_solid.png b/app/src/main/res/drawable/printer_oval.png similarity index 100% rename from app/src/main/res/drawable/printer_solid.png rename to app/src/main/res/drawable/printer_oval.png diff --git a/app/src/main/res/drawable/icon_user_vink.png b/app/src/main/res/drawable/productphase_checked.png similarity index 100% rename from app/src/main/res/drawable/icon_user_vink.png rename to app/src/main/res/drawable/productphase_checked.png diff --git a/app/src/main/res/drawable/quality_control_solid.png b/app/src/main/res/drawable/quality_control_oval.png similarity index 100% rename from app/src/main/res/drawable/quality_control_solid.png rename to app/src/main/res/drawable/quality_control_oval.png diff --git a/app/src/main/res/drawable/shipbtn.png b/app/src/main/res/drawable/ship_btn.png similarity index 100% rename from app/src/main/res/drawable/shipbtn.png rename to app/src/main/res/drawable/ship_btn.png diff --git a/app/src/main/res/drawable/shipped_solid.png b/app/src/main/res/drawable/shipped_oval.png similarity index 100% rename from app/src/main/res/drawable/shipped_solid.png rename to app/src/main/res/drawable/shipped_oval.png diff --git a/app/src/main/res/drawable/startbutton.png b/app/src/main/res/drawable/start_btn.png similarity index 100% rename from app/src/main/res/drawable/startbutton.png rename to app/src/main/res/drawable/start_btn.png diff --git a/app/src/main/res/drawable/view_on_map.png b/app/src/main/res/drawable/view_on_map_btn.png similarity index 100% rename from app/src/main/res/drawable/view_on_map.png rename to app/src/main/res/drawable/view_on_map_btn.png diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index e09b9fe..3657181 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -6,7 +6,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" - tools:context="com.example.tmp.trackmyprint.MainActivity"> + tools:context=".MainActivity"> + tools:context=".MapActivity"> diff --git a/app/src/main/res/layout/activity_nfc.xml b/app/src/main/res/layout/activity_nfc.xml index 984a95a..395eb2c 100644 --- a/app/src/main/res/layout/activity_nfc.xml +++ b/app/src/main/res/layout/activity_nfc.xml @@ -5,7 +5,7 @@ android:id="@+id/activity_nfc" android:layout_width="match_parent" android:layout_height="match_parent" - tools:context="com.example.tmp.trackmyprint.nfcActivity"> + tools:context=".NFCActivity"> + tools:context=".MainActivity"> - - - - - - - - - - - - - - - diff --git a/app/src/main/res/layout/production_proccess_item.xml b/app/src/main/res/layout/production_proccess_item.xml index d165fe3..797a6d1 100644 --- a/app/src/main/res/layout/production_proccess_item.xml +++ b/app/src/main/res/layout/production_proccess_item.xml @@ -33,7 +33,7 @@ android:layout_marginLeft="32dp" /> - - - - - - - - - - - - \ No newline at end of file