-
-
-
-
-
-
\ No newline at end of file
diff --git a/Art/checkout_screen_visble_amount.png b/Art/checkout_screen_visble_amount.png
deleted file mode 100644
index dbb4465..0000000
Binary files a/Art/checkout_screen_visble_amount.png and /dev/null differ
diff --git a/Art/collapsable_header_category.png b/Art/collapsable_header_category.png
deleted file mode 100644
index 74e886f..0000000
Binary files a/Art/collapsable_header_category.png and /dev/null differ
diff --git a/Art/drag_drop_swipe_dismiss.png b/Art/drag_drop_swipe_dismiss.png
deleted file mode 100644
index 34541da..0000000
Binary files a/Art/drag_drop_swipe_dismiss.png and /dev/null differ
diff --git a/Art/empty_cart.png b/Art/empty_cart.png
deleted file mode 100644
index d69dd5a..0000000
Binary files a/Art/empty_cart.png and /dev/null differ
diff --git a/Art/home_screen.png b/Art/home_screen.png
deleted file mode 100644
index bd23c41..0000000
Binary files a/Art/home_screen.png and /dev/null differ
diff --git a/Art/nav_drawer.png b/Art/nav_drawer.png
deleted file mode 100644
index 7d1f5f5..0000000
Binary files a/Art/nav_drawer.png and /dev/null differ
diff --git a/Art/persistance_storage_onrelaunch.png b/Art/persistance_storage_onrelaunch.png
deleted file mode 100644
index a901e4e..0000000
Binary files a/Art/persistance_storage_onrelaunch.png and /dev/null differ
diff --git a/Art/product_category.png b/Art/product_category.png
deleted file mode 100644
index 9e2a814..0000000
Binary files a/Art/product_category.png and /dev/null differ
diff --git a/Art/product_detail.png b/Art/product_detail.png
deleted file mode 100644
index 3b5f79c..0000000
Binary files a/Art/product_detail.png and /dev/null differ
diff --git a/Art/product_detail_from_cart.png b/Art/product_detail_from_cart.png
deleted file mode 100644
index 911471e..0000000
Binary files a/Art/product_detail_from_cart.png and /dev/null differ
diff --git a/Art/product_detail_suggestions.png b/Art/product_detail_suggestions.png
deleted file mode 100644
index 5b835f1..0000000
Binary files a/Art/product_detail_suggestions.png and /dev/null differ
diff --git a/Art/splash.png b/Art/splash.png
deleted file mode 100644
index 6782187..0000000
Binary files a/Art/splash.png and /dev/null differ
diff --git a/Art/visivle_total_amount.png b/Art/visivle_total_amount.png
deleted file mode 100644
index eadd725..0000000
Binary files a/Art/visivle_total_amount.png and /dev/null differ
diff --git a/Art/visivle_total_amount_from_product_detail.png b/Art/visivle_total_amount_from_product_detail.png
deleted file mode 100644
index c834111..0000000
Binary files a/Art/visivle_total_amount_from_product_detail.png and /dev/null differ
diff --git a/ECommerce-App-Android.zip b/ECommerce-App-Android.zip
deleted file mode 100644
index a3fe6a9..0000000
Binary files a/ECommerce-App-Android.zip and /dev/null differ
diff --git a/README.md b/README.md
index cb3f5a3..e0db95c 100644
--- a/README.md
+++ b/README.md
@@ -1,9 +1,6 @@
# Shopping App
This is an Open Sourced full stack E-Commerce App. I started this Project out of cusiosity and absoulutely no vision but now it have evolve to full size Shopping App. This repository holds basic E-commerce App POC which I had created 2 years back. You can download emo App to see what it looks like now. I also have PWA web App for the this project. If you are interested feel free to Ping me.
- # Try the Demo on PlayStore
-
- # https://play.google.com/store/apps/details?id=com.hitesh_sahu.retailapp&hl=en

@@ -11,24 +8,25 @@
#### View Layer
- Single Activity Model with reusable Fragments.
-- Display categories of product (eg Electronic,Furnitures)
-- Display products in a given category (TV,Microwave,Vaccum cleaner)
+- Display categories of product (eg Electronic, Furniture)
+- Display products in a given category (TV,Microwave,Vacuum cleaner)
- Show Product Details.
- Add any product to cart and update total item count and amount.
- Swipe to Dismiss along with Drag-Drop in Shopping List Fragments
- Swipe to dismiss in RecyclerView
-- Store cart list in DB for persistant storage.
+- Store cart list in DB for persistent storage.
- Whats new dialog on new update
+- SignUp Activity shows up the first time
#### Data and Domain Layer
-- Fetch and store list of Products and Categoreis from Mock Server. The Mock server mimic and return product data from real life Flipkart Server.
-- Persistant storage of Shopping List items when User close the App.
+- Fetch and store list of Products and Categories from Mock Server. The Mock server mimic and return product data from real life Flipkart Server.
+- Persistent storage of Shopping List items when User close the App.
- Loading and caching image from actual Flipkart's image URl with help of Glide
- ACRA crash reporting (Planning to Move on Firebase)
- Data Mining with Apriori Algorithm.
-### What Is Not Included (feel free to Ping me if you want complete solution):-
+### What Is Not Included :-
- Back End Web Server with Web API
- Admin Panel
diff --git a/app/.gitignore b/app/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/app/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/app/build.gradle b/app/build.gradle
index e780b13..8ac17f4 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -1,51 +1,52 @@
-/*
- * Copyright (c) 2017. http://hiteshsahu.com- All Rights Reserved
- * Unauthorized copying of this file, via any medium is strictly prohibited
- * If you use or distribute this project then you MUST ADD A COPY OF LICENCE
- * along with the project.
- * Written by Hitesh Sahu , 2017.
- */
-
apply plugin: 'com.android.application'
android {
- compileSdkVersion 30
- buildToolsVersion "30.0.3"
-
+ compileSdkVersion 28
defaultConfig {
applicationId "com.hitesh_sahu.retailshop"
minSdkVersion 14
- targetSdkVersion 30
+ targetSdkVersion 28
+ versionCode 1
+ versionName "1.0"
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
-
buildTypes {
release {
minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
- //Material design
- implementation 'com.google.android.material:material:1.3.0'
- implementation 'androidx.appcompat:appcompat:1.2.0'
- implementation 'androidx.recyclerview:recyclerview:1.2.0'
+ implementation 'com.google.android.material:material:1.4.0' //1.3.0
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+// implementation 'com.android.support:appcompat-v7:28.0.0'
+// implementation 'com.android.support.constraint:constraint-layout:2.0.4'
+
+// implementation 'com.android.support:animated-vector-drawable:28.0.0'
+// implementation 'com.android.support:support-v4:23.2.0'
+
+ implementation 'androidx.appcompat:appcompat:1.3.1' //1.2.0
+ implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.palette:palette:1.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
-
implementation 'com.google.code.gson:gson:2.8.5'
- implementation 'ch.acra:acra:4.8.5'
- compile files('libs/com.google.guava_1.6.0.jar')
- implementation 'com.github.bumptech.glide:glide:3.7.0'
+ implementation 'ch.acra:acra:4.9.0' //4.8.5
+
+ implementation files('libs/com.google.guava_1.6.0.jar')
+
+ implementation 'com.github.bumptech.glide:glide:3.7.0' //4.8.0
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.flaviofaria:kenburnsview:1.0.7'
-
implementation 'com.github.PhilJay:MPAndroidChart:v3.0.2'
//Loading animations
implementation 'com.wang.avi:library:1.0.5'
implementation 'com.nineoldandroids:library:2.4.0'
+ 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'
}
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
new file mode 100644
index 0000000..f1b4245
--- /dev/null
+++ b/app/proguard-rules.pro
@@ -0,0 +1,21 @@
+# 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
diff --git a/app/src/androidTest/java/com/hitesh_sahu/retailapp/RetailAppInstrumentedTest.java b/app/src/androidTest/java/com/hitesh_sahu/retailapp/RetailAppInstrumentedTest.java
new file mode 100644
index 0000000..ed74e14
--- /dev/null
+++ b/app/src/androidTest/java/com/hitesh_sahu/retailapp/RetailAppInstrumentedTest.java
@@ -0,0 +1,28 @@
+package com.hitesh_sahu.retailapp;
+
+import android.content.Context;
+
+import com.hitesh_sahu.retailapp.util.Utils;
+
+import androidx.test.InstrumentationRegistry;
+import androidx.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 Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class RetailAppInstrumentedTest {
+
+ @Test
+ public void checkAppVersion() {
+ Context appContext = InstrumentationRegistry.getTargetContext();
+ assertEquals("1 1.0", Utils.getVersion(appContext));
+ }
+
+}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 9f158c7..753c684 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -1,19 +1,11 @@
-
-
-
-
+
+
+
+
@@ -21,24 +13,26 @@
-
+
+
+
-
+ android:screenOrientation="portrait" />
-
-
+ android:screenOrientation="portrait" />
() {
+ @Override
+ public void onActivityResult(ActivityResult result) {
+ if (result.getResultCode() == Activity.RESULT_OK) {
+ Intent data = result.getData();
+ if (data.getBooleanExtra(SignupActivity.RESULT, false)){
+ PreferenceHelper preferenceHelper = PreferenceHelper.getPreferenceHelperInstance();
+ // Get user signup data
+ preferenceHelper.setString(getApplicationContext(),
+ SignupActivity.USERNAME, data.getStringExtra(SignupActivity.USERNAME));
+ preferenceHelper.setString(getApplicationContext(),
+ SignupActivity.EMAIL, data.getStringExtra(SignupActivity.EMAIL));
+ preferenceHelper.setString(getApplicationContext(),
+ SignupActivity.TEL, data.getStringExtra(SignupActivity.TEL));
+ preferenceHelper.setUserLoggedIn(true, getApplicationContext());
+ }
+ } else {
+ finish();
+ }
+ }
+ }).launch( signupIntent );
+ }
+
+
CenterRepository.getCenterRepository().setListOfProductsInShoppingList(
new TinyDB(getApplicationContext()).getListObject(
PreferenceHelper.MY_CART_LIST_LOCAL, Product.class));
@@ -86,7 +125,7 @@ protected void onCreate(Bundle savedInstanceState) {
checkOutAmount = (TextView) findViewById(R.id.checkout_amount);
checkOutAmount.setSelected(true);
- checkOutAmount.setText(Money.rupees(checkoutAmount).toString());
+ checkOutAmount.setText(Money.toCurrency(checkoutAmount).toString());
offerBanner.setSelected(true);
mDrawerLayout = (DrawerLayout) findViewById(R.id.nav_drawer);
@@ -258,7 +297,7 @@ public void updateCheckOutAmount(BigDecimal amount, boolean increment) {
checkoutAmount = checkoutAmount.subtract(amount);
}
- checkOutAmount.setText(Money.rupees(checkoutAmount).toString());
+ checkOutAmount.setText(Money.toCurrency(checkoutAmount).toString());
}
@Override
@@ -423,7 +462,7 @@ public void onClick(DialogInterface dialog, int id) {
itemCount = 0;
itemCountTextView.setText(String.valueOf(0));
checkoutAmount = new BigDecimal(BigInteger.ZERO);
- checkOutAmount.setText(Money.rupees(checkoutAmount).toString());
+ checkOutAmount.setText(Money.toCurrency(checkoutAmount).toString());
}
});
@@ -441,7 +480,7 @@ public void onClick(DialogInterface dialog, int id) {
public void onDismiss(DialogInterface dialog) {
Snackbar.make(ECartHomeActivity.this.getWindow().getDecorView().findViewById(android.R.id.content)
, "Order Placed Successfully, Happy Shopping !!", Snackbar.LENGTH_LONG)
- .setAction("View Apriori Output", new View.OnClickListener() {
+ .setAction("View Apriori Output", new OnClickListener() {
@Override
public void onClick(View view) {
startActivity(new Intent(ECartHomeActivity.this, APrioriResultActivity.class));
diff --git a/app/src/main/java/com/hitesh_sahu/retailapp/view/activities/SignupActivity.java b/app/src/main/java/com/hitesh_sahu/retailapp/view/activities/SignupActivity.java
new file mode 100644
index 0000000..b21736e
--- /dev/null
+++ b/app/src/main/java/com/hitesh_sahu/retailapp/view/activities/SignupActivity.java
@@ -0,0 +1,258 @@
+package com.hitesh_sahu.retailapp.view.activities;
+
+import android.animation.Animator;
+import android.animation.AnimatorListenerAdapter;
+import android.annotation.TargetApi;
+import android.app.Activity;
+import android.content.Intent;
+import android.content.pm.PackageManager;
+
+import com.google.android.material.snackbar.Snackbar;
+
+import androidx.appcompat.app.ActionBar;
+import androidx.appcompat.app.AppCompatActivity;
+
+import android.app.LoaderManager.LoaderCallbacks;
+
+import android.content.CursorLoader;
+import android.content.Loader;
+import android.database.Cursor;
+import android.net.Uri;
+import android.os.AsyncTask;
+
+import android.os.Build;
+import android.os.Bundle;
+import android.provider.ContactsContract;
+import android.text.TextUtils;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.Window;
+import android.view.WindowManager;
+import android.widget.Button;
+import android.widget.EditText;
+import java.util.ArrayList;
+import java.util.List;
+import com.hitesh_sahu.retailapp.R;
+import com.wang.avi.AVLoadingIndicatorView;
+
+import static android.Manifest.permission.READ_CONTACTS;
+
+/**
+ * A Signup screen that offers signup via username/tel/email.
+ */
+public class SignupActivity extends AppCompatActivity {
+
+ public static final String RESULT = "result";
+
+ // User Information
+ public static final String USERNAME = "username";
+ public static final String EMAIL = "email";
+ public static final String TEL = "tel";
+
+ /**
+ * Keep track of the signup task to ensure we can cancel it if requested.
+ */
+ private UserSignupTask mAuthTask = null;
+
+ // UI references.
+ private EditText mEmailView;
+ private EditText mTelView;
+ private EditText mUsernameView;
+ private AVLoadingIndicatorView mProgressView;
+ private View mSignupFormView;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_signup);
+ // Set up the signup form.
+ mEmailView = findViewById(R.id.email);
+ mTelView = findViewById(R.id.tel);
+ mUsernameView = findViewById(R.id.username);
+
+ Button mSignupButton = findViewById(R.id.signup_button);
+ mSignupButton.setOnClickListener(new OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ attemptRegister();
+ }
+ });
+
+ mSignupFormView = findViewById(R.id.signup_form);
+ mProgressView = findViewById(R.id.signup_progress);
+
+ if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT){
+ Window w = getWindow();
+ w.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
+
+ }
+ try {
+ // Hide the action bar
+ ActionBar ab = getSupportActionBar();
+ ab.hide();
+ } catch (Exception e){}
+ }
+
+ /**
+ * Attempts to sign in or register the account specified by the signup form.
+ * If there are form errors (invalid email, missing fields, etc.), the
+ * errors are presented and no actual signup attempt is made.
+ */
+ private void attemptRegister() {
+ if (mAuthTask != null) {
+ return;
+ }
+
+ // Reset errors.
+ mUsernameView.setError(null);
+ mEmailView.setError(null);
+ mTelView.setError(null);
+
+ // Store values at the time of the signup attempt.
+ String username = mUsernameView.getText().toString().trim();
+ String email = mEmailView.getText().toString().trim();
+ String tel = mTelView.getText().toString().trim();
+
+ boolean cancel = false;
+ View focusView = null;
+
+ // Check for a valid tel, if the user entered one.
+ if (!TextUtils.isEmpty(tel) && !isTelValid(tel)) {
+ mTelView.setError(getString(R.string.error_invalid_data));
+ focusView = mTelView;
+ cancel = true;
+ }
+
+ // Check for user inputs
+ if (TextUtils.isEmpty(email)) {
+ mEmailView.setError(getString(R.string.error_field_required));
+ focusView = mEmailView;
+ cancel = true;
+ } else if (TextUtils.isEmpty(username)) {
+ mUsernameView.setError(getString(R.string.error_field_required));
+ focusView = mUsernameView;
+ cancel = true;
+ } else if (!isEmailValid(email)) {
+ mEmailView.setError(getString(R.string.error_invalid_email));
+ focusView = mEmailView;
+ cancel = true;
+ }
+
+ if (cancel) {
+ // There was an error; don't attempt signup and focus the first
+ // form field with an error.
+ focusView.requestFocus();
+ } else {
+ // Show a progress spinner, and kick off a background task to
+ // perform the user signup attempt.
+ showProgress(true);
+ mAuthTask = new UserSignupTask(username, email, tel);
+ mAuthTask.execute((Void) null);
+ }
+ }
+
+ private boolean isEmailValid(String email) {
+ //TODO: Replace this with your own logic
+ return email.contains("@");
+ }
+
+ private boolean isTelValid(String value) {
+ //TODO: Replace this with your own logic
+ return (value.startsWith("0")) && (value.length() == 10);
+ }
+
+ /**
+ * Shows the progress UI and hides the signup form.
+ */
+ @TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)
+ private void showProgress(final boolean show) {
+ // On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow
+ // for very easy animations. If available, use these APIs to fade-in
+ // the progress spinner.
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {
+ int shortAnimTime = getResources().getInteger(android.R.integer.config_shortAnimTime);
+
+ mSignupFormView.setVisibility(show ? View.GONE : View.VISIBLE);
+ mSignupFormView.animate().setDuration(shortAnimTime).alpha(
+ show ? 0 : 1).setListener(new AnimatorListenerAdapter() {
+ @Override
+ public void onAnimationEnd(Animator animation) {
+ mSignupFormView.setVisibility(show ? View.GONE : View.VISIBLE);
+ }
+ });
+
+ mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);
+// mProgressView.animate().setDuration(shortAnimTime).alpha(
+// show ? 1 : 0).setListener(new AnimatorListenerAdapter() {
+// @Override
+// public void onAnimationEnd(Animator animation) {
+// mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);
+// }
+// });
+ } else {
+ // The ViewPropertyAnimator APIs are not available, so simply show
+ // and hide the relevant UI components.
+ mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);
+ mSignupFormView.setVisibility(show ? View.GONE : View.VISIBLE);
+ }
+ }
+
+
+ /**
+ * Represents an asynchronous registration task used to authenticate
+ * the user.
+ */
+ public class UserSignupTask extends AsyncTask {
+
+ private final String mUsername;
+ private final String mEmail;
+ private final String mTel;
+
+ UserSignupTask(String username, String email, String tel) {
+ mUsername = username;
+ mEmail = email;
+ mTel = tel;
+ }
+
+ @Override
+ protected Boolean doInBackground(Void... params) {
+ // TODO: attempt authentication against a network service.
+
+ try {
+ // Simulate network access.
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ return false;
+ }
+
+ // TODO: register the new account here.
+ return true;
+ }
+
+ @Override
+ protected void onPostExecute(final Boolean success) {
+ mAuthTask = null;
+ showProgress(false);
+ Intent returnIntent = new Intent();
+ returnIntent.putExtra( RESULT, success);
+ if (success) {
+ setResult(RESULT_OK, returnIntent);
+ returnIntent.putExtra( USERNAME, mUsername);
+ returnIntent.putExtra( EMAIL, mEmail);
+ returnIntent.putExtra( TEL, mTel);
+ finish();
+ } else {
+ mTelView.setError(getString(R.string.error_invalid_data));
+ mTelView.requestFocus();
+ setResult(Activity.RESULT_CANCELED, returnIntent);
+ }
+ }
+
+ @Override
+ protected void onCancelled() {
+ mAuthTask = null;
+ showProgress(false);
+ }
+ }
+}
+
diff --git a/app/src/main/java/com/hitesh_sahu/retailapp/view/activities/SplashActivity.java b/app/src/main/java/com/hitesh_sahu/retailapp/view/activities/SplashActivity.java
index d357193..8cc83db 100644
--- a/app/src/main/java/com/hitesh_sahu/retailapp/view/activities/SplashActivity.java
+++ b/app/src/main/java/com/hitesh_sahu/retailapp/view/activities/SplashActivity.java
@@ -1,27 +1,25 @@
-/*
- * Copyright (c) 2017. http://hiteshsahu.com- All Rights Reserved
- * Unauthorized copying of this file, via any medium is strictly prohibited
- * If you use or distribute this project then you MUST ADD A COPY OF LICENCE
- * along with the project.
- * Written by Hitesh Sahu , 2017.
- */
-
package com.hitesh_sahu.retailapp.view.activities;
+import android.app.Activity;
import android.content.Intent;
import android.graphics.Typeface;
import android.os.Bundle;
import android.os.Handler;
+import android.util.Log;
import android.view.animation.Animation;
-import android.view.animation.Animation.AnimationListener;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;
import android.widget.TextView;
-import androidx.fragment.app.FragmentActivity;
-
import com.hitesh_sahu.retailapp.R;
+import com.hitesh_sahu.retailapp.view.activities.ECartHomeActivity;
+import androidx.activity.result.ActivityResult;
+import androidx.activity.result.ActivityResultCallback;
+import androidx.activity.result.ActivityResultLauncher;
+import androidx.activity.result.contract.ActivityResultContracts;
+import androidx.annotation.Nullable;
+import androidx.fragment.app.FragmentActivity;
public class SplashActivity extends FragmentActivity {
@@ -35,19 +33,11 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);
+
logo = (ImageView) findViewById(R.id.logo_img);
appTitle = (TextView) findViewById(R.id.track_txt);
appSlogan = (TextView) findViewById(R.id.pro_txt);
- // Font path
- String fontPath = "font/CircleD_Font_by_CrazyForMusic.ttf";
- // Loading Font Face
- Typeface tf = Typeface.createFromAsset(getAssets(), fontPath);
-
- // Applying font
- appTitle.setTypeface(tf);
- appSlogan.setTypeface(tf);
-
if (savedInstanceState == null) {
flyIn();
}
@@ -61,6 +51,12 @@ public void run() {
}, 3000);
}
+ private void startHomeActivity() {
+ Intent intent = new Intent(getApplicationContext(), ECartHomeActivity.class);
+ startActivity(intent);
+ finish();
+ }
+
private void flyIn() {
animation = AnimationUtils.loadAnimation(this, R.anim.logo_animation);
logo.startAnimation(animation);
@@ -86,13 +82,10 @@ private void endSplash() {
R.anim.pro_animation_back);
appSlogan.startAnimation(animation);
- animation.setAnimationListener(new AnimationListener() {
+ animation.setAnimationListener(new Animation.AnimationListener() {
@Override
- public void onAnimationEnd(Animation arg0) {
-
- Intent intent = new Intent(getApplicationContext(),
- ECartHomeActivity.class);
- startActivity(intent);
+ public void onAnimationEnd(Animation animation) {
+ startHomeActivity();
finish();
}
diff --git a/app/src/main/java/com/hitesh_sahu/retailapp/view/adapter/ProductListAdapter.java b/app/src/main/java/com/hitesh_sahu/retailapp/view/adapter/ProductListAdapter.java
index 6626a37..d663503 100644
--- a/app/src/main/java/com/hitesh_sahu/retailapp/view/adapter/ProductListAdapter.java
+++ b/app/src/main/java/com/hitesh_sahu/retailapp/view/adapter/ProductListAdapter.java
@@ -93,12 +93,12 @@ public void onBindViewHolder(final VersionViewHolder holder,
holder.itemDesc.setText(productList.get(position)
.getItemShortDesc());
- String sellCostString = Money.rupees(
+ String sellCostString = Money.toCurrency(
BigDecimal.valueOf(Long.valueOf(productList.get(position)
.getSellMRP()))).toString()
+ " ";
- String buyMRP = Money.rupees(
+ String buyMRP = Money.toCurrency(
BigDecimal.valueOf(Long.valueOf(productList.get(position)
.getMRP()))).toString();
@@ -308,7 +308,7 @@ public interface OnItemClickListener {
}
class VersionViewHolder extends RecyclerView.ViewHolder implements
- View.OnClickListener {
+ OnClickListener {
TextView itemName, itemDesc, itemCost, availability, quanitity,
addItem, removeItem;
ImageView imagView;
diff --git a/app/src/main/java/com/hitesh_sahu/retailapp/view/adapter/ShoppingListAdapter.java b/app/src/main/java/com/hitesh_sahu/retailapp/view/adapter/ShoppingListAdapter.java
index 84de162..f8b422e 100644
--- a/app/src/main/java/com/hitesh_sahu/retailapp/view/adapter/ShoppingListAdapter.java
+++ b/app/src/main/java/com/hitesh_sahu/retailapp/view/adapter/ShoppingListAdapter.java
@@ -48,7 +48,6 @@
/**
* Simple RecyclerView.Adapter that implements {@link ItemTouchHelperAdapter} to
* respond to move and dismiss events from a
- * {@link android.support.v7.widget.helper.ItemTouchHelper}.
*
* @author Hitesh Sahu (hiteshsahu.com)
*/
@@ -88,12 +87,12 @@ public void onBindViewHolder(final ItemViewHolder holder, final int position) {
holder.itemDesc.setText(productList.get(position).getItemShortDesc());
- String sellCostString = Money.rupees(
+ String sellCostString = Money.toCurrency(
BigDecimal.valueOf(Long.valueOf(productList.get(position)
.getSellMRP()))).toString()
+ " ";
- String buyMRP = Money.rupees(
+ String buyMRP = Money.toCurrency(
BigDecimal.valueOf(Long.valueOf(productList.get(position)
.getMRP()))).toString();
@@ -272,7 +271,7 @@ public interface OnItemClickListener {
* a drag event when touched.
*/
public static class ItemViewHolder extends RecyclerView.ViewHolder
- implements ItemTouchHelperViewHolder, View.OnClickListener {
+ implements ItemTouchHelperViewHolder, OnClickListener {
// public final ImageView handleView;
diff --git a/app/src/main/java/com/hitesh_sahu/retailapp/view/adapter/SimilarProductsPagerAdapter.java b/app/src/main/java/com/hitesh_sahu/retailapp/view/adapter/SimilarProductsPagerAdapter.java
index 5146218..577c901 100644
--- a/app/src/main/java/com/hitesh_sahu/retailapp/view/adapter/SimilarProductsPagerAdapter.java
+++ b/app/src/main/java/com/hitesh_sahu/retailapp/view/adapter/SimilarProductsPagerAdapter.java
@@ -154,7 +154,7 @@ public void onError() {
.get(productCategory).get(position).getItemDetail());
((TextView) itemView.findViewById(R.id.category_discount))
- .setText(Money.rupees(
+ .setText(Money.toCurrency(
BigDecimal.valueOf(Long.valueOf(CenterRepository
.getCenterRepository().getMapOfProductsInCategory()
.get(productCategory).get(position)
diff --git a/app/src/main/java/com/hitesh_sahu/retailapp/view/customview/ViewDragHelper.java b/app/src/main/java/com/hitesh_sahu/retailapp/view/customview/ViewDragHelper.java
index a3b643e..7a727ee 100644
--- a/app/src/main/java/com/hitesh_sahu/retailapp/view/customview/ViewDragHelper.java
+++ b/app/src/main/java/com/hitesh_sahu/retailapp/view/customview/ViewDragHelper.java
@@ -279,7 +279,7 @@ public int getViewVerticalDragRange(View child) {
* the view is already captured; this indicates that a new pointer is trying to take
* control of the view.
*
- *
If this method returns true, a call to {@link #onViewCaptured(android.view.View, int)}
+ *
If this method returns true, a call to {@link #onViewCaptured(View, int)}
* will follow if the capture is successful.
*
* @param child Child the user is attempting to capture
@@ -478,7 +478,7 @@ public int getEdgeSize() {
/**
* Capture a specific child view for dragging within the parent. The callback will be notified
- * but {@link Callback#tryCaptureView(android.view.View, int)} will not be asked permission to
+ * but {@link Callback#tryCaptureView(View, int)} will not be asked permission to
* capture this view.
*
* @param childView Child view to capture
@@ -520,7 +520,7 @@ public int getTouchSlop() {
/**
* The result of a call to this method is equivalent to
- * {@link #processTouchEvent(android.view.MotionEvent)} receiving an ACTION_CANCEL event.
+ * {@link #processTouchEvent(MotionEvent)} receiving an ACTION_CANCEL event.
*/
public void cancel() {
mActivePointerId = INVALID_POINTER;
@@ -735,7 +735,7 @@ public void flingCapturedView(int minLeft, int minTop, int maxLeft, int maxTop)
*
* @param deferCallbacks true if state callbacks should be deferred via posted message.
* Set this to true if you are calling this method from
- * {@link android.view.View#computeScroll()} or similar methods
+ * {@link View#computeScroll()} or similar methods
* invoked as part of layout or drawing.
* @return true if settle is still in progress
*/
@@ -890,8 +890,8 @@ private void saveLastMotion(MotionEvent ev) {
* of the ViewDragHelper's knowledge).
*
*
The state used to report this information is populated by the methods
- * {@link #shouldInterceptTouchEvent(android.view.MotionEvent)} or
- * {@link #processTouchEvent(android.view.MotionEvent)}. If one of these methods has not
+ * {@link #shouldInterceptTouchEvent(MotionEvent)} or
+ * {@link #processTouchEvent(MotionEvent)}. If one of these methods has not
* been called for all relevant MotionEvents to track, the information reported
* by this method may be stale or incorrect.
This depends on internal state populated by
- * {@link #shouldInterceptTouchEvent(android.view.MotionEvent)} or
- * {@link #processTouchEvent(android.view.MotionEvent)}. You should only rely on
+ * {@link #shouldInterceptTouchEvent(MotionEvent)} or
+ * {@link #processTouchEvent(MotionEvent)}. You should only rely on
* the results of this method after all currently available touch data
* has been provided to one of these two methods.
*
@@ -1332,8 +1332,8 @@ public boolean checkTouchSlop(int directions) {
* the required slop threshold.
*
*
This depends on internal state populated by
- * {@link #shouldInterceptTouchEvent(android.view.MotionEvent)} or
- * {@link #processTouchEvent(android.view.MotionEvent)}. You should only rely on
+ * {@link #shouldInterceptTouchEvent(MotionEvent)} or
+ * {@link #processTouchEvent(MotionEvent)}. You should only rely on
* the results of this method after all currently available touch data
* has been provided to one of these two methods.
*
diff --git a/app/src/main/java/com/hitesh_sahu/retailapp/view/fragment/ContactUsFragment.java b/app/src/main/java/com/hitesh_sahu/retailapp/view/fragment/ContactUsFragment.java
index d00b985..3a058aa 100644
--- a/app/src/main/java/com/hitesh_sahu/retailapp/view/fragment/ContactUsFragment.java
+++ b/app/src/main/java/com/hitesh_sahu/retailapp/view/fragment/ContactUsFragment.java
@@ -70,7 +70,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
}
- mToolbar.setNavigationOnClickListener(new View.OnClickListener() {
+ mToolbar.setNavigationOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
((ECartHomeActivity) getActivity()).getmDrawerLayout()
@@ -142,16 +142,16 @@ public void onClick(View v) {
public void onClick(View v) {
final Intent emailIntent = new Intent(
- android.content.Intent.ACTION_SEND);
+ Intent.ACTION_SEND);
emailIntent.setType("text/plain");
emailIntent
.putExtra(
- android.content.Intent.EXTRA_EMAIL,
+ Intent.EXTRA_EMAIL,
new String[]{"hiteshkrsahu@gmail.com"});
emailIntent.putExtra(
- android.content.Intent.EXTRA_SUBJECT,
+ Intent.EXTRA_SUBJECT,
"Hello There");
- emailIntent.putExtra(android.content.Intent.EXTRA_TEXT,
+ emailIntent.putExtra(Intent.EXTRA_TEXT,
"Add Message here");
emailIntent.setType("message/rfc822");
diff --git a/app/src/main/java/com/hitesh_sahu/retailapp/view/fragment/HomeFragment.java b/app/src/main/java/com/hitesh_sahu/retailapp/view/fragment/HomeFragment.java
index 1980ea8..31d8405 100644
--- a/app/src/main/java/com/hitesh_sahu/retailapp/view/fragment/HomeFragment.java
+++ b/app/src/main/java/com/hitesh_sahu/retailapp/view/fragment/HomeFragment.java
@@ -75,7 +75,7 @@ public void onClick(View v) {
.setDisplayHomeAsUpEnabled(true);
toolbar.setNavigationIcon(R.drawable.ic_drawer);
- toolbar.setNavigationOnClickListener(new View.OnClickListener() {
+ toolbar.setNavigationOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
((ECartHomeActivity) getActivity()).getmDrawerLayout()
diff --git a/app/src/main/java/com/hitesh_sahu/retailapp/view/fragment/ProductDetailsFragment.java b/app/src/main/java/com/hitesh_sahu/retailapp/view/fragment/ProductDetailsFragment.java
index 3cf0018..e0cfca6 100644
--- a/app/src/main/java/com/hitesh_sahu/retailapp/view/fragment/ProductDetailsFragment.java
+++ b/app/src/main/java/com/hitesh_sahu/retailapp/view/fragment/ProductDetailsFragment.java
@@ -99,7 +99,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
mToolbar.setTitleTextColor(Color.WHITE);
- mToolbar.setNavigationOnClickListener(new View.OnClickListener() {
+ mToolbar.setNavigationOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
((ECartHomeActivity) getActivity()).getmDrawerLayout()
@@ -485,14 +485,14 @@ public void fillProductData() {
.getMapOfProductsInCategory().get(subcategoryKey).get(productListNumber)
.getItemDetail());
- String sellCostString = Money.rupees(
+ String sellCostString = Money.toCurrency(
BigDecimal.valueOf(Long.valueOf(CenterRepository
.getCenterRepository().getMapOfProductsInCategory()
.get(subcategoryKey).get(productListNumber)
.getSellMRP()))).toString()
+ " ";
- String buyMRP = Money.rupees(
+ String buyMRP = Money.toCurrency(
BigDecimal.valueOf(Long.valueOf(CenterRepository
.getCenterRepository().getMapOfProductsInCategory()
.get(subcategoryKey).get(productListNumber)
@@ -567,13 +567,13 @@ public void onError() {
itemdescription.setText(CenterRepository.getCenterRepository()
.getListOfProductsInShoppingList().get(productListNumber).getItemDetail());
- String sellCostString = Money.rupees(
+ String sellCostString = Money.toCurrency(
BigDecimal.valueOf(Long.valueOf(CenterRepository
.getCenterRepository().getListOfProductsInShoppingList()
.get(productListNumber).getSellMRP()))).toString()
+ " ";
- String buyMRP = Money.rupees(
+ String buyMRP = Money.toCurrency(
BigDecimal.valueOf(Long.valueOf(CenterRepository
.getCenterRepository().getListOfProductsInShoppingList()
.get(productListNumber).getMRP()))).toString();
diff --git a/app/src/main/java/com/hitesh_sahu/retailapp/view/fragment/ProductOverviewFragment.java b/app/src/main/java/com/hitesh_sahu/retailapp/view/fragment/ProductOverviewFragment.java
index 07173b8..a000f48 100644
--- a/app/src/main/java/com/hitesh_sahu/retailapp/view/fragment/ProductOverviewFragment.java
+++ b/app/src/main/java/com/hitesh_sahu/retailapp/view/fragment/ProductOverviewFragment.java
@@ -269,7 +269,7 @@ private void setupViewPager(ViewPager viewPager) {
/*void fillProductMapFromCache() {
String cached_ProductMapJSON = PreferenceHelper
- .getPrefernceHelperInstace().getString(
+ .getPreferenceHelperInstance().getString(
PreferenceHelper.ALL_PRODUCT_LIST_RESPONSE_JSON, null);
if (null != cached_ProductMapJSON) {
@@ -299,7 +299,7 @@ public void onResponse(JSONObject response) {
response.toString()).parse();
PreferenceHelper
- .getPrefernceHelperInstace()
+ .getPreferenceHelperInstance()
.setString(
PreferenceHelper.ALL_PRODUCT_LIST_RESPONSE_JSON,
response.toString());
diff --git a/app/src/main/java/com/hitesh_sahu/retailapp/view/fragment/SettingsFragment.java b/app/src/main/java/com/hitesh_sahu/retailapp/view/fragment/SettingsFragment.java
index f941218..5ac3a8c 100644
--- a/app/src/main/java/com/hitesh_sahu/retailapp/view/fragment/SettingsFragment.java
+++ b/app/src/main/java/com/hitesh_sahu/retailapp/view/fragment/SettingsFragment.java
@@ -79,7 +79,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
}
- mToolbar.setNavigationOnClickListener(new View.OnClickListener() {
+ mToolbar.setNavigationOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
((ECartHomeActivity) getActivity()).getmDrawerLayout()
@@ -91,7 +91,7 @@ public void onClick(View v) {
submitLog = (TextView) rootView.findViewById(R.id.submit_log_txt);
- if (PreferenceHelper.getPrefernceHelperInstace().getBoolean(
+ if (PreferenceHelper.getPreferenceHelperInstance().getBoolean(
getActivity(), PreferenceHelper.SUBMIT_LOGS, true)) {
submitLog.setText("Disable");
@@ -105,17 +105,17 @@ public void onClick(View v) {
@Override
public void onClick(View v) {
- if (PreferenceHelper.getPrefernceHelperInstace()
+ if (PreferenceHelper.getPreferenceHelperInstance()
.getBoolean(getActivity(),
PreferenceHelper.SUBMIT_LOGS, true)) {
PreferenceHelper
- .getPrefernceHelperInstace()
+ .getPreferenceHelperInstance()
.setBoolean(getActivity(),
PreferenceHelper.SUBMIT_LOGS, false);
submitLog.setText("Disable");
} else {
- PreferenceHelper.getPrefernceHelperInstace()
+ PreferenceHelper.getPreferenceHelperInstance()
.setBoolean(getActivity(),
PreferenceHelper.SUBMIT_LOGS, true);
submitLog.setText("Enable");
@@ -213,16 +213,16 @@ public void onClick(View v) {
@Override
public void onClick(View v) {
final Intent emailIntent = new Intent(
- android.content.Intent.ACTION_SEND);
+ Intent.ACTION_SEND);
emailIntent.setType("text/plain");
emailIntent
.putExtra(
- android.content.Intent.EXTRA_EMAIL,
+ Intent.EXTRA_EMAIL,
new String[]{"serveroverloadofficial@gmail.com"});
emailIntent.putExtra(
- android.content.Intent.EXTRA_SUBJECT,
+ Intent.EXTRA_SUBJECT,
"Hello There");
- emailIntent.putExtra(android.content.Intent.EXTRA_TEXT,
+ emailIntent.putExtra(Intent.EXTRA_TEXT,
"Add Message here");
emailIntent.setType("message/rfc822");
diff --git a/app/src/main/java/com/hitesh_sahu/retailapp/view/fragment/WhatsNewDialog.java b/app/src/main/java/com/hitesh_sahu/retailapp/view/fragment/WhatsNewDialog.java
index 8d9434b..9511e4c 100644
--- a/app/src/main/java/com/hitesh_sahu/retailapp/view/fragment/WhatsNewDialog.java
+++ b/app/src/main/java/com/hitesh_sahu/retailapp/view/fragment/WhatsNewDialog.java
@@ -71,16 +71,15 @@ public WhatsNewDialog(final Context context) {
private void show() {
- if (!PreferenceHelper.getPrefernceHelperInstace()
+ if (!PreferenceHelper.getPreferenceHelperInstance()
.getString(mContext, PreferenceHelper.WHATS_NEW_LAST_SHOWN, "0")
.equalsIgnoreCase(Utils.getVersion(mContext))) {
- // This version is new, show only the changes from this version (if
- // available)
+ // This version is new, show only the changes from this version (if available)
show(Utils.getVersion(mContext));
- PreferenceHelper.getPrefernceHelperInstace().setString(
+ PreferenceHelper.getPreferenceHelperInstance().setString(
mContext, PreferenceHelper.WHATS_NEW_LAST_SHOWN,
Utils.getVersion(mContext));
}
diff --git a/app/src/main/res/drawable-hdpi/app_icon.png b/app/src/main/res/drawable-hdpi/app_icon.png
old mode 100644
new mode 100755
index e7b3d60..a2871b0
Binary files a/app/src/main/res/drawable-hdpi/app_icon.png and b/app/src/main/res/drawable-hdpi/app_icon.png differ
diff --git a/app/src/main/res/drawable-mdpi/app_icon.png b/app/src/main/res/drawable-mdpi/app_icon.png
old mode 100644
new mode 100755
index d61c174..29440f1
Binary files a/app/src/main/res/drawable-mdpi/app_icon.png and b/app/src/main/res/drawable-mdpi/app_icon.png differ
diff --git a/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
new file mode 100644
index 0000000..1f6bb29
--- /dev/null
+++ b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/drawable-xhdpi/app_icon.png b/app/src/main/res/drawable-xhdpi/app_icon.png
old mode 100644
new mode 100755
index 791a506..ecb3903
Binary files a/app/src/main/res/drawable-xhdpi/app_icon.png and b/app/src/main/res/drawable-xhdpi/app_icon.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/app_icon.png b/app/src/main/res/drawable-xxhdpi/app_icon.png
old mode 100644
new mode 100755
index 0589c5d..e938ad8
Binary files a/app/src/main/res/drawable-xxhdpi/app_icon.png and b/app/src/main/res/drawable-xxhdpi/app_icon.png differ
diff --git a/app/src/main/res/drawable-xxxhdpi/app_icon.png b/app/src/main/res/drawable-xxxhdpi/app_icon.png
new file mode 100755
index 0000000..b215e4e
Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/app_icon.png differ
diff --git a/app/src/main/res/drawable/app_logo.png b/app/src/main/res/drawable/app_logo.png
new file mode 100755
index 0000000..f55ffbe
Binary files /dev/null and b/app/src/main/res/drawable/app_logo.png differ
diff --git a/app/src/main/res/drawable/ic_login.xml b/app/src/main/res/drawable/ic_login.xml
new file mode 100644
index 0000000..2fc057c
--- /dev/null
+++ b/app/src/main/res/drawable/ic_login.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/round_corner_buttom.xml b/app/src/main/res/drawable/round_corner_buttom.xml
new file mode 100644
index 0000000..e581daa
--- /dev/null
+++ b/app/src/main/res/drawable/round_corner_buttom.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/rounded_corner.xml b/app/src/main/res/drawable/rounded_corner.xml
new file mode 100644
index 0000000..a038ff7
--- /dev/null
+++ b/app/src/main/res/drawable/rounded_corner.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_signup.xml b/app/src/main/res/layout/activity_signup.xml
new file mode 100644
index 0000000..ff2c316
--- /dev/null
+++ b/app/src/main/res/layout/activity_signup.xml
@@ -0,0 +1,111 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_splash.xml b/app/src/main/res/layout/activity_splash.xml
index 19fb114..e70dc4f 100644
--- a/app/src/main/res/layout/activity_splash.xml
+++ b/app/src/main/res/layout/activity_splash.xml
@@ -8,6 +8,7 @@
-->
+ android:fontFamily="casual"/>
diff --git a/app/src/main/res/menu/menu_apriori.xml b/app/src/main/res/menu/menu_apriori.xml
index cdb3432..3e07d68 100644
--- a/app/src/main/res/menu/menu_apriori.xml
+++ b/app/src/main/res/menu/menu_apriori.xml
@@ -9,7 +9,7 @@