Skip to content

Commit

Permalink
Add javadoc, make new .APK for v1.1(Language fix)
Browse files Browse the repository at this point in the history
  • Loading branch information
mapfap committed Dec 24, 2013
1 parent e0ea2db commit f7101d3
Show file tree
Hide file tree
Showing 35 changed files with 177 additions and 4 deletions.
Binary file modified dist/pos.apk
Binary file not shown.
6 changes: 6 additions & 0 deletions src/com/refresh/pos/domain/DateTimeStrategy.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
import java.util.Calendar;
import java.util.Locale;

/**
* A static class, global access for how to handle with date format.
*
* @author Refresh Team
*
*/
public class DateTimeStrategy {

private static Locale locale;
Expand Down
6 changes: 6 additions & 0 deletions src/com/refresh/pos/domain/LanguageController.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
import com.refresh.pos.techicalservices.Database;
import com.refresh.pos.techicalservices.DatabaseContents;

/**
* Saves and loads language preference from database.
*
* @author Refresh Team
*
*/
public class LanguageController {

private static final String DEFAULT_LANGUAGE = "en";
Expand Down
1 change: 1 addition & 0 deletions src/com/refresh/pos/domain/inventory/Inventory.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

/**
* This class is service locater for Product Catalog and Stock.
*
* @author Refresh Team
*
*/
Expand Down
1 change: 1 addition & 0 deletions src/com/refresh/pos/domain/inventory/LineItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

/**
* LineItem of Sale.
*
* @author Refresh Team
*
*/
Expand Down
1 change: 1 addition & 0 deletions src/com/refresh/pos/domain/inventory/Product.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

/**
* Product or item represents the real product in store.
*
* @author Refresh Team
*
*/
Expand Down
6 changes: 6 additions & 0 deletions src/com/refresh/pos/domain/inventory/ProductCatalog.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@

import com.refresh.pos.techicalservices.inventory.InventoryDao;

/**
* Book that keeps list of Product.
*
* @author Refresh Team
*
*/
public class ProductCatalog {

private InventoryDao inventoryDao;
Expand Down
1 change: 1 addition & 0 deletions src/com/refresh/pos/domain/inventory/ProductLot.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

/**
* Lot or bunch of product that import to inventory.
*
* @author Refresh Team
*
*/
Expand Down
6 changes: 6 additions & 0 deletions src/com/refresh/pos/domain/inventory/Stock.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@

import com.refresh.pos.techicalservices.inventory.InventoryDao;

/**
* Import log of ProductLot come in to store.
*
* @author Refresh Team
*
*/
public class Stock {

private InventoryDao inventoryDao;
Expand Down
6 changes: 6 additions & 0 deletions src/com/refresh/pos/domain/sale/Register.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
import com.refresh.pos.techicalservices.NoDaoSetException;
import com.refresh.pos.techicalservices.sale.SaleDao;

/**
* Handles all Sale processes.
*
* @author Refresh Team
*
*/
public class Register {
private static Register instance = null;
private static SaleDao saleDao = null;
Expand Down
7 changes: 6 additions & 1 deletion src/com/refresh/pos/domain/sale/Sale.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@
import com.refresh.pos.domain.inventory.LineItem;
import com.refresh.pos.domain.inventory.Product;


/**
* Sale represents sale operation.
*
* @author Refresh Team
*
*/
public class Sale {

private final int id;
Expand Down
6 changes: 6 additions & 0 deletions src/com/refresh/pos/domain/sale/SaleLedger.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
import com.refresh.pos.techicalservices.NoDaoSetException;
import com.refresh.pos.techicalservices.sale.SaleDao;

/**
* Book that keeps sale record.
*
* @author Refresh Team
*
*/
public class SaleLedger {

private static SaleLedger instance = null;
Expand Down
7 changes: 7 additions & 0 deletions src/com/refresh/pos/techicalservices/AndroidDatabase.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;

/**
* Real database connector, provides all CRUD operation.
* database tables are created here.
*
* @author Refresh Team
*
*/
public class AndroidDatabase extends SQLiteOpenHelper implements Database {

private static final int DATABASE_VERSION = 1;
Expand Down
6 changes: 6 additions & 0 deletions src/com/refresh/pos/techicalservices/Database.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

import java.util.List;

/**
* Interface of CRUD operation.
*
* @author Refresh Team
*
*/
public interface Database {
public List<Object> select(String queryString);
public int insert(String tableName, Object content);
Expand Down
6 changes: 6 additions & 0 deletions src/com/refresh/pos/techicalservices/DatabaseContents.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
package com.refresh.pos.techicalservices;

/**
* Enum for name of tables in database.
*
* @author Refresh Team
*
*/
public enum DatabaseContents {

DATABASE("com.refresh.db1"),
Expand Down
6 changes: 6 additions & 0 deletions src/com/refresh/pos/techicalservices/DatabaseExecutor.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
package com.refresh.pos.techicalservices;

/**
* Uses to directly access to database.
*
* @author Refresh Team
*
*/
public class DatabaseExecutor {

private static Database database;
Expand Down
6 changes: 6 additions & 0 deletions src/com/refresh/pos/techicalservices/Demo.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
import com.refresh.pos.domain.inventory.Inventory;
import com.refresh.pos.domain.inventory.ProductCatalog;

/**
* Reads a demo products from CSV in res/raw/
*
* @author Refresh Team
*
*/
public class Demo {

public static void testProduct(Context context) {
Expand Down
6 changes: 6 additions & 0 deletions src/com/refresh/pos/techicalservices/NoDaoSetException.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
package com.refresh.pos.techicalservices;

/**
* Exception of when trying to getInstance() without inject its DAO.
*
* @author Refresh Team
*
*/
public class NoDaoSetException extends Exception {

private static final long serialVersionUID = 1L;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
import com.refresh.pos.domain.inventory.Product;
import com.refresh.pos.domain.inventory.ProductLot;

/**
* DAO for Inventory.
*
* @author Refresh Team
*
*/
public interface InventoryDao {

int addProduct(Product product);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
import com.refresh.pos.techicalservices.Database;
import com.refresh.pos.techicalservices.DatabaseContents;

/**
* DAO used by android for Inventory.
*
* @author Refresh Team
*
*/
public class InventoryDaoAndroid implements InventoryDao {

private Database database;
Expand Down
6 changes: 6 additions & 0 deletions src/com/refresh/pos/techicalservices/sale/SaleDao.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
import com.refresh.pos.domain.inventory.LineItem;
import com.refresh.pos.domain.sale.Sale;

/**
* DAO for Sale process.
*
* @author Refresh Team
*
*/
public interface SaleDao {

Sale initiateSale(String startTime);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@
import com.refresh.pos.techicalservices.DatabaseContents;



/**
* DAO used by android for Sale process.
*
* @author Refresh Team
*
*/
public class SaleDaoAndroid implements SaleDao {

Database database;
Expand Down
7 changes: 7 additions & 0 deletions src/com/refresh/pos/ui/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@
import com.refresh.pos.ui.sale.ReportFragment;
import com.refresh.pos.ui.sale.SaleFragment;

/**
* This UI loads 3 main pages (Inventory, Sale, Report)
* Makes the UI flow by slide through pages using ViewPager.
*
* @author Refresh Team
*
*/
@SuppressLint("NewApi")
public class MainActivity extends FragmentActivity {

Expand Down
2 changes: 1 addition & 1 deletion src/com/refresh/pos/ui/SplashScreenActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

/**
* This is the first activity page, core-app and database created here.
* Dependency injection happen here.
* Dependency injection happens here.
*
* @author Refresh Team
*
Expand Down
6 changes: 6 additions & 0 deletions src/com/refresh/pos/ui/component/ButtonAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
import android.view.ViewGroup;
import android.widget.SimpleAdapter;

/**
* An adapter for ListView which able to assign a sub-button in each row data.
*
* @author Refresh Team
*
*/
public class ButtonAdapter extends SimpleAdapter {

private List<? extends Map<String, ?>> data;
Expand Down
7 changes: 7 additions & 0 deletions src/com/refresh/pos/ui/component/UpdatableFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

import android.support.v4.app.Fragment;

/**
* Fragment which is able to call update() from other class.
* This is used by Delegation pattern.
*
* @author Refresh Team
*
*/
public abstract class UpdatableFragment extends Fragment {

public abstract void update();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@
import com.refresh.pos.techicalservices.NoDaoSetException;
import com.refresh.pos.ui.component.UpdatableFragment;

/**
* A dialog of adding a Product.
*
* @author Refresh Team
*
*/
@SuppressLint("ValidFragment")
public class AddProductDialogFragment extends DialogFragment {

Expand Down
7 changes: 7 additions & 0 deletions src/com/refresh/pos/ui/inventory/InventoryFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@
import com.refresh.pos.ui.component.ButtonAdapter;
import com.refresh.pos.ui.component.UpdatableFragment;

/**
* UI for Inventory, shows list of Product in the ProductCatalog.
* Also use for a sale process of adding Product into sale.
*
* @author Refresh Team
*
*/
@SuppressLint("ValidFragment")
public class InventoryFragment extends UpdatableFragment {

Expand Down
5 changes: 5 additions & 0 deletions src/com/refresh/pos/ui/inventory/ProductDetailActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
import com.refresh.pos.domain.inventory.Stock;
import com.refresh.pos.techicalservices.NoDaoSetException;

/**
* UI for shows the datails of each Product.
* @author Refresh Team
*
*/
@SuppressLint("NewApi")
public class ProductDetailActivity extends Activity {

Expand Down
6 changes: 6 additions & 0 deletions src/com/refresh/pos/ui/sale/EditFragmentDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
import com.refresh.pos.techicalservices.NoDaoSetException;
import com.refresh.pos.ui.component.UpdatableFragment;

/**
* A dialog for edit a LineItem of sale,
* overriding price or set the quantity.
* @author Refresh Team
*
*/
@SuppressLint("ValidFragment")
public class EditFragmentDialog extends DialogFragment {
private Register register;
Expand Down
5 changes: 5 additions & 0 deletions src/com/refresh/pos/ui/sale/EndPaymentFragmentDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
import com.refresh.pos.techicalservices.NoDaoSetException;
import com.refresh.pos.ui.component.UpdatableFragment;

/**
* A dialog shows the total change and confirmation for Sale.
* @author Refresh Team
*
*/
@SuppressLint("ValidFragment")
public class EndPaymentFragmentDialog extends DialogFragment {

Expand Down
5 changes: 5 additions & 0 deletions src/com/refresh/pos/ui/sale/PaymentFragmentDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
import android.widget.TextView;
import android.widget.Toast;

/**
* A dialog for input a money for sale.
* @author Refresh Team
*
*/
@SuppressLint("ValidFragment")
public class PaymentFragmentDialog extends DialogFragment {

Expand Down
6 changes: 5 additions & 1 deletion src/com/refresh/pos/ui/sale/ReportFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@
import com.refresh.pos.techicalservices.NoDaoSetException;
import com.refresh.pos.ui.component.UpdatableFragment;


/**
* UI for showing sale's record.
* @author Refresh Team
*
*/
public class ReportFragment extends UpdatableFragment {

private SaleLedger saleLedger;
Expand Down
Loading

0 comments on commit f7101d3

Please sign in to comment.