-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added view for single dish and displaying the image, added stripping …
…not needed quotes from json
- Loading branch information
1 parent
4cf3d94
commit 092061d
Showing
11 changed files
with
149 additions
and
39 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
app/src/main/java/com/example/mgaciarz/myrecipes/SingleDishActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.example.mgaciarz.myrecipes; | ||
|
||
import android.os.Bundle; | ||
import android.support.v7.app.AppCompatActivity; | ||
import android.widget.ImageView; | ||
import android.widget.TextView; | ||
|
||
import com.squareup.picasso.Picasso; | ||
|
||
import models.Recipe; | ||
|
||
public class SingleDishActivity extends AppCompatActivity { | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_single_dish); | ||
|
||
ImageView dishImage = findViewById(R.id.singleDishImage); | ||
TextView dishDesc = findViewById(R.id.singleDishDescription); | ||
|
||
|
||
Bundle extras = getIntent().getExtras(); | ||
if (extras != null) { | ||
|
||
Recipe recipe = extras.getParcelable("recipe"); | ||
int position = extras.getInt("position"); | ||
|
||
setTitle(recipe.getLabel()); | ||
|
||
Picasso.get().load(recipe.getImageURL()).into(dishImage); | ||
dishDesc.setText(recipe.getInstructionURL()); | ||
|
||
} | ||
|
||
|
||
} | ||
|
||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
|
||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:orientation="vertical" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent"> | ||
<RelativeLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="0dp" | ||
android:layout_weight="0.5" | ||
> | ||
<ImageView | ||
android:id="@+id/singleDishImage" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:adjustViewBounds="true" | ||
/> | ||
|
||
</RelativeLayout> | ||
<TextView | ||
android:id="@+id/singleDishDescription" | ||
android:layout_width="match_parent" | ||
android:layout_height="0dp" | ||
android:layout_weight="0.5" | ||
android:autoLink="web" | ||
android:gravity="center" | ||
/> | ||
|
||
</LinearLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<resources> | ||
<string name="title_activity_single_dish">SingleDishActivity</string> | ||
</resources> |