This file contains hidden or 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
Verifying my Blockstack ID is secured with the address 1PKwk23nzAuqWin15Ecst9URHNqoRWxD7r https://explorer.blockstack.org/address/1PKwk23nzAuqWin15Ecst9URHNqoRWxD7r |
This file contains hidden or 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
private String makeList(List<String> stuff) { | |
String merge = ""; | |
for (String s: stuff) { | |
merge += "- " + s + "\n"; | |
} | |
return merge; | |
} | |
private String edgeCase(String s) { | |
s = s.equals("") ? getString(R.string.missing_detail) : s; |
This file contains hidden or 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
private void inflateTabs(Sandwich sandwich) { | |
toolbar = (android.support.v7.widget.Toolbar) findViewById(R.id.toolbar); | |
setSupportActionBar(toolbar); | |
TabLayout tabLayout = (TabLayout) findViewById(R.id.tab_layout); | |
tabLayout.addTab(tabLayout.newTab().setText("Background")); | |
tabLayout.addTab(tabLayout.newTab().setText("Ingredients")); |
This file contains hidden or 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
package com.udacity.sandwichclub; | |
import android.app.Fragment; | |
import android.content.Intent; | |
import android.os.Bundle; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.widget.TextView; | |
import android.widget.Toast; |
This file contains hidden or 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
package com.udacity.sandwichclub; | |
import android.content.Intent; | |
import android.support.v4.app.Fragment; | |
import android.os.Bundle; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.widget.TextView; | |
import android.widget.Toast; |
This file contains hidden or 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
package com.udacity.sandwichclub; | |
import android.support.v4.app.Fragment; | |
import android.support.v4.app.FragmentManager; | |
import android.support.v4.app.FragmentStatePagerAdapter; | |
public class PagerAdapter extends FragmentStatePagerAdapter { | |
int mNumberOfTabs; | |
public PagerAdapter(FragmentManager fm, int NumberOfTabs) { |
This file contains hidden or 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
private void populateUI(Sandwich model) { | |
//get text views | |
TextView nameView = findViewById(R.id.name_tv); | |
TextView origin = findViewById(R.id.origin_tv); | |
TextView aka = findViewById(R.id.also_known_tv); | |
TextView descView = findViewById(R.id.description_tv); | |
TextView ingredients = findViewById(R.id.ingredients_tv); | |
//bind data to views | |
if(model != null) { |
This file contains hidden or 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
package com.udacity.sandwichclub.utils; | |
import com.udacity.sandwichclub.model.Sandwich; | |
import org.json.JSONArray; | |
import org.json.JSONException; | |
import org.json.JSONObject; | |
import java.util.ArrayList; |
This file contains hidden or 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
package com.udacity.sandwichclub.utils; | |
import org.json.JSONArray; | |
import org.json.JSONException; | |
import org.json.JSONObject; | |
import java.util.ArrayList; | |
public class JsonUtils { |
This file contains hidden or 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
public class JsonUtils { | |
public static Sandwich parseSandwichJson(String json) { | |
try { | |
/* Step One: Convert json string to JSON object */ | |
JSONObject base = new JSONObject(json); | |
/* Step Two: Parse the Base Object's Keys Into Autonomous Objects/Strings for Serializing */ | |
// Handle anomolies first |
NewerOlder