├── .gitignore ├── .idea ├── compiler.xml ├── copyright │ └── profiles_settings.xml ├── gradle.xml ├── misc.xml ├── modules.xml ├── runConfigurations.xml └── vcs.xml ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── aravind │ │ └── foodorderapp │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── aravind │ │ │ └── foodorderapp │ │ │ ├── FoodOrderApplication.java │ │ │ ├── activity │ │ │ └── MainActivity.java │ │ │ ├── adapter │ │ │ └── FoodItemAdapter.java │ │ │ ├── fragment │ │ │ ├── HomeFragment.java │ │ │ └── MenuFragment.java │ │ │ ├── listener │ │ │ └── QuantityChangeListener.java │ │ │ └── model │ │ │ └── FoodItem.java │ └── res │ │ ├── anim │ │ ├── cycle_5.xml │ │ ├── grid_layout_animation.xml │ │ ├── shake.xml │ │ ├── slide_in_bottom.xml │ │ └── splashanim.xml │ │ ├── drawable │ │ ├── animation.png │ │ ├── bg_button.xml │ │ ├── bg_material.png │ │ ├── bg_txt.xml │ │ ├── bottomsheet_bg.xml │ │ ├── circle_shape.png │ │ ├── circleshape.xml │ │ ├── count_circle.xml │ │ ├── dialog_bg.xml │ │ ├── divider.xml │ │ ├── edit_bg.xml │ │ ├── edittext_bg.xml │ │ ├── gradient_spinner.xml │ │ ├── ic_arrow_drop_down.xml │ │ ├── ic_bag.png │ │ ├── ic_cancel.xml │ │ ├── ic_fav.xml │ │ ├── ic_fav_outline.xml │ │ ├── ic_location.xml │ │ ├── ic_minus.xml │ │ ├── ic_name.xml │ │ ├── ic_phone.xml │ │ ├── ic_plus.xml │ │ ├── ic_shopping_cart.xml │ │ ├── ic_vector_back.xml │ │ ├── logo.png │ │ ├── meal2068511640.jpg │ │ ├── pro.png │ │ ├── red.png │ │ ├── rounder_corners.xml │ │ ├── splash_anim.xml │ │ ├── splash_anim1.png │ │ ├── splash_anim2.png │ │ ├── splash_anim3.png │ │ ├── splash_anim4.png │ │ ├── splash_bg.png │ │ ├── splashsmoke.png │ │ ├── tab_selector.xml │ │ ├── text_bg.xml │ │ ├── threes.png │ │ ├── triangle_arrow.xml │ │ └── twos.png │ │ ├── layout │ │ ├── activity_main.xml │ │ ├── fragment_home.xml │ │ ├── fragment_menu.xml │ │ └── solvent_list.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ └── values │ │ ├── anim.xml │ │ ├── color.xml │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── com │ └── aravind │ └── foodorderapp │ └── ExampleUnitTest.java ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .externalNativeBuild 10 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 19 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 46 | 47 | 48 | 49 | 50 | 1.8 51 | 52 | 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ObjectAnimatorDemo 2 | ![ObjectAnimatorDemo](https://raw.githubusercontent.com/aravindrajpalani/ObjectAnimatorDemo/master/app/src/main/res/drawable/animation.png) 3 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 25 5 | buildToolsVersion "25.0.2" 6 | defaultConfig { 7 | applicationId "com.aravind.foodorderapp" 8 | minSdkVersion 16 9 | targetSdkVersion 25 10 | versionCode 1 11 | versionName "1.0" 12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | compile fileTree(dir: 'libs', include: ['*.jar']) 24 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 25 | exclude group: 'com.android.support', module: 'support-annotations' 26 | }) 27 | compile 'com.android.support:appcompat-v7:25.2.0' 28 | compile 'com.android.support:cardview-v7:25.2.0' 29 | 30 | compile 'com.android.support:design:25.2.0' 31 | compile 'com.android.support:recyclerview-v7:25.2.0' 32 | compile 'com.android.support.constraint:constraint-layout:1.0.2' 33 | testCompile 'junit:junit:4.12' 34 | } 35 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in C:\Users\Aravindraj\AppData\Local\Android\Sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Uncomment this to preserve the line number information for 20 | # debugging stack traces. 21 | #-keepattributes SourceFile,LineNumberTable 22 | 23 | # If you keep the line number information, uncomment this to 24 | # hide the original source file name. 25 | #-renamesourcefileattribute SourceFile 26 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/aravind/foodorderapp/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.aravind.foodorderapp; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumentation test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.aravind.foodorderapp", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /app/src/main/java/com/aravind/foodorderapp/FoodOrderApplication.java: -------------------------------------------------------------------------------- 1 | package com.aravind.foodorderapp; 2 | 3 | import android.app.Application; 4 | import android.app.ProgressDialog; 5 | import android.content.Context; 6 | import android.content.SharedPreferences; 7 | import android.graphics.Bitmap; 8 | import android.graphics.BitmapFactory; 9 | import android.graphics.Canvas; 10 | import android.graphics.Color; 11 | import android.graphics.Paint; 12 | import android.graphics.PorterDuff; 13 | import android.graphics.PorterDuffXfermode; 14 | import android.graphics.drawable.Drawable; 15 | import android.net.ConnectivityManager; 16 | import android.net.NetworkInfo; 17 | import android.util.Log; 18 | import android.view.View; 19 | 20 | 21 | import org.json.JSONException; 22 | import org.json.JSONObject; 23 | 24 | /** 25 | * Created by aravind on . 26 | */ 27 | public class FoodOrderApplication extends Application { 28 | 29 | private static FoodOrderApplication taqwaApplication; 30 | private SharedPreferences mSharedPreferences; 31 | private final String JSONPREFIX = "JSON"; 32 | private ProgressDialog mProgress; 33 | 34 | //public MixpanelAPI mixpanel; 35 | 36 | //Constructor to initialize 37 | @Override 38 | public void onCreate() { 39 | super.onCreate(); 40 | taqwaApplication = this; 41 | 42 | } 43 | 44 | /***/ 45 | public static synchronized FoodOrderApplication getInstance() { 46 | if (taqwaApplication == null) 47 | taqwaApplication = new FoodOrderApplication(); 48 | return taqwaApplication; 49 | } 50 | 51 | /** 52 | * Used to initialize SharedPreferences 53 | */ 54 | public void initSharedPreferences() { 55 | if (mSharedPreferences == null) 56 | mSharedPreferences = getSharedPreferences("taqwa", MODE_PRIVATE); 57 | } 58 | 59 | /** 60 | * Used to get the SharedPref instance 61 | */ 62 | private SharedPreferences getSharedPreferences() { 63 | return mSharedPreferences; 64 | } 65 | 66 | /** 67 | * Used to get boolean 68 | */ 69 | public boolean getBoolean(String key) { 70 | if (getSharedPreferences() != null) 71 | return getSharedPreferences().getBoolean(key, false); 72 | else 73 | return false; 74 | } 75 | 76 | /** 77 | * Used to save boolean 78 | */ 79 | public void saveBoolean(String key, boolean value) { 80 | if (getSharedPreferences() != null) 81 | getSharedPreferences().edit().putBoolean(key, value).commit(); 82 | } 83 | 84 | /*Check Network*/ 85 | 86 | 87 | /** 88 | * Used to get String 89 | */ 90 | public String getString(String key) { 91 | if (getSharedPreferences() != null) 92 | return getSharedPreferences().getString(key, ""); 93 | else 94 | return ""; 95 | } 96 | 97 | /** 98 | * Used to save String 99 | */ 100 | public void saveString(String key, String value) { 101 | if (getSharedPreferences() != null) 102 | getSharedPreferences().edit().putString(key, value).commit(); 103 | } 104 | 105 | 106 | /** 107 | * Used to get Int 108 | */ 109 | public int getInt(String key) { 110 | if (getSharedPreferences() != null) 111 | return getSharedPreferences().getInt(key, 0); 112 | else 113 | return 0; 114 | } 115 | 116 | /** 117 | * Used to save Int 118 | */ 119 | public void saveInt(String key, int value) { 120 | if (getSharedPreferences() != null) 121 | getSharedPreferences().edit().putInt(key, value).commit(); 122 | } 123 | 124 | 125 | /** 126 | * Used to store JSON Object as string 127 | */ 128 | public void saveJSONObject(String key, JSONObject object) { 129 | if (getSharedPreferences() != null) 130 | getSharedPreferences().edit().putString(JSONPREFIX.concat(key), object.toString()).commit(); 131 | } 132 | 133 | 134 | /** 135 | * Used to load JSON Object from string 136 | */ 137 | public JSONObject loadJSONObject(String key) throws JSONException { 138 | if (getSharedPreferences() != null) 139 | return new JSONObject(getSharedPreferences().getString(JSONPREFIX.concat(key), "{}")); 140 | else 141 | return null; 142 | } 143 | 144 | 145 | 146 | 147 | 148 | public boolean isNetworkAvailable() { 149 | ConnectivityManager connectivityManager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE); 150 | NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo(); 151 | return activeNetworkInfo != null && activeNetworkInfo.isConnected(); 152 | } 153 | 154 | 155 | public void showLoadingProgress(Context context) { 156 | mProgress = new ProgressDialog(context); 157 | mProgress.setProgressStyle(ProgressDialog.STYLE_SPINNER); 158 | mProgress.setCancelable(true); 159 | mProgress.show(); 160 | 161 | } 162 | 163 | public void cancelProgress() { 164 | if (mProgress != null) { 165 | if (mProgress.isShowing()) 166 | mProgress.hide(); 167 | } 168 | } 169 | 170 | 171 | public Bitmap loadBitmapFromView(View view, int width, int height) { 172 | Bitmap returnedBitmap = Bitmap.createBitmap(view.getWidth(), view.getHeight(), Bitmap.Config.ARGB_8888); 173 | Canvas canvas = new Canvas(returnedBitmap); 174 | Drawable bgDrawable =view.getBackground(); 175 | if (bgDrawable!=null) 176 | bgDrawable.draw(canvas); 177 | else 178 | canvas.drawColor(Color.WHITE); 179 | view.draw(canvas); 180 | 181 | Log.e("width", "=" + width); 182 | Log.e("height","="+height); 183 | return returnedBitmap; 184 | } 185 | } 186 | -------------------------------------------------------------------------------- /app/src/main/java/com/aravind/foodorderapp/activity/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.aravind.foodorderapp.activity; 2 | 3 | import android.content.res.TypedArray; 4 | import android.os.Bundle; 5 | import android.support.v4.app.Fragment; 6 | import android.support.v4.app.FragmentManager; 7 | import android.support.v4.app.FragmentTransaction; 8 | import android.support.v7.app.AppCompatActivity; 9 | import android.support.v7.widget.Toolbar; 10 | import android.util.Log; 11 | 12 | import com.aravind.foodorderapp.R; 13 | import com.aravind.foodorderapp.fragment.HomeFragment; 14 | import com.aravind.foodorderapp.model.FoodItem; 15 | 16 | import java.util.ArrayList; 17 | 18 | 19 | public class MainActivity extends AppCompatActivity { 20 | 21 | 22 | private FragmentManager fragmentManager; 23 | private FragmentTransaction fragmentTransaction; 24 | ArrayList keyarr; 25 | public ArrayList arrItem; 26 | ArrayList mCheckOutArrayList; 27 | 28 | @Override 29 | protected void onCreate(Bundle savedInstanceState) { 30 | super.onCreate(savedInstanceState); 31 | setContentView(R.layout.activity_main); 32 | if(savedInstanceState!=null) 33 | { 34 | } 35 | mCheckOutArrayList = new ArrayList(); 36 | keyarr = new ArrayList<>(); 37 | arrItem = new ArrayList<>(); 38 | keyarr.add("Tiffin"); 39 | keyarr.add("Veg Rice"); 40 | keyarr.add("Starters"); 41 | arrItem.add(new FoodItem("no description", "180", "200", "", "001", "Tiffin", "Masala Dosa", 0, 0)); 42 | arrItem.add(new FoodItem("no description", "280", "300", "", "002", "Tiffin", "Idli", 0, 0)); 43 | arrItem.add(new FoodItem("no description", "80", "100", "", "003", "Tiffin", "Chappatti", 0, 0)); 44 | arrItem.add(new FoodItem("no description", "99", "150", "", "004", "Tiffin", "Poori", 0, 0)); 45 | Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); 46 | setSupportActionBar(toolbar); 47 | toolbar.setBackgroundColor(getResources().getColor(R.color.primary)); 48 | toolbar.setTitleTextColor(getResources().getColor(R.color.icons)); 49 | final TypedArray styledAttributes = this.getTheme().obtainStyledAttributes(new int[]{android.R.attr.actionBarSize}); 50 | int mActionBarSize = (int) styledAttributes.getDimension(0, 0); 51 | styledAttributes.recycle(); 52 | HomeFragment firstFragment = new HomeFragment(); 53 | Bundle b = new Bundle(); 54 | b.putParcelableArrayList("TotalArray", arrItem); 55 | b.putStringArrayList("KeyArray", keyarr); 56 | 57 | // In case this activity was started with special instructions from an 58 | // Intent, pass the Intent's extras to the fragment as arguments 59 | firstFragment.setArguments(b); 60 | 61 | // Add the fragment to the 'fragment_container' FrameLayout 62 | fragmentManager = getSupportFragmentManager(); 63 | fragmentTransaction = fragmentManager.beginTransaction(); 64 | fragmentTransaction.setCustomAnimations(android.R.anim.slide_in_left, android.R.anim.slide_out_right); 65 | 66 | fragmentTransaction.replace(R.id.container_body, firstFragment, "h"); 67 | fragmentTransaction.addToBackStack("h"); 68 | 69 | fragmentTransaction.commit(); 70 | 71 | } 72 | 73 | 74 | 75 | 76 | 77 | 78 | @Override 79 | public void onBackPressed() { 80 | 81 | 82 | FragmentManager fm = getSupportFragmentManager(); 83 | if (fm.getBackStackEntryCount() > 1) { 84 | Log.i("MainActivity", "popping backstack"); 85 | fm.popBackStack(); 86 | 87 | } else { 88 | Log.i("MainActivity", "nothing on backstack, calling super"); 89 | this.finish(); 90 | } 91 | 92 | fm.addOnBackStackChangedListener(getListener()); 93 | 94 | Fragment f = getSupportFragmentManager().findFragmentById(R.id.container_body); 95 | if (f != null) 96 | Log.e("tagggg", "" + f.getTag()); 97 | 98 | 99 | } 100 | 101 | private FragmentManager.OnBackStackChangedListener getListener() { 102 | FragmentManager.OnBackStackChangedListener result = new FragmentManager.OnBackStackChangedListener() { 103 | public void onBackStackChanged() { 104 | FragmentManager manager = getSupportFragmentManager(); 105 | 106 | if (manager != null) { 107 | if (manager.findFragmentById(R.id.container_body).getTag().equals("h")) { 108 | Fragment currFrag = (Fragment) manager.findFragmentById(R.id.container_body); 109 | 110 | currFrag.onResume(); 111 | 112 | } 113 | } 114 | } 115 | }; 116 | 117 | return result; 118 | } 119 | 120 | 121 | } 122 | -------------------------------------------------------------------------------- /app/src/main/java/com/aravind/foodorderapp/adapter/FoodItemAdapter.java: -------------------------------------------------------------------------------- 1 | package com.aravind.foodorderapp.adapter; 2 | 3 | /** 4 | * Created by Aravindraj on 6/19/2016. 5 | */ 6 | 7 | import android.app.Activity; 8 | import android.content.Context; 9 | import android.content.SharedPreferences; 10 | import android.graphics.Paint; 11 | import android.support.v7.widget.CardView; 12 | import android.support.v7.widget.RecyclerView; 13 | import android.util.Log; 14 | import android.view.LayoutInflater; 15 | import android.view.View; 16 | import android.view.ViewGroup; 17 | import android.widget.ImageView; 18 | import android.widget.TextView; 19 | import android.widget.Toast; 20 | 21 | import com.aravind.foodorderapp.FoodOrderApplication; 22 | import com.aravind.foodorderapp.R; 23 | import com.aravind.foodorderapp.listener.QuantityChangeListener; 24 | import com.aravind.foodorderapp.model.FoodItem; 25 | 26 | import java.util.ArrayList; 27 | 28 | 29 | public class FoodItemAdapter extends RecyclerView.Adapter { 30 | 31 | private ArrayList itemList; 32 | private Context context; 33 | QuantityChangeListener mQcl; 34 | public FoodItemAdapter(Activity a, Context context, ArrayList itemList, QuantityChangeListener qcl) { 35 | this.itemList = itemList; 36 | this.context = context; 37 | this.mQcl = qcl; 38 | } 39 | @Override 40 | public SolventViewHolders onCreateViewHolder(ViewGroup parent, int viewType) { 41 | 42 | View itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.solvent_list, parent, false); 43 | 44 | return new SolventViewHolders(itemView); 45 | 46 | } 47 | @Override 48 | public void onBindViewHolder(final SolventViewHolders holder, final int position) { 49 | holder.countryName.setText(itemList.get(position).getName()); 50 | holder.price.setText(context.getResources().getString(R.string.rs) + " " + itemList.get(position).getPrice()); 51 | holder.oldprice.setText(context.getResources().getString(R.string.rs) + " " + itemList.get(position).getOldprice()); 52 | holder.oldprice.setPaintFlags(holder.oldprice.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG); 53 | holder.count.setText("" + itemList.get(position).getCount()); 54 | holder.plus.setOnClickListener(new View.OnClickListener() { 55 | @Override 56 | public void onClick(View v) { 57 | int count = itemList.get(position).getCount(); 58 | itemList.get(position).setCount(count + 1); 59 | Log.e("adaptercalled", "=cl" + itemList.get(position).getCount()); 60 | mQcl.onQuantityChange(itemList.get(position).getMenuid(), 1, Integer.parseInt(itemList.get(position).getPrice()), holder.mcard); 61 | int e[] = new int[2]; 62 | holder.mcard.getLocationInWindow(e); 63 | Log.e("tuxe", "=" + e[0]); 64 | Log.e("tuye", "=" + e[1]); 65 | notifyDataSetChanged(); 66 | } 67 | }); 68 | 69 | holder.minus.setOnClickListener(new View.OnClickListener() { 70 | @Override 71 | public void onClick(View v) { 72 | int count = itemList.get(position).getCount(); 73 | if (count > 0) { 74 | itemList.get(position).setCount(count - 1); 75 | mQcl.onQuantityChange(itemList.get(position).getMenuid(), -1, -(Integer.parseInt(itemList.get(position).getPrice())), null); 76 | notifyDataSetChanged(); 77 | } 78 | 79 | } 80 | }); 81 | } 82 | 83 | 84 | @Override 85 | public int getItemCount() { 86 | return this.itemList.size(); 87 | } 88 | 89 | 90 | public class SolventViewHolders extends RecyclerView.ViewHolder { 91 | 92 | public TextView countryName, count, price, oldprice; 93 | public ImageView plus, minus; 94 | 95 | CardView mcard; 96 | 97 | public SolventViewHolders(View itemView) { 98 | super(itemView); 99 | countryName = (TextView) itemView.findViewById(R.id.country_name); 100 | mcard = (CardView) itemView.findViewById(R.id.card_view); 101 | price = (TextView) itemView.findViewById(R.id.price); 102 | oldprice = (TextView) itemView.findViewById(R.id.oldprice); 103 | plus = (ImageView) itemView.findViewById(R.id.add); 104 | minus = (ImageView) itemView.findViewById(R.id.minus); 105 | count = (TextView) itemView.findViewById(R.id.count); 106 | 107 | } 108 | 109 | 110 | } 111 | } -------------------------------------------------------------------------------- /app/src/main/java/com/aravind/foodorderapp/fragment/HomeFragment.java: -------------------------------------------------------------------------------- 1 | package com.aravind.foodorderapp.fragment; 2 | 3 | import android.animation.AnimatorSet; 4 | import android.animation.ObjectAnimator; 5 | import android.graphics.Bitmap; 6 | import android.os.Bundle; 7 | import android.support.design.widget.TabLayout; 8 | import android.support.v4.app.Fragment; 9 | import android.support.v4.app.FragmentManager; 10 | import android.support.v4.app.FragmentPagerAdapter; 11 | import android.support.v4.view.ViewPager; 12 | import android.support.v7.app.AppCompatActivity; 13 | import android.util.Log; 14 | import android.util.TypedValue; 15 | import android.view.LayoutInflater; 16 | import android.view.View; 17 | import android.view.ViewGroup; 18 | import android.view.animation.Animation; 19 | import android.view.animation.AnimationUtils; 20 | import android.widget.ImageView; 21 | import android.widget.LinearLayout; 22 | import android.widget.TextView; 23 | 24 | 25 | import com.aravind.foodorderapp.FoodOrderApplication; 26 | import com.aravind.foodorderapp.R; 27 | import com.aravind.foodorderapp.listener.QuantityChangeListener; 28 | import com.aravind.foodorderapp.model.FoodItem; 29 | 30 | import java.util.ArrayList; 31 | import java.util.List; 32 | 33 | 34 | public class HomeFragment extends Fragment implements QuantityChangeListener { 35 | ArrayList mainArray = new ArrayList(); 36 | ArrayList keyArray = new ArrayList<>(); 37 | ArrayList checkoutArray = new ArrayList(); 38 | ViewPager viewPager; 39 | TabLayout tabLayout; 40 | LinearLayout footer; 41 | ViewPagerAdapter adapter; 42 | int totalprice = 0; 43 | int totalcount = 0; 44 | TextView price_txt, counttxt; 45 | ImageView mDummyImgView, mCheckoutImgView; 46 | 47 | int actionbarheight; 48 | 49 | 50 | @Override 51 | public void onResume() { 52 | super.onResume(); 53 | Log.e("HomeFragVisib", "res=="); 54 | // setupViewPager(); 55 | 56 | 57 | ((AppCompatActivity) getActivity()).getSupportActionBar().setTitle("Food Order App"); 58 | viewPager.getAdapter().notifyDataSetChanged(); 59 | totalprice = 0; 60 | checkoutArray = new ArrayList(); 61 | 62 | for (int t = 0; t < mainArray.size(); t++) { 63 | if (mainArray.get(t).getCount() > 0) { 64 | checkoutArray.add(mainArray.get(t)); 65 | totalprice = totalprice + mainArray.get(t).getCount() * Integer.parseInt(mainArray.get(t).getPrice()); 66 | } 67 | price_txt.setText(getResources().getString(R.string.rs) + totalprice); 68 | } 69 | totalcount = 0; 70 | for (int t = 0; t < mainArray.size(); t++) { 71 | 72 | totalcount = totalcount + mainArray.get(t).getCount(); 73 | } 74 | counttxt.setText("" + totalcount); 75 | 76 | 77 | } 78 | 79 | public HomeFragment() { 80 | // Required empty public constructor 81 | } 82 | 83 | 84 | @Override 85 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { 86 | // Inflate the layout for this fragment 87 | 88 | Log.e("HomeFragVisib", "crvi=="); 89 | View v = inflater.inflate(R.layout.fragment_home, container, false); 90 | 91 | Bundle bundle = this.getArguments(); 92 | if (bundle != null) { 93 | mainArray = bundle.getParcelableArrayList("TotalArray"); 94 | keyArray = bundle.getStringArrayList("KeyArray"); 95 | } 96 | footer = (LinearLayout) v.findViewById(R.id.footer); 97 | price_txt = (TextView) v.findViewById(R.id.price); 98 | counttxt = (TextView) v.findViewById(R.id.counttxt); 99 | mDummyImgView = (ImageView) v.findViewById(R.id.img_cpy); 100 | mCheckoutImgView = (ImageView) v.findViewById(R.id.chk_icon); 101 | 102 | 103 | viewPager = (ViewPager) v.findViewById(R.id.viewpager); 104 | tabLayout = (TabLayout) v.findViewById(R.id.tabs); 105 | 106 | setupViewPager(); 107 | tabLayout.setupWithViewPager(viewPager); 108 | tabLayout.setTabGravity(TabLayout.GRAVITY_FILL); 109 | tabLayout.setTabTextColors(getContext().getResources().getColor(R.color.black), getContext().getResources().getColor(R.color.white)); 110 | TypedValue tv = new TypedValue(); 111 | if (getContext().getTheme().resolveAttribute(android.R.attr.actionBarSize, tv, true)) { 112 | actionbarheight = TypedValue.complexToDimensionPixelSize(tv.data, getResources().getDisplayMetrics()); 113 | } 114 | 115 | return v; 116 | 117 | } 118 | 119 | private void setupViewPager() { 120 | 121 | adapter = new ViewPagerAdapter(this); 122 | for (int i = 0; i < keyArray.size(); i++) { 123 | Log.e("intt", "=0" + i); 124 | ArrayList mi = new ArrayList(); 125 | for (int u = 0; u < mainArray.size(); u++) { 126 | if (mainArray.get(u).getCategory().equals(keyArray.get(i))) { 127 | mi.add(mainArray.get(u)); 128 | } 129 | } 130 | 131 | Bundle b = new Bundle(); 132 | b.putParcelableArrayList("array", mi); 133 | MenuFragment fragobj = new MenuFragment(); 134 | fragobj.setListener(this); 135 | fragobj.setArguments(b); 136 | adapter.addFragment(fragobj, keyArray.get(i).toString()); 137 | 138 | } 139 | 140 | 141 | viewPager.setAdapter(adapter); 142 | } 143 | 144 | 145 | @Override 146 | public void onQuantityChange(String menuid, int count, int price, View cardv) { 147 | if (cardv != null) { 148 | Bitmap b = FoodOrderApplication.getInstance().loadBitmapFromView(cardv, cardv.getWidth(), cardv.getHeight()); 149 | animateView(cardv, b); 150 | } 151 | for (int i = 0; i < mainArray.size(); i++) { 152 | if (mainArray.get(i).getMenuid().equals(menuid)) { 153 | totalprice = totalprice + count * Integer.parseInt(mainArray.get(i).getPrice()); 154 | totalcount = totalcount + count; 155 | if (mainArray.get(i).getCount() > 0) { 156 | if (checkoutArray.contains(mainArray.get(i))) { 157 | 158 | } else 159 | checkoutArray.add(mainArray.get(i)); 160 | 161 | } else { 162 | if (checkoutArray.contains(mainArray.get(i))) { 163 | 164 | checkoutArray.remove(mainArray.get(i)); 165 | } 166 | 167 | } 168 | 169 | } 170 | } 171 | price_txt.setText(getResources().getString(R.string.rs) + totalprice); 172 | 173 | counttxt.setText("" + totalcount); 174 | Animation shake; 175 | shake = AnimationUtils.loadAnimation(getContext(), R.anim.shake); 176 | mCheckoutImgView.setAnimation(shake); 177 | 178 | } 179 | 180 | private void animateView(View foodCardView, Bitmap b) { 181 | mDummyImgView.setImageBitmap(b); 182 | mDummyImgView.setVisibility(View.VISIBLE); 183 | int u[] = new int[2]; 184 | mCheckoutImgView.getLocationInWindow(u); 185 | mDummyImgView.setLeft(foodCardView.getLeft()); 186 | mDummyImgView.setTop(foodCardView.getTop()); 187 | AnimatorSet animSetXY = new AnimatorSet(); 188 | ObjectAnimator y = ObjectAnimator.ofFloat(mDummyImgView, "translationY", mDummyImgView.getTop(), u[1] - (2 * actionbarheight)); 189 | ObjectAnimator x = ObjectAnimator.ofFloat(mDummyImgView, "translationX", mDummyImgView.getLeft(), u[0] - (2 * actionbarheight)); 190 | ObjectAnimator sy = ObjectAnimator.ofFloat(mDummyImgView, "scaleY", 0.8f, 0.1f); 191 | ObjectAnimator sx = ObjectAnimator.ofFloat(mDummyImgView, "scaleX", 0.8f, 0.1f); 192 | animSetXY.playTogether(x, y, sx, sy); 193 | animSetXY.setDuration(650); 194 | animSetXY.start(); 195 | } 196 | 197 | 198 | class ViewPagerAdapter extends FragmentPagerAdapter { 199 | private final List mFragmentList = new ArrayList<>(); 200 | private final List mFragmentTitleList = new ArrayList<>(); 201 | 202 | public ViewPagerAdapter(FragmentManager manager) { 203 | super(manager); 204 | } 205 | 206 | public ViewPagerAdapter(android.support.v4.app.Fragment fragment) { 207 | super(fragment.getChildFragmentManager()); 208 | 209 | // write your code here 210 | } 211 | 212 | @Override 213 | public int getItemPosition(Object object) { 214 | // POSITION_NONE makes it possible to reload the PagerAdapter 215 | return POSITION_NONE; 216 | } 217 | 218 | @Override 219 | public Fragment getItem(int position) { 220 | return mFragmentList.get(position); 221 | } 222 | 223 | @Override 224 | public int getCount() { 225 | return mFragmentList.size(); 226 | } 227 | 228 | public void addFragment(Fragment fragment, String title) { 229 | mFragmentList.add(fragment); 230 | mFragmentTitleList.add(title); 231 | } 232 | 233 | @Override 234 | public CharSequence getPageTitle(int position) { 235 | return mFragmentTitleList.get(position); 236 | } 237 | } 238 | 239 | } 240 | -------------------------------------------------------------------------------- /app/src/main/java/com/aravind/foodorderapp/fragment/MenuFragment.java: -------------------------------------------------------------------------------- 1 | package com.aravind.foodorderapp.fragment; 2 | 3 | /** 4 | * Created by Aravindraj on 6/19/2016. 5 | */ 6 | 7 | 8 | import android.os.Bundle; 9 | import android.support.v4.app.Fragment; 10 | import android.support.v7.widget.GridLayoutManager; 11 | import android.support.v7.widget.RecyclerView; 12 | import android.view.LayoutInflater; 13 | import android.view.View; 14 | import android.view.ViewGroup; 15 | 16 | 17 | import com.aravind.foodorderapp.R; 18 | import com.aravind.foodorderapp.adapter.FoodItemAdapter; 19 | import com.aravind.foodorderapp.listener.QuantityChangeListener; 20 | import com.aravind.foodorderapp.model.FoodItem; 21 | 22 | import java.util.ArrayList; 23 | 24 | 25 | public class MenuFragment extends Fragment { 26 | 27 | private GridLayoutManager mGridLayoutManager; 28 | RecyclerView recyclerView; 29 | FoodItemAdapter foodItemAdapter; 30 | public ArrayList foodArrayList; 31 | QuantityChangeListener mQuantityChangeListener; 32 | 33 | 34 | @Override 35 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { 36 | // Inflate the layout for this fragment 37 | View v = inflater.inflate(R.layout.fragment_menu, container, false); 38 | Bundle args = getArguments(); 39 | foodArrayList = args.getParcelableArrayList("array"); 40 | recyclerView = (RecyclerView) v.findViewById(R.id.recycler_view); 41 | recyclerView.setHasFixedSize(true); 42 | mGridLayoutManager = new GridLayoutManager(getContext(), 2); 43 | recyclerView.setLayoutManager(mGridLayoutManager); 44 | foodItemAdapter = new FoodItemAdapter(getActivity(), getActivity(), foodArrayList, mQuantityChangeListener); 45 | recyclerView.setAdapter(foodItemAdapter); 46 | return v; 47 | 48 | } 49 | 50 | public void setListener(QuantityChangeListener listener) { 51 | this.mQuantityChangeListener=listener; 52 | } 53 | 54 | 55 | } -------------------------------------------------------------------------------- /app/src/main/java/com/aravind/foodorderapp/listener/QuantityChangeListener.java: -------------------------------------------------------------------------------- 1 | package com.aravind.foodorderapp.listener; 2 | 3 | import android.graphics.Bitmap; 4 | import android.view.View; 5 | 6 | /** 7 | * Created by Aravindraj on 7/24/2016. 8 | */ 9 | public interface QuantityChangeListener { 10 | public void onQuantityChange(String menuid, int count, int price, View cardv); 11 | } 12 | -------------------------------------------------------------------------------- /app/src/main/java/com/aravind/foodorderapp/model/FoodItem.java: -------------------------------------------------------------------------------- 1 | package com.aravind.foodorderapp.model; 2 | 3 | import android.os.Parcel; 4 | import android.os.Parcelable; 5 | 6 | /** 7 | * Created by Aravindraj on 6/19/2016. 8 | */ 9 | public class FoodItem implements Parcelable { 10 | 11 | 12 | protected FoodItem(Parcel in) { 13 | desc = in.readString(); 14 | price = in.readString(); 15 | oldprice = in.readString(); 16 | photo = in.readString(); 17 | menuid = in.readString(); 18 | category = in.readString(); 19 | name = in.readString(); 20 | favoutite = in.readInt(); 21 | count = in.readInt(); 22 | } 23 | 24 | public static final Creator CREATOR = new Creator() { 25 | @Override 26 | public FoodItem createFromParcel(Parcel in) { 27 | return new FoodItem(in); 28 | } 29 | 30 | @Override 31 | public FoodItem[] newArray(int size) { 32 | return new FoodItem[size]; 33 | } 34 | }; 35 | 36 | public String getOldprice() { 37 | return oldprice; 38 | } 39 | 40 | public void setOldprice(String oldprice) { 41 | this.oldprice = oldprice; 42 | } 43 | 44 | String desc; 45 | String price; 46 | String oldprice; 47 | 48 | public FoodItem(String desc, String price, String oldprice, String photo, String menuid, String category, String name, int favoutite, int count) { 49 | this.desc = desc; 50 | this.price = price; 51 | this.oldprice = oldprice; 52 | this.photo = photo; 53 | this.menuid = menuid; 54 | this.category = category; 55 | this.name = name; 56 | this.favoutite = favoutite; 57 | this.count = count; 58 | } 59 | 60 | String photo; 61 | String menuid; 62 | String category; 63 | String name; 64 | 65 | public String getCategory() { 66 | return category; 67 | } 68 | 69 | public void setCategory(String category) { 70 | this.category = category; 71 | } 72 | 73 | int favoutite; 74 | 75 | public String getMenuid() { 76 | return menuid; 77 | } 78 | 79 | public void setMenuid(String menuid) { 80 | this.menuid = menuid; 81 | } 82 | 83 | 84 | 85 | 86 | public int getCount() { 87 | return count; 88 | } 89 | 90 | public void setCount(int count) { 91 | this.count = count; 92 | } 93 | 94 | int count; 95 | 96 | public String getPrice() { 97 | return price; 98 | } 99 | 100 | 101 | 102 | 103 | public int getFavoutite() { 104 | return favoutite; 105 | } 106 | 107 | public void setFavoutite(int favoutite) { 108 | this.favoutite = favoutite; 109 | } 110 | 111 | public void setPrice(String price) { 112 | this.price = price; 113 | } 114 | 115 | 116 | public String getDesc() { 117 | return desc; 118 | } 119 | 120 | public void setDesc(String desc) { 121 | this.desc = desc; 122 | } 123 | 124 | 125 | public String getName() { 126 | return name; 127 | } 128 | 129 | public void setName(String name) { 130 | this.name = name; 131 | } 132 | 133 | public String getPhoto() { 134 | return photo; 135 | } 136 | 137 | public void setPhoto(String photo) { 138 | this.photo = photo; 139 | } 140 | 141 | 142 | @Override 143 | public int describeContents() { 144 | return 0; 145 | } 146 | 147 | @Override 148 | public void writeToParcel(Parcel dest, int flags) { 149 | dest.writeString(desc); 150 | dest.writeString(price); 151 | dest.writeString(oldprice); 152 | dest.writeString(photo); 153 | dest.writeString(menuid); 154 | dest.writeString(category); 155 | dest.writeString(name); 156 | dest.writeInt(favoutite); 157 | dest.writeInt(count); 158 | } 159 | } 160 | -------------------------------------------------------------------------------- /app/src/main/res/anim/cycle_5.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/anim/grid_layout_animation.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | -------------------------------------------------------------------------------- /app/src/main/res/anim/shake.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/anim/slide_in_bottom.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/anim/splashanim.xml: -------------------------------------------------------------------------------- 1 | 3 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/animation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aravindrajpalani/ObjectAnimatorDemo/8e50c4145485b39c3b8f977ac378768bdd825172/app/src/main/res/drawable/animation.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_button.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_material.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aravindrajpalani/ObjectAnimatorDemo/8e50c4145485b39c3b8f977ac378768bdd825172/app/src/main/res/drawable/bg_material.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_txt.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 8 | 9 | 10 | 11 | 14 | 15 | 16 | 17 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bottomsheet_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/circle_shape.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aravindrajpalani/ObjectAnimatorDemo/8e50c4145485b39c3b8f977ac378768bdd825172/app/src/main/res/drawable/circle_shape.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/circleshape.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 9 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/count_circle.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 9 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/dialog_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 7 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/divider.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/edit_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/edittext_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/gradient_spinner.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_arrow_drop_down.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_bag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aravindrajpalani/ObjectAnimatorDemo/8e50c4145485b39c3b8f977ac378768bdd825172/app/src/main/res/drawable/ic_bag.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_cancel.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_fav.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_fav_outline.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_location.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_minus.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_name.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_phone.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_plus.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_shopping_cart.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_vector_back.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aravindrajpalani/ObjectAnimatorDemo/8e50c4145485b39c3b8f977ac378768bdd825172/app/src/main/res/drawable/logo.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/meal2068511640.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aravindrajpalani/ObjectAnimatorDemo/8e50c4145485b39c3b8f977ac378768bdd825172/app/src/main/res/drawable/meal2068511640.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable/pro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aravindrajpalani/ObjectAnimatorDemo/8e50c4145485b39c3b8f977ac378768bdd825172/app/src/main/res/drawable/pro.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aravindrajpalani/ObjectAnimatorDemo/8e50c4145485b39c3b8f977ac378768bdd825172/app/src/main/res/drawable/red.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/rounder_corners.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/splash_anim.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 8 | 9 | 12 | 13 | 16 | 17 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/splash_anim1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aravindrajpalani/ObjectAnimatorDemo/8e50c4145485b39c3b8f977ac378768bdd825172/app/src/main/res/drawable/splash_anim1.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/splash_anim2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aravindrajpalani/ObjectAnimatorDemo/8e50c4145485b39c3b8f977ac378768bdd825172/app/src/main/res/drawable/splash_anim2.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/splash_anim3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aravindrajpalani/ObjectAnimatorDemo/8e50c4145485b39c3b8f977ac378768bdd825172/app/src/main/res/drawable/splash_anim3.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/splash_anim4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aravindrajpalani/ObjectAnimatorDemo/8e50c4145485b39c3b8f977ac378768bdd825172/app/src/main/res/drawable/splash_anim4.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/splash_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aravindrajpalani/ObjectAnimatorDemo/8e50c4145485b39c3b8f977ac378768bdd825172/app/src/main/res/drawable/splash_bg.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/splashsmoke.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aravindrajpalani/ObjectAnimatorDemo/8e50c4145485b39c3b8f977ac378768bdd825172/app/src/main/res/drawable/splashsmoke.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/tab_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/text_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/threes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aravindrajpalani/ObjectAnimatorDemo/8e50c4145485b39c3b8f977ac378768bdd825172/app/src/main/res/drawable/threes.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/triangle_arrow.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 11 | 12 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/twos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aravindrajpalani/ObjectAnimatorDemo/8e50c4145485b39c3b8f977ac378768bdd825172/app/src/main/res/drawable/twos.png -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 16 | 17 | 18 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_home.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 18 | 19 | 26 | 27 | 36 | 37 | 38 | 49 | 50 | 56 | 57 | 65 | 66 | 78 | 79 | 80 | 81 | 82 | 92 | 93 | 94 | 95 | 102 | 103 | 104 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_menu.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/layout/solvent_list.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | 20 | 21 | 22 | 31 | 32 | 36 | 37 | 49 | 50 | 57 | 58 | 67 | 68 | 78 | 79 | 80 | 88 | 89 | 90 | 97 | 98 | 111 | 112 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aravindrajpalani/ObjectAnimatorDemo/8e50c4145485b39c3b8f977ac378768bdd825172/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aravindrajpalani/ObjectAnimatorDemo/8e50c4145485b39c3b8f977ac378768bdd825172/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aravindrajpalani/ObjectAnimatorDemo/8e50c4145485b39c3b8f977ac378768bdd825172/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aravindrajpalani/ObjectAnimatorDemo/8e50c4145485b39c3b8f977ac378768bdd825172/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aravindrajpalani/ObjectAnimatorDemo/8e50c4145485b39c3b8f977ac378768bdd825172/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aravindrajpalani/ObjectAnimatorDemo/8e50c4145485b39c3b8f977ac378768bdd825172/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aravindrajpalani/ObjectAnimatorDemo/8e50c4145485b39c3b8f977ac378768bdd825172/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aravindrajpalani/ObjectAnimatorDemo/8e50c4145485b39c3b8f977ac378768bdd825172/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aravindrajpalani/ObjectAnimatorDemo/8e50c4145485b39c3b8f977ac378768bdd825172/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aravindrajpalani/ObjectAnimatorDemo/8e50c4145485b39c3b8f977ac378768bdd825172/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/values/anim.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/values/color.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #eb5401 4 | #D32F2F 5 | #ffffff 6 | #ffffff 7 | #ffffff 8 | #ffffff 9 | #FFFFFF 10 | #B6B6B6 11 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #000000 4 | #808080 5 | #ffffff 6 | #ffff00 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Food Order App 3 | Order History 4 | About Us 5 | Contact Us 6 | Feedback 7 | \u20B9 8 | Choose Location 9 | http://ec2-52-42-169-245.us-west-2.compute.amazonaws.com:3401/ 10 | http://52.33.198.30:3401/menu/ 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 18 | 21 | 31 | 36 | 40 | 41 | 45 | 56 | 57 | 61 | 62 | 63 | 74 | 75 | -------------------------------------------------------------------------------- /app/src/test/java/com/aravind/foodorderapp/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.aravind.foodorderapp; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:2.3.0' 9 | 10 | // NOTE: Do not place your application dependencies here; they belong 11 | // in the individual module build.gradle files 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | jcenter() 18 | } 19 | } 20 | 21 | task clean(type: Delete) { 22 | delete rootProject.buildDir 23 | } 24 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | org.gradle.jvmargs=-Xmx1536m 13 | 14 | # When configured, Gradle will run in incubating parallel mode. 15 | # This option should only be used with decoupled projects. More details, visit 16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 17 | # org.gradle.parallel=true 18 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aravindrajpalani/ObjectAnimatorDemo/8e50c4145485b39c3b8f977ac378768bdd825172/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri May 19 16:38:12 IST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip 7 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | --------------------------------------------------------------------------------