Skip to content

Commit 6eb8332

Browse files
committed
seventeenth commit by Yamuna
1 parent b10a324 commit 6eb8332

13 files changed

+129
-84
lines changed

.idea/misc.xml

+4-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/src/main/AndroidManifest.xml

+64-25
Original file line numberDiff line numberDiff line change
@@ -19,71 +19,110 @@
1919
android:roundIcon="@mipmap/ic_launcher_round"
2020
android:supportsRtl="true"
2121
android:theme="@style/AppMaterialTheme">
22-
<activity android:name=".HomePage">
23-
<intent-filter>
24-
<action android:name="android.intent.action.MAIN" />
22+
<activity android:name=".HomePage"
23+
android:configChanges="orientation"
24+
android:screenOrientation="portrait"
25+
>
26+
<!--<intent-filter>-->
27+
<!--<action android:name="android.intent.action.MAIN" />-->
2528

26-
<category android:name="android.intent.category.LAUNCHER" />
27-
</intent-filter>
29+
<!--<category android:name="android.intent.category.LAUNCHER" />-->
30+
<!--</intent-filter>-->
2831

2932
</activity>
30-
<activity android:name=".Breakfast">
33+
<activity android:name=".Breakfast"
34+
android:configChanges="orientation"
35+
android:screenOrientation="portrait">
3136
<!--<intent-filter>-->
3237
<!--<action android:name="android.intent.action.MAIN" />-->
3338

3439
<!--<category android:name="android.intent.category.LAUNCHER" />-->
3540
<!--</intent-filter>-->
3641
</activity>
37-
<activity android:name=".Snacks" />
38-
<activity android:name=".Dinner" />
39-
<activity android:name=".Curry" />
40-
<activity android:name=".Dessert" />
41-
<activity android:name=".Drinks" >
42+
<activity android:name=".Snacks"
43+
android:configChanges="orientation"
44+
android:screenOrientation="portrait"/>
45+
<activity android:name=".Dinner"
46+
android:configChanges="orientation"
47+
android:screenOrientation="portrait"/>
48+
<activity android:name=".Curry"
49+
android:configChanges="orientation"
50+
android:screenOrientation="portrait"/>
51+
<activity android:name=".Dessert"
52+
android:configChanges="orientation"
53+
android:screenOrientation="portrait"/>
54+
<activity android:name=".Drinks"
55+
android:configChanges="orientation"
56+
android:screenOrientation="portrait">
4257
<!--<intent-filter>-->
4358
<!--<action android:name="android.intent.action.MAIN" />-->
4459

4560
<!--<category android:name="android.intent.category.LAUNCHER" />-->
4661
<!--</intent-filter>-->
4762
</activity>
48-
<activity android:name=".SignUp" />
49-
<activity android:name=".FirstPage">
50-
<!--<intent-filter>-->
51-
<!--<action android:name="android.intent.action.MAIN" />-->
63+
<activity android:name=".SignUp"
64+
android:noHistory="true"
65+
android:configChanges="orientation"
66+
android:screenOrientation="portrait"/>
67+
<activity android:name=".FirstPage"
68+
android:launchMode="singleTask"
69+
android:clearTaskOnLaunch="true"
70+
android:configChanges="orientation"
71+
android:screenOrientation="portrait">
72+
<intent-filter>
73+
<action android:name="android.intent.action.MAIN" />
5274

53-
<!--<category android:name="android.intent.category.LAUNCHER" />-->
54-
<!--</intent-filter>-->
75+
<category android:name="android.intent.category.LAUNCHER" />
76+
</intent-filter>
5577
</activity>
56-
<activity android:name=".Login">
78+
<activity android:name=".Login"
79+
android:noHistory="true"
80+
android:configChanges="orientation"
81+
android:screenOrientation="portrait">
5782
<!--<intent-filter>-->
5883
<!--<action android:name="android.intent.action.MAIN" />-->
5984

6085
<!--<category android:name="android.intent.category.LAUNCHER" />-->
6186
<!--</intent-filter>-->
6287
</activity>
63-
<activity android:name=".Breakfast_homepage">
88+
<activity android:name=".Breakfast_homepage"
89+
android:configChanges="orientation"
90+
android:screenOrientation="portrait">
6491
<!--<intent-filter>-->
6592
<!--<action android:name="android.intent.action.MAIN" />-->
6693

6794
<!--<category android:name="android.intent.category.LAUNCHER" />-->
6895
<!--</intent-filter>-->
6996

7097
</activity>
71-
<activity android:name=".Curry_homepage">
98+
<activity android:name=".Curry_homepage"
99+
android:configChanges="orientation"
100+
android:screenOrientation="portrait">
72101

73102
</activity>
74-
<activity android:name=".Drinks_homepage">
103+
<activity android:name=".Drinks_homepage"
104+
android:configChanges="orientation"
105+
android:screenOrientation="portrait">
75106

76107
</activity>
77-
<activity android:name=".Snacks_homepage">
108+
<activity android:name=".Snacks_homepage"
109+
android:configChanges="orientation"
110+
android:screenOrientation="portrait">
78111

79112
</activity>
80-
<activity android:name=".Dessert_homepage">
113+
<activity android:name=".Dessert_homepage"
114+
android:configChanges="orientation"
115+
android:screenOrientation="portrait">
81116

82117
</activity>
83-
<activity android:name=".Dinner_homepage">
118+
<activity android:name=".Dinner_homepage"
119+
android:configChanges="orientation"
120+
android:screenOrientation="portrait">
84121

85122
</activity>
86-
<activity android:name=".Profile" />
123+
<activity android:name=".Profile"
124+
android:configChanges="orientation"
125+
android:screenOrientation="portrait"/>
87126

88127

89128
</application>

app/src/main/java/ellere/cooksmart/API_creator.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
public class API_creator {
8-
public static String BASE_URL="http://192.168.1.75/cooksmart/";
8+
public static String BASE_URL="http://192.168.1.66/cooksmart/";
99
public static int count=0;
1010
public static String instruction="Instructions:\n";
1111
public static String ingredient ="Ingredients:\n";

app/src/main/java/ellere/cooksmart/Breakfast.java

+32-34
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ public class Breakfast extends AppCompatActivity implements CommonClickListener{
5353
private List<CommonModel> breakfastModelList;
5454
private List<IngredientsModel> inputBreakfast;
5555
private ImageButton sbutton;
56-
String finalList;
56+
//String finalList;
5757
private EditText editText;
5858
private Toolbar btoolbar;
59-
ListIterator listIterator;
60-
static IngredientsModel d0,d1,d2,d3,d4,d5,d6,d7,d8,d9,d10;
59+
//ListIterator listIterator;
60+
//static IngredientsModel d0,d1,d2,d3,d4,d5,d6,d7,d8,d9,d10;
6161
@Override
6262
protected void onCreate(Bundle savedInstanceState) {
6363
super.onCreate(savedInstanceState);
@@ -85,7 +85,7 @@ protected void onCreate(Bundle savedInstanceState) {
8585
sbutton.setClickable(false);
8686
breakfastModelList=new ArrayList<>();
8787
inputBreakfast= new ArrayList<>();
88-
listIterator= inputBreakfast.listIterator();
88+
//listIterator= inputBreakfast.listIterator();
8989

9090
breakfastAdapter= new CommonAdapter(this,breakfastModelList);
9191
breakfastAdapter.setClickListener(this);
@@ -211,10 +211,10 @@ public void buttonClicked(View view, int position) {
211211
String text2=drinkModel1.getName();
212212
String text= text1+text2+", ";
213213
editText.setText(text);
214-
d0=new IngredientsModel(text2);
214+
IngredientsModel d0=new IngredientsModel(text2);
215215
inputBreakfast.add(d0);
216216
if(count==0){
217-
inputBreakfast.remove(d0);
217+
//inputBreakfast.remove(d0);
218218
text=text.replace(text2+", ","");
219219
editText.setText(text);
220220

@@ -233,10 +233,10 @@ public void buttonClicked(View view, int position) {
233233
String text2=drinkModel2.getName();
234234
String text= text1+text2+", ";
235235
editText.setText(text);
236-
d1=new IngredientsModel(text2);
236+
IngredientsModel d1=new IngredientsModel(text2);
237237
inputBreakfast.add(d1);
238238
if(count==0){
239-
inputBreakfast.remove(d1);
239+
//inputBreakfast.remove(d1);
240240
text=text.replace(text2+", ","");
241241
editText.setText(text);
242242

@@ -253,10 +253,10 @@ public void buttonClicked(View view, int position) {
253253
String text2=drinkModel3.getName();
254254
String text= text1+text2+", ";
255255
editText.setText(text);
256-
d2=new IngredientsModel(text2);
256+
IngredientsModel d2=new IngredientsModel(text2);
257257
inputBreakfast.add(d2);
258258
if(count==0){
259-
inputBreakfast.remove(d2);
259+
//inputBreakfast.remove(d2);
260260
text=text.replace(text2+", ","");
261261
editText.setText(text);
262262

@@ -272,11 +272,10 @@ public void buttonClicked(View view, int position) {
272272
String text2=drinkModel4.getName();
273273
String text= text1+text2+", ";
274274
editText.setText(text);
275-
d3=new IngredientsModel(text2);
275+
IngredientsModel d3=new IngredientsModel(text2);
276276
inputBreakfast.add(d3);
277277
if(count==0){
278-
listIterator.next();
279-
listIterator.remove();
278+
280279
text=text.replace(text2+", ","");
281280
editText.setText(text);
282281

@@ -293,10 +292,10 @@ public void buttonClicked(View view, int position) {
293292
String text2=drinkModel5.getName();
294293
String text= text1+text2+", ";
295294
editText.setText(text);
296-
d4=new IngredientsModel(text2);
295+
IngredientsModel d4=new IngredientsModel(text2);
297296
inputBreakfast.add(d4);
298297
if(count==0){
299-
inputBreakfast.remove(d4);
298+
300299
text=text.replace(text2+", ","");
301300
editText.setText(text);
302301

@@ -312,8 +311,8 @@ public void buttonClicked(View view, int position) {
312311
String text2=drinkModel6.getName();
313312
String text= text1+text2+", ";
314313
editText.setText(text);
315-
IngredientsModel d=new IngredientsModel(text2);
316-
inputBreakfast.add(d);
314+
IngredientsModel d5=new IngredientsModel(text2);
315+
inputBreakfast.add(d5);
317316
if(count==0){
318317
text=text.replace(text2+", ","");
319318
editText.setText(text);
@@ -331,8 +330,8 @@ public void buttonClicked(View view, int position) {
331330
String text2=drinkModel7.getName();
332331
String text= text1+text2+", ";
333332
editText.setText(text);
334-
IngredientsModel d=new IngredientsModel(text2);
335-
inputBreakfast.add(d);
333+
IngredientsModel d6=new IngredientsModel(text2);
334+
inputBreakfast.add(d6);
336335
if(count==0){
337336
text=text.replace(text2+", ","");
338337
editText.setText(text);
@@ -350,8 +349,8 @@ public void buttonClicked(View view, int position) {
350349
String text2=drinkModel8.getName();
351350
String text= text1+text2+", ";
352351
editText.setText(text);
353-
IngredientsModel d=new IngredientsModel(text2);
354-
inputBreakfast.add(d);
352+
IngredientsModel d7=new IngredientsModel(text2);
353+
inputBreakfast.add(d7);
355354
if(count==0){
356355
text=text.replace(text2+", ","");
357356
editText.setText(text);
@@ -367,8 +366,8 @@ public void buttonClicked(View view, int position) {
367366
String text2=drinkModel9.getName();
368367
String text= text1+text2+", ";
369368
editText.setText(text);
370-
IngredientsModel d=new IngredientsModel(text2);
371-
inputBreakfast.add(d);
369+
IngredientsModel d8=new IngredientsModel(text2);
370+
inputBreakfast.add(d8);
372371
if(count==0){
373372
text=text.replace(text2+", ","");
374373
editText.setText(text);
@@ -385,8 +384,8 @@ public void buttonClicked(View view, int position) {
385384
String text2=drinkModel10.getName();
386385
String text= text1+text2+", ";
387386
editText.setText(text);
388-
IngredientsModel d=new IngredientsModel(text2);
389-
inputBreakfast.add(d);
387+
IngredientsModel d9=new IngredientsModel(text2);
388+
inputBreakfast.add(d9);
390389
if(count==0){
391390
text=text.replace(text2+", ","");
392391
editText.setText(text);
@@ -403,8 +402,8 @@ public void buttonClicked(View view, int position) {
403402
String text2=drinkModel11.getName();
404403
String text= text1+text2+", ";
405404
editText.setText(text);
406-
IngredientsModel d=new IngredientsModel(text2);
407-
inputBreakfast.add(d);
405+
IngredientsModel d10=new IngredientsModel(text2);
406+
inputBreakfast.add(d10);
408407
if(count==0){
409408
text=text.replace(text2+", ","");
410409
editText.setText(text);
@@ -422,8 +421,8 @@ public void buttonClicked(View view, int position) {
422421
String text2=drinkModel12.getName();
423422
String text= text1+text2+", ";
424423
editText.setText(text);
425-
IngredientsModel d=new IngredientsModel(text2);
426-
inputBreakfast.add(d);
424+
IngredientsModel d11=new IngredientsModel(text2);
425+
inputBreakfast.add(d11);
427426
if(count==0){
428427
text=text.replace(text2+", ","");
429428
editText.setText(text);
@@ -440,8 +439,8 @@ public void buttonClicked(View view, int position) {
440439
String text2=drinkModel13.getName();
441440
String text= text1+text2+", ";
442441
editText.setText(text);
443-
IngredientsModel d=new IngredientsModel(text2);
444-
inputBreakfast.add(d);
442+
IngredientsModel d12=new IngredientsModel(text2);
443+
inputBreakfast.add(d12);
445444
if(count==0){
446445
text=text.replace(text2+", ","");
447446
editText.setText(text);
@@ -682,14 +681,13 @@ public void buttonClicked(View view, int position) {
682681
public void onClick(View view) {
683682
if (isNetworkAvailable()) {
684683

685-
if (editText.length() == 0 || inputBreakfast.size() < 2 || inputBreakfast.size() > 8) {
684+
if (editText.length() == 0 || inputBreakfast.size() < 2) {
686685
if (editText.length() == 0) {
687686

688687
Toast.makeText(Breakfast.this, "Please select two or more ingredients", Toast.LENGTH_SHORT).show();
689688
} else if (inputBreakfast.size() < 2) {
690689
Toast.makeText(Breakfast.this, "Please select two or more ingredients", Toast.LENGTH_SHORT).show();
691-
} else if (inputBreakfast.size() > 8) {
692-
Toast.makeText(Breakfast.this, " Too many ingredients.Select less than eight", Toast.LENGTH_SHORT).show();
690+
693691
}
694692
} else {
695693
sbutton.setClickable(true);

app/src/main/java/ellere/cooksmart/Breakfast_homepage.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public void onClick(DialogInterface dialog, int id) {
141141
});
142142

143143
builder1.setNegativeButton(
144-
"Cancle",
144+
"Cancel",
145145
new DialogInterface.OnClickListener() {
146146
public void onClick(DialogInterface dialog, int id) {
147147
dialog.cancel();

app/src/main/java/ellere/cooksmart/Curry.java

+2-5
Original file line numberDiff line numberDiff line change
@@ -708,16 +708,13 @@ public void buttonClicked(View view, int position) {
708708
@Override
709709
public void onClick(View view) {
710710
if(isNetworkAvailable()){
711-
if (editText.length() == 0 || inputCurry.size() < 2 || inputCurry.size() > 8) {
711+
if (editText.length() == 0 || inputCurry.size() < 2) {
712712
if (editText.length() == 0) {
713713

714714
Toast.makeText(Curry.this, "Please select two or more ingredients", Toast.LENGTH_SHORT).show();
715715
} else if (inputCurry.size() < 2) {
716716
Toast.makeText(Curry.this, "Please select two or more ingredients", Toast.LENGTH_SHORT).show();
717-
} else if (inputCurry.size() > 8) {
718-
Toast.makeText(Curry.this, " Too many ingredients.Select less than eight", Toast.LENGTH_SHORT).show();
719-
}
720-
} else {
717+
} } else {
721718
Gson gson = new Gson();
722719
final String newDataArray = gson.toJson(inputCurry);
723720
StringRequest stringRequest = new StringRequest(Request.Method.POST, curry_url,

0 commit comments

Comments
 (0)