ShowTop5Ranking - ShutUpPaulo/TecProg_2016-01 GitHub Wiki

Class ShowTop5Ranking

1. Class Attributes

Name Type Description Default Value
places ArrayList<> Stores the five places with better evaluation 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

2.3. onCreateView

2.3.1. Description:

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

2.3.2. 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

2.3.3. Return:

  • Type: View
  • Description: View of the ShowTop5Ranking fragment

onCreateView Attributes

Name Type Description Default Value
top5RankingView View Stores the view of the fragment obtained through the layout XML * * *
listView ListView List to be filled with the top five places that make up the ranking * * *
completeRankingButton Button Button that triggers the action that opens the complete ranking * * *

2.4. fillList

2.4.1. Description:

  • Method that fills the list of places

2.4.2. Arguments:

  • ListView listToBeFilled: List to be filled with places

2.4.3. Return:

  • Type: void

fillList Attributes

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

2.5. populateArrayOfPlaces

2.5.1. Description:

  • Method that fills the list of places

2.5.2. Arguments:

  • JSONObject placesData: Places data obtained through database
  • ArrayList<> places: Array to be populated with places

2.5.3. Return:

  • Type: void

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 * * *

2.6. onItemClick

2.6.1. Description:

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

2.6.2. 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

2.6.3. Return:

  • Type: void

2.7. startShowPlaceInfoActivity

2.7.1. Description:

  • Method that starts the activity with the information of a place

2.7.2. Arguments:

  • int position: Position of the place at places array

2.7.3. Return:

  • Type: void

2.7.4 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 * * *

2.8. getPlaceInfoAsBundle

2.8.1. Description:

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

2.8.2. Arguments:

  • int position: Position of the place at places array

2.8.3. Return:

  • Type: Bundle
  • Description: Bundle with the place information to be sent to the activity that shows this information

2.8.4 getPlaceInfoAsBundle Attributes

Name Type Description Default Value
placeInfo Bundle Bundle object that stores the data of the place clicked * * *

2.9. addRecommendedEventsFragment

2.9.1. Description:

  • Method that adds the fragment to the recommended events list at the view

2.9.2. Arguments:

  • No arguments

2.9.3. Return:

  • Type: void

2.9.4 addRecommendedEventsFragment Attributes

Name Type Description Default Value
recommendEventFragment Fragment Fragment to be added at the view * * *
fragmentTransaction FragmentTransaction Object that adds the fragment at the view * * *

2.10. onClick

2.10.1. Description:

  • Overridden method that opens the complete ranking when the user click in the button that triggers that action

2.10.2. Arguments:

  • View view: View that contains the button that triggers the action

2.10.3. Return:

  • Type: void

2.10.4 onClick Attributes

Name Type Description Default Value
fragmentTransaction FragmentTransaction Object that replace the current fragment with the fragment that shows the complete ranking * * *
⚠️ **GitHub.com Fallback** ⚠️