ShowPlaceRank - ShutUpPaulo/TecProg_2016-01 GitHub Wiki

Class ShowPlaceRank

1. Class Attributes

Name Type Description Default Value
places ArrayList<> Stores the places to be displayed at the ranking

2. Methods

2.1 ShowPlaceRank

2.1.1. Description:

  • Constructor to instantiate a ShowPlaceRank object

2.1.2. Arguments:

  • No arguments

2.1.3. Return:

  • Type: Constructor

2.2 onCreate

2.2.1. Description:

  • Overridden method that calls the parent onCreate to setup the activity view that contains the fragment

2.2.2. Arguments:

  • Bundle savedInstanceState: If non-null, this fragment is being re-constructed from a previous saved state as given here

2.2.3. Return:

  • Type: void

onCreateView

Return type: View - View of the ShowPlaceRank fragment

Arguments:

LayoutInflater inflater - Object used to inflate any views in the fragment

ViewGroup container - If non-null, is the parent view that the fragment should be attached to

Bundle savedInstanceState - If non-null, this fragment is being re-constructed from a previous saved state as given here

Description: Overridden method that creates and returns the view hierarchy associated with the fragment

onCreateView Attributes

Name Type Description Default Value
rankingView View Stores the view of the fragment obtained through the layout XML
listToBeFilled ListView List to be filled with the places that make up the ranking

fillList

Return type: void

Arguments: ListView listToBeFilled - List to be filled with places

Description: Method that fills the list of places

fillList Attributes

Name Type Description Default Value
placesData JSONObject Stores the data of the places that will fill the list
placeAdapter PlaceAdapter Required adapter to adapt items of the places array in items of the places list

populateArrayOfPlaces

Return type: void

Arguments:

JSONObject placesData - Places data obtained through database

ArrayList<> places - Array to be populated with places

Description: Method that fills the list of places

populateArrayOfPlaces Attributes

Name Type Description Default Value
placesDataSize int Stores the size of the JSONObject placesData
idPlace int Stores the identifier of the place obtained from database
placeName String Stores the name of the place obtained from database
placeEvaluate String Stores the average of place evaluation obtained from database
placeLongitude String Stores the longitude of the place localization obtained from database
placeLatitude String Stores the latitude of the place localization from database
placeAddress String Stores the address of the place obtained from database
placeDescription String Stores the description of the place obtained from database
placePhone String Stores the phone of the place obtained from database
placeOperationTime String Stores the operating hours of the place obtained from database
placesArrayListSize int Stores the size of the ArrayList places to check if the size increased by one after adding the place object at array

onItemClick

Return type: void

Arguments:

AdapterView<?> parent - The AdapterView where the click happened

View view - The view within the AdapterView that was clicked

int position - The position of the view in the adapter

long id - The row identifier of the item that was clicked

Description: Callback method to be invoked when an item in AdapterView has been clicked

startShowPlaceInfoActivity

Return type: void

Arguments: int position - Position of the place at places array

Description: Method that starts the activity with the information of a place

startShowPlaceInfoActivity Attributes

Name Type Description Default Value
Intent intent Intent object that allows the data transmission of the place clicked on list to the activity that shows this place information
placeInfoBundle Bundle Bundle object that stores the data of the place clicked to be saved in Intent

getPlaceInfoAsBundle

Return type: Bundle - Bundle with the place information to be sent to the activity that shows this information

Arguments: int position - Position of the place at places array

Description: Method that sets the bundle with place information to allow send this information to an activity

getPlaceInfoAsBundle Attributes

Name Type Description Default Value
placeInfo Bundle Bundle object that stores the data of the place clicked
⚠️ **GitHub.com Fallback** ⚠️