Initial commit

parents
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<Objective-C-extensions>
<file>
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Import" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Macro" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Typedef" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Enum" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Constant" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Global" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Struct" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="FunctionPredecl" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Function" />
</file>
<class>
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Property" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Synthesize" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InitMethod" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="StaticMethod" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InstanceMethod" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="DeallocMethod" />
</class>
<extensions>
<pair source="cpp" header="h" fileNamingConvention="NONE" />
<pair source="c" header="h" fileNamingConvention="NONE" />
</extensions>
</Objective-C-extensions>
</code_scheme>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<compositeConfiguration>
<compositeBuild compositeDefinitionSource="SCRIPT" />
</compositeConfiguration>
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="resolveModulePerSourceSet" value="false" />
</GradleProjectSettings>
</option>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
</set>
</option>
</component>
</project>
\ No newline at end of file
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 28
defaultConfig {
applicationId "project.pos.app"
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'de.hdodenhof:circleimageview:2.0.0'
implementation 'com.google.firebase:firebase-database:16.0.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
{
"project_info": {
"project_number": "835079411385",
"firebase_url": "https://posapp-c82bb.firebaseio.com",
"project_id": "posapp-c82bb",
"storage_bucket": "posapp-c82bb.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:835079411385:android:7ed4c87b989b1de7",
"android_client_info": {
"package_name": "project.pos.app"
}
},
"oauth_client": [
{
"client_id": "835079411385-1n173ofrqrkcljnipldohnmb3sd7tpfd.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "project.pos.app",
"certificate_hash": "1580a15f626475213e9dd530483edbfa0946b0f3"
}
},
{
"client_id": "835079411385-ljr0nv9g6u4qq5gkq6fjjfmiugepe88s.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyDxcpTcIlIAU5dWImPsOPcKCA9qa3xQwEE"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "835079411385-ljr0nv9g6u4qq5gkq6fjjfmiugepe88s.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
}
],
"configuration_version": "1"
}
\ No newline at end of file
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
package project.pos.app;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("project.pos.app", appContext.getPackageName());
}
}
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="project.pos.app">
<uses-permission
android:name="android.permission.INTERNET"
android:required="true"/>
<uses-permission
android:name="android.permission.ACCESS_WIFI_STATE"
android:required="true"/>
<uses-permission
android:name="android.permission.ACCESS_NETWORK_STATE"
android:required="true"/>
<uses-permission
android:name="android.permission.CHANGE_WIFI_STATE"
android:required="true"/>
<application
android:allowBackup="true"
android:icon="@mipmap/blucon"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".activities.Home" />
<activity
android:name=".activities.CartActivity"
android:label="@string/action_cart" />
<activity
android:name=".activities.ServiceActivity"
android:theme="@style/AppTheme.SplashTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".activities.BillActivity"
android:label="@string/bill">
</activity>
<activity android:name=".activities.DetailActivity"></activity>
</application>
</manifest>
\ No newline at end of file
package project.pos.app.activities;
import android.content.Intent;
import android.support.annotation.LayoutRes;
import android.support.design.widget.NavigationView;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.MenuItem;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.Toast;
import project.pos.app.R;
public abstract class BaseActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener {
private static final String LOG_TAG = Home.class.getSimpleName();
private DrawerLayout fullLayout;
private Toolbar toolbar;
private ActionBarDrawerToggle drawerToggle;
private NavigationView navigationView;
@Override
public void setContentView(@LayoutRes int layoutResID) {
fullLayout = (DrawerLayout) getLayoutInflater().inflate(R.layout.activity_base, null);
FrameLayout activityContainer = (FrameLayout) fullLayout.findViewById(R.id.activity_content);
getLayoutInflater().inflate(layoutResID, activityContainer, true);
super.setContentView(fullLayout);
toolbar = (Toolbar) findViewById(R.id.toolbar);
navigationView = (NavigationView) findViewById(R.id.navigationView);
setSupportActionBar(toolbar);
View header = navigationView.getHeaderView(0);
View navView = header.findViewById(R.id.nav_main_layout);
navView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(getApplicationContext(), "Clicked", Toast.LENGTH_SHORT).show();
}
});
setUpNavView();
}
protected void setUpNavView() {
navigationView.setNavigationItemSelectedListener(this);
if (useDrawerToggle()) {
drawerToggle = new ActionBarDrawerToggle(this, fullLayout, toolbar,
R.string.navigation_drawer_open,
R.string.navigation_drawer_close);
fullLayout.addDrawerListener(drawerToggle);
drawerToggle.syncState();
} else if (useToolbar() && getSupportActionBar() != null) {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setTitle(getActionBarTitle());
}
}
protected boolean useToolbar() {
return true;
}
protected boolean useDrawerToggle() {
return true;
}
@Override
public boolean onNavigationItemSelected(MenuItem item) {
int id = item.getItemId();
if (id == R.id.nav_menu) {
if (this instanceof Home) {
fullLayout.closeDrawer(GravityCompat.START);
item.setChecked(true);
} else {
Intent intent = new Intent(this, Home.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
item.setChecked(true);
}
} else if (id == R.id.nav_bill) {
startActivity(new Intent(getApplicationContext(), BillActivity.class));
item.setChecked(true);
// } else if (id == R.id.nav_completed) {
// if (this instanceof CompletedTaskListActivity) {
// fullLayout_.closeDrawer(GravityCompat.START);
// item.setChecked(true);
// } else {
// startActivity(new Intent(getApplicationContext(), CompletedTaskListActivity.class));
// item.setChecked(true);
// }
}
fullLayout.closeDrawer(GravityCompat.START);
return true;
}
protected abstract String getActionBarTitle();
}
package project.pos.app.activities;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import java.util.ArrayList;
import java.util.List;
import project.pos.app.R;
import project.pos.app.adapters.BillAdapter;
import project.pos.app.object.Item;
public class BillActivity extends BaseActivity {
private RecyclerView recyclerView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_bill);
recyclerView = (RecyclerView) findViewById(R.id.billRecyclerView);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.setAdapter(new BillAdapter(this, getBillData()));
}
private List<Item> getBillData() {
return null;
}
@Override
protected String getActionBarTitle() {
return null;
}
}
package project.pos.app.activities;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.Button;
import java.util.ArrayList;
import java.util.List;
import project.pos.app.R;
import project.pos.app.adapters.CartAdapter;
import project.pos.app.object.Item;
public class CartActivity extends BaseActivity implements View.OnClickListener {
private RecyclerView recyclerView;
private Button placeOrderButton;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_cart);
placeOrderButton = (Button) findViewById(R.id.placeOrderButton);
recyclerView = (RecyclerView) findViewById(R.id.cartRecyclerView);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.setAdapter(new CartAdapter(this, getCartData()));
placeOrderButton.setOnClickListener(this);
}
private List<Item> getCartData() {
return null;
}
@Override
protected String getActionBarTitle() {
return null;
}
@Override
public void onClick(View v) {
startActivity(new Intent(this, BillActivity.class));
}
}
package project.pos.app.activities;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import project.pos.app.R;
public class DetailActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_detail);
}
}
package project.pos.app.activities;
import android.content.Intent;
import android.graphics.Color;
import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.Toast;
import project.pos.app.R;
import project.pos.app.adapters.FragmentAdapter;
import project.pos.app.adapters.RecyclerViewAdapter;
public class Home extends BaseActivity implements RecyclerViewAdapter.ItemSelected {
public static final int ITEMS = 10;
private FragmentAdapter fragmentAdapter;
private ViewPager viewPager;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState) ;
setContentView(R.layout.activity_home);
fragmentAdapter = new FragmentAdapter(getSupportFragmentManager());
viewPager = (ViewPager) findViewById(R.id.pager);
viewPager.setAdapter(fragmentAdapter);
TabLayout tabLayout = (TabLayout) findViewById(R.id.tabLayout);
tabLayout.setTabMode(TabLayout.MODE_SCROLLABLE);
tabLayout.setSelectedTabIndicatorColor(Color.WHITE);
tabLayout.setupWithViewPager(viewPager);
}
@Override
protected String getActionBarTitle() {
return "";
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
if (id == R.id.action_cart) {
startActivity(new Intent(this, CartActivity.class));
return true;
}
return super.onOptionsItemSelected(item);
}
@Override
public void onItemSelected() {
Toast.makeText(this, "Cart Count Listener",Toast.LENGTH_SHORT).show();
}
}
package project.pos.app.activities;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.Intent;
import android.net.nsd.NsdManager;
import android.net.nsd.NsdServiceInfo;
import android.os.Build;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.IOException;
import java.io.PrintWriter;
import java.net.Socket;
import java.util.ArrayList;
import project.pos.app.R;
import project.pos.app.client.ClientSocket;
import project.pos.app.client.ClientThread;
public class ServiceActivity extends AppCompatActivity {
private static final String LOG_TAG = ServiceActivity.class.getSimpleName();
private Button button;
private ArrayList<NsdServiceInfo> serviceInfos_ = new ArrayList<>();
private NsdManager nsdManager_;
private NsdManager.DiscoveryListener discoveryListener_;
private NsdManager.ResolveListener resolveListener_;
private Socket socket_;
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
@Override
protected void onCreate(Bundle savedInstanceState) {
setTheme(R.style.AppTheme);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_service);
button = (Button) findViewById(R.id.serviceButton);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(getApplicationContext(), Home.class));
}
});
nsdManager_ = (NsdManager) this.getSystemService(Context.NSD_SERVICE);
initializeDiscoveryListener();
nsdManager_.discoverServices("_http._tcp.", NsdManager.PROTOCOL_DNS_SD, discoveryListener_);
}
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
private void initializeDiscoveryListener() {
discoveryListener_ = new NsdManager.DiscoveryListener() {
@Override
public void onStartDiscoveryFailed(String serviceType, int errorCode) {
Log.d(LOG_TAG, "serviceDiscovery initialization failed");
}
@Override
public void onStopDiscoveryFailed(String serviceType, int errorCode) {
Log.d(LOG_TAG, "serviceDiscovery stop failed");
}
@Override
public void onDiscoveryStarted(String serviceType) {
Log.d(LOG_TAG, "serviceDiscovery Started");
}
@Override
public void onDiscoveryStopped(String serviceType) {
Log.d(LOG_TAG, "serviceDiscovery Stopped");
}
@Override
public void onServiceFound(final NsdServiceInfo serviceInfo) {
Log.d(LOG_TAG, "New Service has been found on the network with " + serviceInfo.getServiceName());
nsdManager_.resolveService(serviceInfo, new NsdManager.ResolveListener() {
@Override
public void onResolveFailed(NsdServiceInfo serviceInfo, int errorCode) {
Toast.makeText(getApplicationContext(), "Failed to connect", Toast.LENGTH_SHORT).show();
}
@Override
public void onServiceResolved(NsdServiceInfo serviceInfo) {
Log.d(LOG_TAG, "Resolve Succeeded. " + serviceInfo);
try {
socket_ = new Socket(serviceInfo.getHost(), serviceInfo.getPort());
ClientSocket.setClientSocket_(socket_);
ClientThread clientThread = new ClientThread(ClientSocket.getClientSocket_());
clientThread.start();
JSONObject itemObject = new JSONObject();
JSONObject itemData = new JSONObject();
itemObject.put("code", 106);
itemData.put("data", "");
itemObject.put("data", itemData);
PrintWriter printWriter = new PrintWriter(socket_.getOutputStream(), true);
printWriter.println(itemObject.toString());
JSONObject menuObject = new JSONObject();
JSONObject menuData = new JSONObject();
menuObject.put("code", 100);
menuData.put("data", "");
menuObject.put("data", menuData);
printWriter.println(menuObject.toString());
} catch (IOException e) {
e.printStackTrace();
} catch (JSONException e) {
e.printStackTrace();
}
Toast.makeText(getApplicationContext(), serviceInfo.getHost() + " : " + serviceInfo.getPort(), Toast.LENGTH_SHORT).show();
}
});
}
public void onServiceLost(NsdServiceInfo serviceInfo) {
Log.d(LOG_TAG, "Service has been lost on the network with " + serviceInfo.getServiceName());
}
};
}
}
package project.pos.app.adapters;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import java.util.ArrayList;
import java.util.List;
import project.pos.app.R;
import project.pos.app.object.Item;
public class BillAdapter extends RecyclerView.Adapter {
private Context context_;
private List<Item> itemList_ = new ArrayList<>();
private LayoutInflater inflater_;
public BillAdapter(Context context, List<Item> items) {
context_ = context;
inflater_ = LayoutInflater.from(context_);
itemList_ = items;
}
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view ;
switch (viewType) {
case 1: view = inflater_.inflate(R.layout.bill_list_content, parent, false);
return new CustomViewHolder(view);
case 2: view = inflater_.inflate(R.layout.bill_total_content, parent, false);
return new FooterViewHolder(view);
default:return null;
}
}
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
if (holder instanceof CustomViewHolder) {
CustomViewHolder viewHolder = (CustomViewHolder) holder;
viewHolder.itemNameView.setText(itemList_.get(position).getItemName());
} else {
FooterViewHolder viewHolder = (FooterViewHolder) holder;
}
}
@Override
public int getItemViewType(int position) {
int viewType;
if (position == itemList_.size()-1){
viewType = 2;
} else {
viewType = 1;
}
return viewType;
}
@Override
public int getItemCount() {
return itemList_ != null ? itemList_.size() : 0;
}
public static class CustomViewHolder extends RecyclerView.ViewHolder {
private final View view;
private final TextView itemNameView;
private final TextView orderIdView;
private final TextView quantityView;
private final TextView itemPriceView;
public CustomViewHolder(View itemView) {
super(itemView);
view = itemView;
itemNameView = (TextView) itemView.findViewById(R.id.item_name);
orderIdView = (TextView) itemView.findViewById(R.id.orderId);
quantityView = (TextView) itemView.findViewById(R.id.quantity);
itemPriceView = (TextView) itemView.findViewById(R.id.item_price);
}
}
public static class FooterViewHolder extends RecyclerView.ViewHolder {
private View view;
private TextView subTotalView;
private TextView subTotalTaxView;
private TextView totalView;
public FooterViewHolder(View itemView) {
super(itemView);
view = itemView;
subTotalView = (TextView) itemView.findViewById(R.id.subTotalView);
subTotalTaxView = (TextView) itemView.findViewById(R.id.subTotalTaxView);
totalView = (TextView) itemView.findViewById(R.id.totalView);
}
}
}
\ No newline at end of file
package project.pos.app.adapters;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import java.util.List;
import project.pos.app.R;
import project.pos.app.object.Item;
public class CartAdapter extends RecyclerView.Adapter<CartAdapter.CustomViewHolder> {
private Context context_;
private List<Item> itemList_;
private LayoutInflater inflater_;
public CartAdapter(Context context, List<Item> items) {
context_ = context;
inflater_ = LayoutInflater.from(context_);
itemList_ = items;
}
@Override
public CartAdapter.CustomViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = inflater_.inflate(R.layout.cart_list_content, parent, false);
return new CartAdapter.CustomViewHolder(view);
}
@Override
public void onBindViewHolder(final CustomViewHolder holder, final int position) {
// holder.itemTitleView.setText(itemList_.get(position).getTitle());
// int price = itemList_.get(position).getQuantity() * itemList_.get(position).getPrice_();
// holder.priceView.setText(String.valueOf(price));
// final int[] quantity = {itemList_.get(position).getQuantity()};
//
// holder.addButton.setOnClickListener(new View.OnClickListener() {
//
// @Override
// public void onClick(View v) {
// quantity[0] += 1;
// holder.productQty.setText(String.valueOf(quantity[0]));
// }
// });
//
// holder.removeButton.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View v) {
// if (quantity[0] >0) {
// quantity[0] = quantity[0] - 1;
// holder.productQty.setText(String.valueOf(quantity[0]));
// }
// }
// });
}
private void delete(int position) {
itemList_.remove(position);
notifyItemRemoved(position);
Toast.makeText(context_, "Item removed", Toast.LENGTH_SHORT).show();
}
@Override
public int getItemCount() {
return itemList_ != null ? itemList_.size() : 0;
}
public class CustomViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
private final View view;
private TextView itemTitleView;
private TextView priceView;
private Button deleteButton;
private final ImageView removeButton;
private final ImageView addButton;
private final TextView productQty;
public CustomViewHolder(View itemView) {
super(itemView);
view = itemView;
itemTitleView = (TextView) itemView.findViewById(R.id.item_title);
priceView = (TextView) itemView.findViewById(R.id.price);
deleteButton = (Button) itemView.findViewById(R.id.deleteButton);
removeButton = (ImageView) itemView.findViewById(R.id.removeButton);
addButton = (ImageView) itemView.findViewById(R.id.addButton);
productQty = (TextView) itemView.findViewById(R.id.product_quantity);
deleteButton.setOnClickListener(this);
}
@Override
public void onClick(View v) {
delete(getAdapterPosition());
}
}
}
\ No newline at end of file
package project.pos.app.adapters;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.support.v4.app.ListFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import project.pos.app.fragments.CocktailsFragment;
import project.pos.app.fragments.NonAlcoholicFragment;
import project.pos.app.fragments.PitchersFragment;
import project.pos.app.fragments.RegularsFragment;
import project.pos.app.fragments.ShotsFragment;
public class FragmentAdapter extends FragmentStatePagerAdapter {
public FragmentAdapter(FragmentManager fm) {
super(fm);
}
@Override
public Fragment getItem(int position) {
Fragment fragment = null;
switch (position) {
case 0: fragment = new ShotsFragment();
break;
case 1: fragment = new CocktailsFragment();
break;
case 2: fragment = new PitchersFragment();
break;
case 3: fragment = new RegularsFragment();
break;
case 4: fragment = new NonAlcoholicFragment();
break;
}
return fragment;
}
@Override
public int getCount() {
return 5;
}
@Override
public CharSequence getPageTitle(int position) {
String title = "";
switch (position) {
case 0: title = "Shots";
break;
case 1: title = "CockTails";
break;
case 2: title = "Pitchers";
break;
case 3: title = "Regulars";
break;
case 4: title = "Non-Alcoholic";
break;
}
return title;
}
}
package project.pos.app.adapters;
import android.content.Context;
import android.content.Intent;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import java.util.ArrayList;
import java.util.List;
import project.pos.app.R;
import project.pos.app.activities.DetailActivity;
import project.pos.app.object.Item;
public class RecyclerViewAdapter extends RecyclerView.Adapter<RecyclerViewAdapter.CustomViewHolder> {
private Context context_;
private ItemSelected itemSelected_;
private List<Item> itemList_;
private LayoutInflater inflater_;
private List<Item> selectedList_ = new ArrayList<>();
public RecyclerViewAdapter(Context context, List<Item> items, ItemSelected itemSelected) {
context_ = context;
inflater_ = LayoutInflater.from(context_);
itemList_ = items;
itemSelected_ = itemSelected;
}
public interface ItemSelected {
void onItemSelected();
}
@Override
public CustomViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = inflater_.inflate(R.layout.item_list_content, parent, false);
return new CustomViewHolder(view);
}
@Override
public void onBindViewHolder(final CustomViewHolder holder, final int position) {
final int[] quantity = {0};
holder.itemName.setText(itemList_.get(position).getItemName());
if(itemList_.get(position).getDescription() != null) {
holder.description.setText(itemList_.get(position).getDescription());
} else {
holder.description.setText(context_.getResources().getString(R.string.no_description));
}
holder.addButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
quantity[0] += 1;
holder.productQty.setText(String.valueOf(quantity[0]));
itemSelected_.onItemSelected();
}
});
holder.removeButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (quantity[0] >0) {
quantity[0] = quantity[0] - 1;
holder.productQty.setText(String.valueOf(quantity[0]));
}
}
});
holder.view.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(context_, DetailActivity.class);
// intent.putExtra(TaskDetailActivity.EXTRA_TASK_ID, viewHolder.taskListResponse.getTaskId());
context_.startActivity(intent);
}
});
}
@Override
public int getItemCount() {
return itemList_ != null ? itemList_.size(): 0;
}
public static class CustomViewHolder extends RecyclerView.ViewHolder {
private final View view;
private final TextView itemName;
private final TextView description;
private final ImageView removeButton;
private final ImageView addButton;
private final TextView productQty;
public CustomViewHolder(View itemView) {
super(itemView);
view = itemView;
itemName = (TextView) itemView.findViewById(R.id.itemName);
description = (TextView) itemView.findViewById(R.id.description);
removeButton = (ImageView) itemView.findViewById(R.id.removeButton);
addButton = (ImageView) itemView.findViewById(R.id.addButton);
productQty = (TextView) itemView.findViewById(R.id.product_quantity);
}
}
}
package project.pos.app.adapters;
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.ArrayList;
import java.util.List;
import project.pos.app.object.ServiceCard;
public class ServiceCardAdapter extends ArrayAdapter<ServiceCard> {
private static final String TAG = "CardArrayAdapter";
private List<ServiceCard> cardList = new ArrayList<ServiceCard>();
static class CardViewHolder {
TextView line1;
TextView line2;
}
public ServiceCardAdapter(Context context, int textViewResourceId) {
super(context, textViewResourceId);
}
@Override
public void add(ServiceCard serviceCard) {
cardList.add(serviceCard);
super.add(serviceCard);
}
@Override
public int getCount() {
return cardList.size();
}
@Override
public ServiceCard getItem(int index) {
return cardList.get(index);
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View row = convertView;
CardViewHolder viewHolder;
// if (row == null) {
// LayoutInflater inflater = (LayoutInflater) this.getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
// row = inflater.inflate(R.layout.list_item_card, parent, false);
// viewHolder = new CardViewHolder();
//// viewHolder.line1 = (TextView) row.findViewById(R.id.line1);
//// viewHolder.line2 = (TextView) row.findViewById(R.id.line2);
// row.setTag(viewHolder);
// } else {
// viewHolder = (CardViewHolder) row.getTag();
// }
// ServiceCard serviceCard = getItem(position);
// viewHolder.line1.setText(serviceCard.getIpAddress());
// viewHolder.line2.setText(String.valueOf(serviceCard.getPort()));
return row;
}
}
package project.pos.app.client;
import java.net.Socket;
public class ClientSocket {
private static Socket clientSocket_;
public static void setClientSocket_(Socket clientSocket_) {
ClientSocket.clientSocket_ = clientSocket_;
}
public static Socket getClientSocket_() {
return clientSocket_;
}
}
package project.pos.app.client;
import android.util.Log;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.Socket;
import project.pos.app.object.Response;
import project.pos.app.responsehandlers.RequestHandler;
import project.pos.app.responsehandlers.RequestServiceFactory;
public class ClientThread extends Thread {
private final Socket clientSocket_;
public ClientThread(Socket clientSocket) {
clientSocket_ = clientSocket;
}
@Override
public void run() {
try {
BufferedReader bufferedReader = new BufferedReader(
new InputStreamReader(clientSocket_.getInputStream()));
String socketData;
while (clientSocket_.isConnected()) {
while ((socketData = bufferedReader.readLine()) != null) {
JSONObject jsonObject = new JSONObject(socketData);
Log.d("CLIENT_THREAD", jsonObject.toString());
Integer responseCode = jsonObject.getInt("code");
JSONObject responseData = jsonObject.getJSONObject("data");
RequestServiceFactory requestServiceFactory = new RequestServiceFactory(
new Response(responseCode, responseData));
RequestHandler requestHandler = requestServiceFactory.getRequestHandler();
requestHandler.handleRequest(responseData);
}
}
} catch (IOException e) {
e.printStackTrace();
Log.d("socketException", "Exception while getting Input Stream");
} catch (JSONException e) {
e.printStackTrace();
Log.d("jsonException", "Exception is JSON Parsing of Socket Data");
}
Log.d("socket", "Client Socket has been disconnected");
}
}
package project.pos.app.client;
public class ServiceDiscovery {
}
package project.pos.app.datasource;
import java.util.ArrayList;
import project.pos.app.object.Order;
public class BillDataSource {
private static ArrayList<Order> orders = new ArrayList<>();
public static void addOrderToBill(Order order) {
if (!orders.contains(order)) {
orders.add(order);
}
}
public static void removeOrderToBill(Order order) {
if (orders.contains(order)) {
orders.remove(order);
}
}
public static ArrayList<Order> getOrders() {
return orders;
}
}
package project.pos.app.datasource;
import java.util.ArrayList;
import project.pos.app.object.Item;
import project.pos.app.object.ItemType;
public class ItemDataSource {
private static ArrayList<Item> items = new ArrayList<>();
public static void addItem(Item item) {
items.add(item);
}
public static void removeItem(Item item) {
items.remove(item);
}
public static boolean checkItemExist(Item item) {
return items.contains(item);
}
public static ArrayList<Item> getItems() {
return items;
}
public static ArrayList<Item> getItemsOfItemType(ItemType itemType) {
ArrayList<Item> tempItems = new ArrayList<>();
for (Item item : items) {
if (item.getItemType().equals(itemType)) {
tempItems.add(item);
}
}
return tempItems;
}
}
package project.pos.app.datasource;
import java.util.ArrayList;
import project.pos.app.object.ItemType;
public class ItemTypeDataSource {
private static ArrayList<ItemType> itemTypes = new ArrayList<>();
public static void addItemType(ItemType itemType) {
itemTypes.add(itemType);
}
public static void removeItemType(ItemType itemType) {
itemTypes.remove(itemType);
}
public static boolean checkItemTypeExist(ItemType itemType) {
if (itemTypes.contains(itemType)) {
return true;
}
return false;
}
public static ArrayList<ItemType> getItemTypes() {
return itemTypes;
}
}
\ No newline at end of file
package project.pos.app.fragments;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import project.pos.app.R;
/**
* A simple {@link Fragment} subclass.
*/
public class CocktailsFragment extends Fragment {
public CocktailsFragment() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_desserts, container, false);
}
}
package project.pos.app.fragments;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import project.pos.app.R;
/**
* A simple {@link Fragment} subclass.
*/
public class NonAlcoholicFragment extends Fragment {
public NonAlcoholicFragment() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_non_veg, container, false);
}
}
package project.pos.app.fragments;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import project.pos.app.R;
/**
* A simple {@link Fragment} subclass.
*/
public class PitchersFragment extends Fragment {
public PitchersFragment() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_beverage, container, false);
}
}
package project.pos.app.fragments;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import project.pos.app.R;
/**
* A simple {@link Fragment} subclass.
*/
public class RegularsFragment extends Fragment {
public RegularsFragment() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_veg, container, false);
}
}
package project.pos.app.fragments;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.Toast;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.SocketHandler;
import project.pos.app.R;
import project.pos.app.activities.CartActivity;
import project.pos.app.adapters.RecyclerViewAdapter;
import project.pos.app.datasource.ItemDataSource;
import project.pos.app.object.Item;
/**
* A simple {@link Fragment} subclass.
*/
public class ShotsFragment extends Fragment implements View.OnClickListener, RecyclerViewAdapter.ItemSelected {
private static final String LOG_TAG = ShotsFragment.class.getSimpleName();
private RecyclerView recyclerView;
private Button checkOutButton;
public ShotsFragment() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_starter, container, false);
recyclerView = (RecyclerView) view.findViewById(R.id.starterRecyclerView);
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
recyclerView.setAdapter(new RecyclerViewAdapter(getActivity(), getItemList(), this));
checkOutButton = (Button) view.findViewById(R.id.checkOutButton);
checkOutButton.setOnClickListener(this);
return view;
}
private List<Item> getItemList() {
List<Item> itemList = new ArrayList<>();
itemList = ItemDataSource.getItems();
return itemList;
}
@Override
public void onClick(View v) {
startActivity(new Intent(getActivity(), CartActivity.class));
}
@Override
public void onItemSelected() {
checkOutButton.setVisibility(View.VISIBLE);
Toast.makeText(getActivity(), "Item Selected", Toast.LENGTH_SHORT).show();
}
}
package project.pos.app.object;
public class Bill {
private Integer price_;
private double tax_;
private long totalAmount_;
private Order order_;
public Bill(Integer price, double tax, long totalAmount, Order order) {
price_ = price;
tax_ = tax;
totalAmount_ = totalAmount;
order_ = order;
}
public Integer getPrice() {
return price_;
}
public double getTax() {
return tax_;
}
public long getTotalAmount() {
return totalAmount_;
}
public Order getOrder() {
return order_;
}
}
package project.pos.app.object;
public class Item {
private ItemType itemType_;
private String itemName_;
private Integer itemPrice_;
private Integer itemId_;
private double itemTax_;
private String description_;
public Item(ItemType itemType, String itemName, Integer itemPrice, Integer itemId, double itemTax, String description) {
itemType_ = itemType;
itemName_ = itemName;
itemPrice_ = itemPrice;
itemId_ = itemId;
itemTax_ = itemTax;
description_ = description;
}
public ItemType getItemType() {
return itemType_;
}
public String getItemName() {
return itemName_;
}
public Integer getItemPrice() {
return itemPrice_;
}
public Integer getItemId() {
return itemId_;
}
public double getItemTax() {
return itemTax_;
}
public String getDescription() {
return description_;
}
}
package project.pos.app.object;
public class ItemType {
private int itemTypeId_;
private String itemTypeName_;
public ItemType(int itemType, String itemTypeName) {
itemTypeId_ = itemType;
itemTypeName_ = itemTypeName;
}
public int getItemTypeId() {
return itemTypeId_;
}
public String getItemTypeName() {
return itemTypeName_;
}
}
package project.pos.app.object;
public class NewOrder {
private String deviceId_;
private int tableId_;
private String description_;
private int itemId_;
private int quantity_;
public NewOrder(String deviceId, int tableId, String description, int itemId, int quantity) {
deviceId_ = deviceId;
tableId_ = tableId;
description_ = description;
itemId_ = itemId;
quantity_ = quantity;
}
public String getDeviceId() {
return deviceId_;
}
public int getTableId() {
return tableId_;
}
public String getDescription() {
return description_;
}
public int getItemId() {
return itemId_;
}
public int getQuantity() {
return quantity_;
}
}
package project.pos.app.object;
import java.sql.Timestamp;
public class Order {
private Long orderId_;
private String orderDeviceId_;
private String description_;
private Item menuItem_;
private Integer orderStatusId_;
private Integer quantity_;
private Timestamp orderTime_;
private Integer paymentStatusId_;
public Order(Long orderId, String orderDeviceId, String description, Item menuItem,
Integer orderStatusId,
Integer quantity, Timestamp orderTime, Integer paymentStatusId) {
orderId_ = orderId;
orderDeviceId_ = orderDeviceId;
description_ = description;
menuItem_ = menuItem;
orderStatusId_ = orderStatusId;
quantity_ = quantity;
orderTime_ = orderTime;
paymentStatusId_ = paymentStatusId;
}
public Long getOrderId() {
return orderId_;
}
public String getOrderDeviceId() {
return orderDeviceId_;
}
public String getDescription() {
return description_;
}
public Item getMenuItem() {
return menuItem_;
}
public Integer getOrderStatusId() {
return orderStatusId_;
}
public Integer getQuantity() {
return quantity_;
}
public Timestamp getOrderTime() {
return orderTime_;
}
public Integer getPaymentStatusId() {
return paymentStatusId_;
}
}
package project.pos.app.object;
import org.json.JSONObject;
public class Response {
private int responseCode_;
private JSONObject responceData_;
public Response(int responseCode, JSONObject responceData) {
responseCode_ = responseCode;
responceData_ = responceData;
}
public int getResponseCode() {
return responseCode_;
}
public JSONObject getResponceData() {
return responceData_;
}
}
package project.pos.app.object;
public class ServiceCard {
private String ipAddress_;
private int port_;
public ServiceCard(String ipAddress, int port) {
ipAddress_ = ipAddress;
port_ = port;
}
public String getIpAddress() {
return ipAddress_;
}
public int getPort() {
return port_;
}
}
package project.pos.app.responsehandlers;
import android.util.Log;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.sql.Timestamp;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import project.pos.app.datasource.BillDataSource;
import project.pos.app.object.Item;
import project.pos.app.object.ItemType;
import project.pos.app.object.Order;
public class BillRequestHandler implements RequestHandler {
@Override
public void handleRequest(JSONObject jsonObject) {
try {
JSONArray billItemsArray = jsonObject.getJSONArray("bill");
for (int index = 0; index < billItemsArray.length(); index++) {
JSONObject orderObject = billItemsArray.getJSONObject(index);
JSONObject itemJson = orderObject.getJSONObject("item");
JSONObject itemTypeJson = itemJson.getJSONObject("itemType");
ItemType itemType = new ItemType(itemTypeJson.getInt("itemTypeId"),
itemTypeJson.getString("itemType"));
Item item = new Item(itemType, itemJson.getString("itemName"), itemJson.getInt("price"),
itemJson.getInt("itemId"), itemJson.getDouble("tax"), itemJson.getString("description"));
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss.SSS");
Date parsedDate = dateFormat.parse(orderObject.getString("timeStamp"));
Timestamp timestamp = new Timestamp(parsedDate.getTime());
Order order = new Order(orderObject.getLong("orderId"), orderObject.getString("deviceId"),
null, item, null, jsonObject.getInt("quanTity"), timestamp, null);
BillDataSource.addOrderToBill(order);
//adapter.notify();
}
} catch (JSONException e) {
e.printStackTrace();
Log.d("jsonException", "Exception While Getting Bill JSON");
} catch (ParseException e) {
e.printStackTrace();
Log.d("exception", "Exception in Parsing date time formate");
}
}
}
package project.pos.app.responsehandlers;
import android.util.Log;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import project.pos.app.datasource.ItemTypeDataSource;
import project.pos.app.object.ItemType;
public class ItemTypeRequestHandler implements RequestHandler {
@Override
public void handleRequest(JSONObject jsonObject) {
try {
JSONArray itemTypeArray = jsonObject.getJSONArray("itemType");
for (int index = 0; index < itemTypeArray.length(); index++) {
JSONObject itemTypeObject = itemTypeArray.getJSONObject(index);
ItemType itemType = new ItemType(itemTypeObject.getInt("itemTypeId"),
itemTypeObject.getString("itemType"));
ItemTypeDataSource.addItemType(itemType);
}
} catch (JSONException e) {
e.printStackTrace();
Log.d("jsonException", "Exception While Parsing JSON Object");
}
}
}
package project.pos.app.responsehandlers;
import android.util.Log;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import project.pos.app.datasource.ItemDataSource;
import project.pos.app.object.Item;
import project.pos.app.object.ItemType;
public class MenuRequestHandler implements RequestHandler {
@Override
public void handleRequest(JSONObject jsonObject) {
try {
JSONArray menuArray = jsonObject.getJSONArray("menu");
for (int index = 0; index < menuArray.length(); index++) {
JSONObject itemJson = menuArray.getJSONObject(index);
JSONObject itemTypeJson = itemJson.getJSONObject("itemType");
ItemType itemType = new ItemType(itemTypeJson.getInt("itemTypeId"),
itemTypeJson.getString("itemTypeName"));
Item item = new Item(itemType, itemJson.getString("itemName"), itemJson.getInt("itemPrice"),
itemJson.getInt("itemId"), itemJson.getDouble("itemTax"), itemJson.getString("description"));
ItemDataSource.addItem(item);
}
} catch (JSONException e) {
e.printStackTrace();
Log.d("jsonException", "Exception while parsing the Json Object");
}
}
}
package project.pos.app.responsehandlers;
import org.json.JSONObject;
public interface RequestHandler {
void handleRequest(JSONObject jsonObject);
}
package project.pos.app.responsehandlers;
import project.pos.app.object.Response;
public class RequestServiceFactory {
private Response response_;
public RequestServiceFactory(Response response) {
response_ = response;
}
public RequestHandler getRequestHandler() {
switch (response_.getResponseCode()) {
case 103:
return new BillRequestHandler();
case 100:
return new MenuRequestHandler();
case 106:
return new ItemTypeRequestHandler();
default:
return null;
}
}
}
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportHeight="108"
android:viewportWidth="108">
<path
android:fillType="evenOdd"
android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z"
android:strokeColor="#00000000"
android:strokeWidth="1">
<aapt:attr name="android:fillColor">
<gradient
android:endX="78.5885"
android:endY="90.9159"
android:startX="48.7653"
android:startY="61.0927"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0" />
<item
android:color="#00000000"
android:offset="1.0" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z"
android:strokeColor="#00000000"
android:strokeWidth="1" />
</vector>
<?xml version="1.0" encoding="utf-8"?>
<vector
android:height="108dp"
android:width="108dp"
android:viewportHeight="108"
android:viewportWidth="108"
xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#008577"
android:pathData="M0,0h108v108h-108z"/>
<path android:fillColor="#00000000" android:pathData="M9,0L9,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,0L19,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M29,0L29,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M39,0L39,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M49,0L49,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M59,0L59,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M69,0L69,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M79,0L79,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M89,0L89,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M99,0L99,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,9L108,9"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,19L108,19"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,29L108,29"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,39L108,39"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,49L108,49"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,59L108,59"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,69L108,69"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,79L108,79"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,89L108,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,99L108,99"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,29L89,29"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,39L89,39"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,49L89,49"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,59L89,59"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,69L89,69"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,79L89,79"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M29,19L29,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M39,19L39,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M49,19L49,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M59,19L59,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M69,19L69,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M79,19L79,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
</vector>
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:drawable="@android:color/white"/>
<item>
<bitmap
android:gravity="center"
android:src="@drawable/blucon"/>
</item>
</layer-list>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
android:id="@+id/activity_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:fitsSystemWindows="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?actionBarSize"
android:background="?attr/colorPrimary"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"/>
<FrameLayout
android:id="@+id/activity_content"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<android.support.design.widget.NavigationView
android:id="@+id/navigationView"
android:layout_width="wrap_content"
android:fitsSystemWindows="true"
app:headerLayout="@layout/nav_header_main"
android:layout_height="match_parent"
android:layout_gravity="start"
app:menu="@menu/activity_main_drawer"/>
</android.support.v4.widget.DrawerLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".activities.BillActivity">
<android.support.v7.widget.RecyclerView
android:id="@+id/billRecyclerView"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</android.support.v7.widget.RecyclerView>
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".activities.CartActivity">
<android.support.v7.widget.RecyclerView
android:id="@+id/cartRecyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/placeOrderButton">
</android.support.v7.widget.RecyclerView>
<Button
android:id="@+id/placeOrderButton"
android:layout_gravity="bottom"
android:text="Place Order"
android:background="@color/colorPrimary"
android:textColor="@android:color/white"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".activities.DetailActivity">
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
tools:context=".activities.Home">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.design.widget.TabLayout
android:id="@+id/tabLayout"
app:tabGravity="fill"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</android.support.design.widget.AppBarLayout>
<android.support.v4.view.ViewPager
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="1">
</android.support.v4.view.ViewPager>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bg"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".activities.ServiceActivity">
<Button
android:text="Get Started"
android:background="@android:color/white"
android:alpha="0.3"
android:textAllCaps="false"
android:textSize="18sp"
android:id="@+id/serviceButton"
android:textColor="@android:color/black"
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true">
</Button>
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_marginBottom="5dp"
app:cardElevation="2dp"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:padding="@dimen/activity_horizontal_margin"
android:layout_height="wrap_content">
<TextView
android:id="@+id/item_name"
android:layout_width="wrap_content"
android:textAppearance="@style/TextAppearance.AppCompat.Title"
android:layout_height="wrap_content"
android:text="Grilled Chicken"/>
<TextView
android:id="@+id/product_quantity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Qty : 1"
android:layout_below="@+id/item_name"/>
<TextView
android:textAppearance="@style/TextAppearance.AppCompat"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Price : ₹ 99"
android:padding="10dp"
android:id="@+id/item_price"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true">
</TextView>
<TextView
android:textAppearance="@style/TextAppearance.AppCompat"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Tax : ₹ 9"
android:padding="10dp"
android:id="@+id/item_tax"
android:layout_alignBottom="@+id/orderId"
android:layout_alignRight="@+id/item_price"
android:layout_alignEnd="@+id/item_price">
</TextView>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:id="@+id/orderId"
android:text="Order ID: BN1298121"
android:textAppearance="@style/TextAppearance.AppCompat"
android:layout_below="@+id/product_quantity"/>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"></LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_marginBottom="5dp"
app:cardElevation="2dp"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:padding="@dimen/activity_horizontal_margin"
android:orientation="vertical"
android:layout_height="match_parent">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:textAppearance="@style/TextAppearance.AppCompat"
android:layout_width="0dp"
android:layout_weight="0.5"
android:padding="10dp"
android:text="Sub Total"
android:layout_height="wrap_content" />
<TextView
android:layout_gravity="end"
android:id="@+id/subTotalView"
android:text="₹ 99"
android:padding="10dp"
android:textAppearance="@style/TextAppearance.AppCompat"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:textAppearance="@style/TextAppearance.AppCompat"
android:layout_width="0dp"
android:layout_weight="0.5"
android:padding="10dp"
android:text="Total Tax"
android:layout_height="wrap_content" />
<TextView
android:layout_gravity="end"
android:id="@+id/subTotalTaxView"
android:text="₹ 9"
android:padding="10dp"
android:textAppearance="@style/TextAppearance.AppCompat"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:textAppearance="@style/TextAppearance.AppCompat"
android:layout_width="0dp"
android:layout_weight="0.5"
android:padding="10dp"
android:text="Total"
android:layout_height="wrap_content" />
<TextView
android:layout_gravity="end"
android:id="@+id/totalView"
android:text="₹ 108"
android:padding="10dp"
android:textAppearance="@style/TextAppearance.AppCompat"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_marginBottom="5dp"
app:cardElevation="2dp"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:padding="@dimen/activity_horizontal_margin"
android:layout_height="wrap_content">
<TextView
android:id="@+id/item_title"
android:layout_width="wrap_content"
android:textAppearance="@style/TextAppearance.AppCompat.Title"
android:layout_height="wrap_content"
android:text="Grilled Chicken"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="10dp"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true">
<ImageView
android:id="@+id/removeButton"
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@drawable/ic_minus"/>
<TextView
android:id="@+id/product_quantity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|center_horizontal"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:text="0"
android:textSize="12sp"
android:textStyle="bold" />
<ImageView
android:id="@+id/addButton"
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@drawable/ic_plus"/>
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:id="@+id/price"
android:textAppearance="@style/TextAppearance.AppCompat"
android:text="₹ 99"
android:layout_below="@+id/item_title"/>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Button
android:layout_width="match_parent"
android:textColor="@android:color/white"
android:background="@color/colorPrimary"
android:id="@+id/deleteButton"
android:textAllCaps="false"
android:text="Remove"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".fragments.PitchersFragment">
<ImageView
android:layout_width="150dp"
android:layout_height="150dp"
android:id="@+id/img1"
android:text="Cocktail"
android:src="@drawable/cocktail_berry"
android:layout_marginRight="@dimen/activity_vertical_margin"
android:layout_marginLeft="@dimen/activity_vertical_margin"
android:layout_marginTop="@dimen/activity_horizontal_margin"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:id="@+id/txt1"
android:text="Nama :Cocktail Campuran"
android:layout_marginLeft="150dp"
android:layout_marginTop="@dimen/activity_horizontal_margin"
android:textSize="@dimen/activity_horizontal_margin"
android:textStyle="bold"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:id="@+id/txt2"
android:text="Kategori :Cocktail"
android:layout_marginLeft="150dp"
android:layout_marginTop="32dp"
android:textSize="@dimen/activity_horizontal_margin"
android:textStyle="bold"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:id="@+id/txt3"
android:text="Harga : $12.00"
android:layout_marginLeft="150dp"
android:layout_marginTop="48dp"
android:textSize="@dimen/activity_horizontal_margin"
android:textStyle="bold"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:id="@+id/txt4"
android:text="Stok : 15"
android:layout_marginLeft="150dp"
android:layout_marginTop="64dp"
android:textSize="@dimen/activity_horizontal_margin"
android:textStyle="bold"/>
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".fragments.CocktailsFragment">
<!-- TODO: Update blank fragment layout -->
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/hello_blank_fragment" />
</FrameLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".fragments.NonAlcoholicFragment">
<!-- TODO: Update blank fragment layout -->
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/hello_blank_fragment" />
</FrameLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView android:id="@+id/text"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:gravity="center_vertical|center_horizontal"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Hello"/>
<!-- The frame layout is here since we will be showing either
the empty view or the list view. -->
<FrameLayout
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_weight="1" >
<!-- Here is the list. Since we are using a ListActivity, we
have to call it "@android:id/list" so ListActivity will
find it -->
<ListView android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:drawSelectorOnTop="false"/>
<!-- Here is the view to show if the list is emtpy -->
<TextView android:id="@android:id/empty"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="No items."/>
</FrameLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".fragments.ShotsFragment">
<android.support.v7.widget.RecyclerView
android:id="@+id/starterRecyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent">
</android.support.v7.widget.RecyclerView>
<Button
android:visibility="gone"
android:id="@+id/checkOutButton"
android:layout_gravity="bottom"
android:text="Check Out"
android:background="@color/colorPrimary"
android:textColor="@android:color/white"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".fragments.RegularsFragment">
<!-- TODO: Update blank fragment layout -->
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/hello_blank_fragment" />
</FrameLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:cardview="http://schemas.android.com/apk/res-auto"
android:id="@+id/cardView"
android:layout_marginTop="8dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
cardview:cardCornerRadius="4dp"
cardview:cardBackgroundColor="#FFFFFF"
android:clickable="true"
xmlns:android="http://schemas.android.com/apk/res/android">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/itemName"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:textColor="@android:color/primary_text_light"
android:textSize="20sp"
android:padding="10dp"
android:text="Vodka Bluemoon"/>
<TextView
android:id="@+id/description"
android:text="Vodka Malibu blue curacao and pineapple juice(layered) "
android:layout_width="250dp"
android:paddingLeft="10dp"
android:layout_height="wrap_content"
android:layout_below="@+id/itemName" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/quantity"
android:text="₹ 200"
android:padding="10dp"
android:textColor="@android:color/primary_text_light"
android:layout_alignTop="@+id/description"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true">
<ImageView
android:id="@+id/removeButton"
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@drawable/ic_minus"/>
<TextView
android:id="@+id/product_quantity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|center_horizontal"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:text="0"
android:textSize="12sp"
android:textStyle="bold" />
<ImageView
android:id="@+id/addButton"
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@drawable/ic_plus"/>
</LinearLayout>
</RelativeLayout>
</android.support.v7.widget.CardView>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/nav_main_layout"
android:layout_width="match_parent"
android:layout_height="160dp"
android:background="@color/colorAccent"
android:gravity="bottom"
android:orientation="horizontal"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:theme="@style/ThemeOverlay.AppCompat.Dark">
<ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="@dimen/activity_vertical_margin"
android:layout_gravity="center_vertical"
android:src="@mipmap/blucon" />
<TextView
android:id="@+id/userNameView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/activity_vertical_margin"
android:text="Blucon"
android:layout_marginLeft="30dp"
android:layout_gravity="center_vertical"
android:textAppearance="@style/TextAppearance.AppCompat.Headline" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<group android:checkableBehavior="single">
<item
android:id="@+id/nav_menu"
android:icon="@drawable/ic_food_grey600_18dp"
android:title="Menu" />
<item
android:id="@+id/nav_bill"
android:icon="@drawable/ic_currency_inr_grey600_18dp"
android:title="Bill"/>
<!--<item-->
<!--android:id="@+id/nav_slideshow"-->
<!--android:icon="@drawable/ic_menu_slideshow"-->
<!--android:title="Schedule" />-->
<!--<item-->
<!--android:id="@+id/nav_manage"-->
<!--android:icon="@drawable/ic_menu_manage"-->
<!--android:title="Profile" />-->
</group>
</menu>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:context="in.blucon.app.MainActivity">
<item
android:id="@+id/action_cart"
android:orderInCategory="100"
android:icon="@drawable/ic_cart_white_18dp"
android:title="@string/action_cart"
app:showAsAction="always" />
</menu>
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
</adaptive-icon>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
</adaptive-icon>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#FF4081</color>
</resources>
<resources>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
<dimen name="fab_margin">16dp</dimen>
<dimen name="appbar_padding_top">8dp</dimen>
</resources>
<resources>
<string name="app_name">POSApp</string>
<string name="navigation_drawer_open">Drawer Open</string>
<string name="navigation_drawer_close">Drawer Closed</string>
<string name="title_activity_main">MainActivity</string>
<string name="action_settings">Settings</string>
<string name="section_format">Hello World from section: %1$d</string>
<!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</string>
<string name="home">Home</string>
<string name="action_cart">Cart</string>
<string name="amount_view">₹%1$s</string>
<string name="orderId_view">Order ID: %1$s</string>
<string name="bill">Bill</string>
<string name="no_description">Description not available</string>
<string-array name="quantity">
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
<item>6</item>
<item>7</item>
<item>8</item>
<item>9</item>
<item>10</item>
</string-array>
</resources>
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
<style name="AppTheme.SplashTheme" parent="AppTheme">
<item name="android:windowBackground">@drawable/splash</item>
</style>
</resources>
package project.pos.app;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
}
\ No newline at end of file
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.2'
classpath 'com.google.gms:google-services:4.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment