contentsmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/... · 2014-08-20 · listview for...
TRANSCRIPT
![Page 1: Contentsmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/... · 2014-08-20 · ListView for left side drawer. o drawerToggle private android.support.v4.app.ActionBarDrawerToggle](https://reader036.vdocuments.site/reader036/viewer/2022062602/5e90fd40a7131b5d835a74c4/html5/thumbnails/1.jpg)
Contents Class CustomActivity ................................................................................................................................. 3
Field Detail .................................................................................................................................... 3
Constructor Detail ......................................................................................................................... 3
Method Detail ............................................................................................................................... 3
Class CustomFragment ............................................................................................................................. 5
Constructor Detail ......................................................................................................................... 5
Method Detail ............................................................................................................................... 5
Class Data ................................................................................................................................................. 6
Field Detail .................................................................................................................................... 6
Constructor Detail ......................................................................................................................... 7
Method Detail ............................................................................................................................... 8
Class FeedList .......................................................................................................................................... 10
o Nested Class Summary ................................................................................................................ 11
Field Detail .................................................................................................................................. 11
Constructor Detail ....................................................................................................................... 11
Method Detail ............................................................................................................................. 11
Class LeftNavAdapter ............................................................................................................................. 13
Field Detail .................................................................................................................................. 13
Constructor Detail ....................................................................................................................... 13
Method Detail ............................................................................................................................. 14
Class MainActivity ................................................................................................................................... 14
Field Detail .................................................................................................................................. 15
Constructor Detail ....................................................................................................................... 15
Method Detail ............................................................................................................................. 15
Class MapViewActivity ............................................................................................................................ 18
Constructor Detail ....................................................................................................................... 18
Method Detail ............................................................................................................................. 18
Class MapViewer ..................................................................................................................................... 19
Field Detail .................................................................................................................................. 19
![Page 2: Contentsmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/... · 2014-08-20 · ListView for left side drawer. o drawerToggle private android.support.v4.app.ActionBarDrawerToggle](https://reader036.vdocuments.site/reader036/viewer/2022062602/5e90fd40a7131b5d835a74c4/html5/thumbnails/2.jpg)
Constructor Detail ....................................................................................................................... 20
Method Detail ............................................................................................................................. 20
Class PropertyDetail ................................................................................................................................ 21
Field Detail .................................................................................................................................. 22
Constructor Detail ....................................................................................................................... 22
Method Detail ............................................................................................................................. 22
Class Search ............................................................................................................................................. 24
Field Detail .................................................................................................................................. 25
Constructor Detail ....................................................................................................................... 25
Method Detail ............................................................................................................................. 25
Class SearchResult................................................................................................................................... 26
o Nested Class Summary ................................................................................................................ 26
Field Detail .................................................................................................................................. 26
Constructor Detail ....................................................................................................................... 27
Method Detail ............................................................................................................................. 27
Class SearchResultActivity ...................................................................................................................... 29
Constructor Detail ....................................................................................................................... 30
Method Detail ............................................................................................................................. 30
Class SplashScreen ................................................................................................................................. 31
Field Detail .................................................................................................................................. 31
Constructor Detail ....................................................................................................................... 31
Method Detail ............................................................................................................................. 31
Class TouchEffect ................................................................................................................................... 32
Constructor Detail ....................................................................................................................... 32
Method Detail ............................................................................................................................. 33
com.realestate.custom
![Page 3: Contentsmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/... · 2014-08-20 · ListView for left side drawer. o drawerToggle private android.support.v4.app.ActionBarDrawerToggle](https://reader036.vdocuments.site/reader036/viewer/2022062602/5e90fd40a7131b5d835a74c4/html5/thumbnails/3.jpg)
Class CustomActivity
Direct Known Subclasses:
MainActivity, MapViewActivity, PropertyDetail, SearchResultActivity
public class CustomActivity
extends android.support.v4.app.FragmentActivity
implements android.view.View.OnClickListener
This is a common activity that all other activities of the app can extend to
inherit the common behaviors like implementing a common interface that can
be used in all child activities.
Field Detail o TOUCH
public static final TouchEffect TOUCH
Apply this Constant as touch listener for views to provide alpha touch
effect. The view must have a Non-Transparent background.
Constructor Detail o CustomActivity
public CustomActivity()
Method Detail o onCreate
protected void onCreate(android.os.Bundle savedInstanceState)
Overrides:
onCreate in class android.support.v4.app.FragmentActivity
o setupActionBar
protected void setupActionBar()
![Page 4: Contentsmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/... · 2014-08-20 · ListView for left side drawer. o drawerToggle private android.support.v4.app.ActionBarDrawerToggle](https://reader036.vdocuments.site/reader036/viewer/2022062602/5e90fd40a7131b5d835a74c4/html5/thumbnails/4.jpg)
This method will setup the top title bar (Action bar) content and display
values. It will also setup the custom background theme for ActionBar.
You can override this method to change the behavior of ActionBar for
particular Activity
o setTouchNClick
public android.view.View setTouchNClick(int id)
Sets the touch and click listener for a view with given id.
Parameters:
id - the id
Returns:
the view on which listeners applied
o setClick
public android.view.View setClick(int id)
Sets the click listener for a view with given id.
Parameters:
id - the id
Returns:
the view on which listener is applied
o onClick
public void onClick(android.view.View v)
Specified by:
onClick in interface android.view.View.OnClickListener
![Page 5: Contentsmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/... · 2014-08-20 · ListView for left side drawer. o drawerToggle private android.support.v4.app.ActionBarDrawerToggle](https://reader036.vdocuments.site/reader036/viewer/2022062602/5e90fd40a7131b5d835a74c4/html5/thumbnails/5.jpg)
com.realestate.custom
Class CustomFragment
Direct Known Subclasses:
FeedList, MapViewer, Search, SearchResult
public class CustomFragment
extends android.support.v4.app.Fragment
implements android.view.View.OnClickListener
The Class CustomFragment is the base Fragment class. You can extend your
Fragment classes with this class in case you want to apply common set of rules
for those Fragments.
Constructor Detail o CustomFragment
public CustomFragment()
Method Detail o setTouchNClick
public android.view.View setTouchNClick(android.view.View v)
Set the touch and click listener for a View.
Parameters:
v - the view
Returns:
![Page 6: Contentsmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/... · 2014-08-20 · ListView for left side drawer. o drawerToggle private android.support.v4.app.ActionBarDrawerToggle](https://reader036.vdocuments.site/reader036/viewer/2022062602/5e90fd40a7131b5d835a74c4/html5/thumbnails/6.jpg)
the same view
o onClick
public void onClick(android.view.View v)
Specified by:
onClick in interface android.view.View.OnClickListener
com.realestate.model
Class Data
public class Data
extends java.lang.Object
The Class Data is a simple Java Bean that is used to hold Name, Detail and
image pairs.
Field Detail o title1
private java.lang.String title1
The title1.
o title2
private java.lang.String title2
The title2.
![Page 7: Contentsmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/... · 2014-08-20 · ListView for left side drawer. o drawerToggle private android.support.v4.app.ActionBarDrawerToggle](https://reader036.vdocuments.site/reader036/viewer/2022062602/5e90fd40a7131b5d835a74c4/html5/thumbnails/7.jpg)
o desc
private java.lang.String desc
The description.
o image1
private int image1
The image resource id.
o image2
private int image2
The image2.
Constructor Detail o Data o public Data(java.lang.String title1,
o java.lang.String title2,
o java.lang.String desc,
int image1)
Instantiates a new data.
Parameters:
title1 - the title1
title2 - the title2
desc - the desc
image1 - the image1
o Data o public Data(java.lang.String title1,
o int image1,
int image2)
Instantiates a new data.
Parameters:
![Page 8: Contentsmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/... · 2014-08-20 · ListView for left side drawer. o drawerToggle private android.support.v4.app.ActionBarDrawerToggle](https://reader036.vdocuments.site/reader036/viewer/2022062602/5e90fd40a7131b5d835a74c4/html5/thumbnails/8.jpg)
title1 - the title1
image1 - the image1
image2 - the image2
Method Detail o getTitle1
public java.lang.String getTitle1()
Gets the title1.
Returns:
the title1
o setTitle1
public void setTitle1(java.lang.String title1)
Sets the title1.
Parameters:
title1 - the new title1
o getTitle2
public java.lang.String getTitle2()
Gets the title2.
Returns:
the title2
o setTitle2
public void setTitle2(java.lang.String title2)
Sets the title2.
![Page 9: Contentsmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/... · 2014-08-20 · ListView for left side drawer. o drawerToggle private android.support.v4.app.ActionBarDrawerToggle](https://reader036.vdocuments.site/reader036/viewer/2022062602/5e90fd40a7131b5d835a74c4/html5/thumbnails/9.jpg)
Parameters:
title2 - the new title2
o getDesc
public java.lang.String getDesc()
Gets the desc.
Returns:
the desc
o setDesc
public void setDesc(java.lang.String desc)
Sets the desc.
Parameters:
desc - the new desc
o getImage1
public int getImage1()
Gets the image1.
Returns:
the image1
o setImage1
public void setImage1(int image1)
Sets the image1.
Parameters:
image1 - the new image1
![Page 10: Contentsmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/... · 2014-08-20 · ListView for left side drawer. o drawerToggle private android.support.v4.app.ActionBarDrawerToggle](https://reader036.vdocuments.site/reader036/viewer/2022062602/5e90fd40a7131b5d835a74c4/html5/thumbnails/10.jpg)
o getImage2
public int getImage2()
Gets the image2.
Returns:
the image2
o setImage2
public void setImage2(int image2)
Sets the image2.
Parameters:
image2 - the new image2
com.realestate.ui
Class FeedList
public class FeedList
extends CustomFragment
The Class FeedList is the Fragment class that is launched when the user clicks
on Feed option in Left navigation drawer and this is also used as a default
![Page 11: Contentsmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/... · 2014-08-20 · ListView for left side drawer. o drawerToggle private android.support.v4.app.ActionBarDrawerToggle](https://reader036.vdocuments.site/reader036/viewer/2022062602/5e90fd40a7131b5d835a74c4/html5/thumbnails/11.jpg)
fragment for MainActivity. It simply shows a dummy list of Property Feeds.
You can customize this class to display actual Feed listing.
o Nested Class Summary
Nested Classes
Modifier and Type Class and Description
private class FeedList.FeedAdapter
The Class FeedAdapter is the adapter class for Feed ListView.
Field Detail o fList
private java.util.ArrayList<java.lang.String[]> fList
The feed list.
Constructor Detail o FeedList
public FeedList()
Method Detail o onCreateView o public android.view.View onCreateView(android.view.LayoutInflater
inflater,
o android.view.ViewGroup container,
android.os.Bundle savedInstanceState)
Overrides:
onCreateView in class android.support.v4.app.Fragment
o setFeedList o private void setFeedList(android.view.View v,
boolean sort)
Setup and initialize the feed list view.
Parameters:
![Page 12: Contentsmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/... · 2014-08-20 · ListView for left side drawer. o drawerToggle private android.support.v4.app.ActionBarDrawerToggle](https://reader036.vdocuments.site/reader036/viewer/2022062602/5e90fd40a7131b5d835a74c4/html5/thumbnails/12.jpg)
v - the root view
sort - flag for whether sort the list or not
o loadDummyFeeds
private void loadDummyFeeds(boolean sort)
Load a dummy list of feeds. You need to write your own logic to load
actual list of feeds.
Parameters:
sort - flag for whether sort the list or not
o onCreateOptionsMenu o public void onCreateOptionsMenu(android.view.Menu menu,
android.view.MenuInflater inflater)
Overrides:
onCreateOptionsMenu in class android.support.v4.app.Fragment
o onOptionsItemSelected
public boolean onOptionsItemSelected(android.view.MenuItem item)
Overrides:
onOptionsItemSelected in class android.support.v4.app.Fragment
o showSortPopup
private void showSortPopup()
Shows a sort dialog that holds a list of various sort options for sorting
the feeds.
![Page 13: Contentsmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/... · 2014-08-20 · ListView for left side drawer. o drawerToggle private android.support.v4.app.ActionBarDrawerToggle](https://reader036.vdocuments.site/reader036/viewer/2022062602/5e90fd40a7131b5d835a74c4/html5/thumbnails/13.jpg)
com.realestate.ui
Class LeftNavAdapter
public class LeftNavAdapter
extends android.widget.BaseAdapter
The Adapter class for the ListView displayed in the left navigation drawer.
Field Detail o items
private java.util.ArrayList<Data> items
The items.
o context
private android.content.Context context
The context.
o selected
private int selected
The selected.
Constructor Detail o LeftNavAdapter o public LeftNavAdapter(android.content.Context context,
java.util.ArrayList<Data> items)
Instantiates a new left navigation adapter.
Parameters:
context - the context of activity
items - the array of items to be displayed on ListView
![Page 14: Contentsmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/... · 2014-08-20 · ListView for left side drawer. o drawerToggle private android.support.v4.app.ActionBarDrawerToggle](https://reader036.vdocuments.site/reader036/viewer/2022062602/5e90fd40a7131b5d835a74c4/html5/thumbnails/14.jpg)
Method Detail o setSelection
public void setSelection(int position)
Setup the current selected position of adapter.
Parameters:
position - the new selection
o getCount
public int getCount()
o getItem
public Data getItem(int arg0)
o getItemId
public long getItemId(int position)
o getView o public android.view.View getView(int position,
o android.view.View convertView,
android.view.ViewGroup parent)
com.realestate
Class MainActivity
public class MainActivity
extends CustomActivity
![Page 15: Contentsmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/... · 2014-08-20 · ListView for left side drawer. o drawerToggle private android.support.v4.app.ActionBarDrawerToggle](https://reader036.vdocuments.site/reader036/viewer/2022062602/5e90fd40a7131b5d835a74c4/html5/thumbnails/15.jpg)
The Class MainActivity is the base activity class of the application. This activity
is launched after the Splash and it holds all the Fragments used in the app. It
also creates the Navigation Drawer on left side.
Field Detail o drawerLayout
private android.support.v4.widget.DrawerLayout drawerLayout
The drawer layout.
o drawerLeft
private android.widget.ListView drawerLeft
ListView for left side drawer.
o drawerToggle
private android.support.v4.app.ActionBarDrawerToggle drawerToggle
The drawer toggle.
o adapter
private LeftNavAdapter adapter
The left navigation list adapter.
Constructor Detail o MainActivity
public MainActivity()
Method Detail o onCreate
protected void onCreate(android.os.Bundle savedInstanceState)
Overrides:
onCreate in class CustomActivity
o setupDrawer
![Page 16: Contentsmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/... · 2014-08-20 · ListView for left side drawer. o drawerToggle private android.support.v4.app.ActionBarDrawerToggle](https://reader036.vdocuments.site/reader036/viewer/2022062602/5e90fd40a7131b5d835a74c4/html5/thumbnails/16.jpg)
private void setupDrawer()
Setup the drawer layout. This method also includes the method calls for
setting up the Left side drawer.
o setupLeftNavDrawer
private void setupLeftNavDrawer()
Setup the left navigation drawer/slider. You can add your logic to load
the contents to be displayed on the left side drawer. You can also setup
the Header and Footer contents of left drawer if you need them.
o getDummyLeftNavItems
private java.util.ArrayList<Data> getDummyLeftNavItems()
This method returns a list of dummy items for left navigation slider. You
can write or replace this method with the actual implementation for list
items.
Returns:
the dummy items
o launchFragment
private void launchFragment(int pos)
This method can be used to attach Fragment on activity view for a
particular tab position. You can customize this method as per your
need.
Parameters:
pos - the position of tab selected.
o setupContainer
private void setupContainer()
![Page 17: Contentsmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/... · 2014-08-20 · ListView for left side drawer. o drawerToggle private android.support.v4.app.ActionBarDrawerToggle](https://reader036.vdocuments.site/reader036/viewer/2022062602/5e90fd40a7131b5d835a74c4/html5/thumbnails/17.jpg)
Setup the container fragment for drawer layout. The current
implementation of this method simply calls launchFragment method for
tab position 0. You can customize this method as per your need to
display specific content.
o setActionBarTitle
private void setActionBarTitle()
Set the action bar title text.
o onPostCreate
protected void onPostCreate(android.os.Bundle savedInstanceState)
Overrides:
onPostCreate in class android.app.Activity
o onConfigurationChanged
public void onConfigurationChanged(android.content.res.Configurat
ion newConfig)
Specified by:
onConfigurationChanged in interface android.content.ComponentCallbacks
Overrides:
onConfigurationChanged in class android.support.v4.app.FragmentActivity
o onOptionsItemSelected
public boolean onOptionsItemSelected(android.view.MenuItem item)
Overrides:
onOptionsItemSelected in class android.app.Activity
o onKeyDown o public boolean onKeyDown(int keyCode,
android.view.KeyEvent event)
Specified by:
onKeyDown in interface android.view.KeyEvent.Callback
![Page 18: Contentsmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/... · 2014-08-20 · ListView for left side drawer. o drawerToggle private android.support.v4.app.ActionBarDrawerToggle](https://reader036.vdocuments.site/reader036/viewer/2022062602/5e90fd40a7131b5d835a74c4/html5/thumbnails/18.jpg)
Overrides:
onKeyDown in class android.support.v4.app.FragmentActivity
com.realestate
Class MapViewActivity
public class MapViewActivity
extends CustomActivity
The MapViewActivity is the activity class that shows Map fragment. This
activity is only created to show Back button on ActionBar.
Constructor Detail o MapViewActivity
public MapViewActivity()
Method Detail o onCreate
protected void onCreate(android.os.Bundle savedInstanceState)
Overrides:
onCreate in class CustomActivity
o addFragment
private void addFragment()
![Page 19: Contentsmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/... · 2014-08-20 · ListView for left side drawer. o drawerToggle private android.support.v4.app.ActionBarDrawerToggle](https://reader036.vdocuments.site/reader036/viewer/2022062602/5e90fd40a7131b5d835a74c4/html5/thumbnails/19.jpg)
Attach the appropriate MapViewer fragment with activity.
o onOptionsItemSelected
public boolean onOptionsItemSelected(android.view.MenuItem item)
Overrides:
onOptionsItemSelected in class android.app.Activity
com.realestate.ui
Class MapViewer
public class MapViewer
extends CustomFragment
The Class MapViewer is the Fragment class that is launched when the user
clicks on Map option in Left navigation drawer or when user tap on the Map
icon in action bar. It simply shows a Map View with a few dummy location
markers on map. You can customize this class to load and display actual
locations on map.
Field Detail o mMapView
private com.google.android.gms.maps.MapView mMapView
The map view.
o mMap
![Page 20: Contentsmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/... · 2014-08-20 · ListView for left side drawer. o drawerToggle private android.support.v4.app.ActionBarDrawerToggle](https://reader036.vdocuments.site/reader036/viewer/2022062602/5e90fd40a7131b5d835a74c4/html5/thumbnails/20.jpg)
private com.google.android.gms.maps.GoogleMap mMap
The Google map.
Constructor Detail o MapViewer
public MapViewer()
Method Detail o onCreateView o public android.view.View onCreateView(android.view.LayoutInflater
inflater,
o android.view.ViewGroup container,
android.os.Bundle savedInstanceState)
Overrides:
onCreateView in class android.support.v4.app.Fragment
o onClick
public void onClick(android.view.View v)
Specified by:
onClick in interface android.view.View.OnClickListener
Overrides:
onClick in class CustomFragment
o onPause
public void onPause()
Overrides:
onPause in class android.support.v4.app.Fragment
o onDestroy
public void onDestroy()
Overrides:
onDestroy in class android.support.v4.app.Fragment
o onResume
![Page 21: Contentsmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/... · 2014-08-20 · ListView for left side drawer. o drawerToggle private android.support.v4.app.ActionBarDrawerToggle](https://reader036.vdocuments.site/reader036/viewer/2022062602/5e90fd40a7131b5d835a74c4/html5/thumbnails/21.jpg)
public void onResume()
Overrides:
onResume in class android.support.v4.app.Fragment
o setupMap o private void setupMap(android.view.View v,
android.os.Bundle savedInstanceState)
Setup and initialize the Google map view.
Parameters:
v - the root view
savedInstanceState - the saved instance state
o setupMarker
private void setupMarker()
This method simply place a few dummy location markers on Map View.
You can write your own logic for loading the locations and placing the
marker for each location as per your need.
o onCreateOptionsMenu o public void onCreateOptionsMenu(android.view.Menu menu,
android.view.MenuInflater inflater)
Overrides:
onCreateOptionsMenu in class android.support.v4.app.Fragment
com.realestate
Class PropertyDetail
![Page 22: Contentsmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/... · 2014-08-20 · ListView for left side drawer. o drawerToggle private android.support.v4.app.ActionBarDrawerToggle](https://reader036.vdocuments.site/reader036/viewer/2022062602/5e90fd40a7131b5d835a74c4/html5/thumbnails/22.jpg)
public class PropertyDetail
extends CustomActivity
The Class PropertyDetail is the Activity class that is launched when the user
clicks on an item in Feed list or in Search results list. It simply shows dummy
details of a property with dummy image of property and also includes a
Google Map view. You need to write your own code to load and display actual
contents.
Field Detail o mMapView
private com.google.android.gms.maps.MapView mMapView
The map view.
o mMap
private com.google.android.gms.maps.GoogleMap mMap
The Google map.
Constructor Detail o PropertyDetail
public PropertyDetail()
Method Detail o onCreate
protected void onCreate(android.os.Bundle savedInstanceState)
Overrides:
onCreate in class CustomActivity
![Page 23: Contentsmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/... · 2014-08-20 · ListView for left side drawer. o drawerToggle private android.support.v4.app.ActionBarDrawerToggle](https://reader036.vdocuments.site/reader036/viewer/2022062602/5e90fd40a7131b5d835a74c4/html5/thumbnails/23.jpg)
o onPause
public void onPause()
Overrides:
onPause in class android.support.v4.app.FragmentActivity
o onDestroy
public void onDestroy()
Overrides:
onDestroy in class android.support.v4.app.FragmentActivity
o onResume
public void onResume()
Overrides:
onResume in class android.support.v4.app.FragmentActivity
o setupMap
private void setupMap(android.os.Bundle savedInstanceState)
Setup and initialize the Google map view.
Parameters:
savedInstanceState - the saved instance state
o setupMarker
private void setupMarker()
This method simply place a dummy location marker on Map View. You
can write your own logic for loading the locations and placing the
marker for each location as per your need.
o onClick
public void onClick(android.view.View v)
Specified by:
![Page 24: Contentsmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/... · 2014-08-20 · ListView for left side drawer. o drawerToggle private android.support.v4.app.ActionBarDrawerToggle](https://reader036.vdocuments.site/reader036/viewer/2022062602/5e90fd40a7131b5d835a74c4/html5/thumbnails/24.jpg)
onClick in interface android.view.View.OnClickListener
Overrides:
onClick in class CustomActivity
o onCreateOptionsMenu
public boolean onCreateOptionsMenu(android.view.Menu menu)
Overrides:
onCreateOptionsMenu in class android.app.Activity
o onOptionsItemSelected
public boolean onOptionsItemSelected(android.view.MenuItem item)
Overrides:
onOptionsItemSelected in class android.app.Activity
com.realestate.ui
Class Search
public class Search
extends CustomFragment
The Class Search is the Fragment class that is launched when the user clicks on
Search option in Left navigation drawer and it simply shows a few dummy
options for Search property with options for Searching property for Buy and
Rent. You can customize this to display actual contents.
![Page 25: Contentsmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/... · 2014-08-20 · ListView for left side drawer. o drawerToggle private android.support.v4.app.ActionBarDrawerToggle](https://reader036.vdocuments.site/reader036/viewer/2022062602/5e90fd40a7131b5d835a74c4/html5/thumbnails/25.jpg)
Field Detail o buy
private boolean buy
Flag to hold whether to search properties for buy or for rent.
Constructor Detail o Search
public Search()
Method Detail o onCreateView o public android.view.View onCreateView(android.view.LayoutInflater
inflater,
o android.view.ViewGroup container,
android.os.Bundle savedInstanceState)
Overrides:
onCreateView in class android.support.v4.app.Fragment
o onClick
public void onClick(android.view.View v)
Specified by:
onClick in interface android.view.View.OnClickListener
Overrides:
onClick in class CustomFragment
o setupSearchOptions
private void setupSearchOptions(boolean buy)
Sets the up search options for buy and rent.
Parameters:
buy - Flag to hold whether to search properties for buy or for rent.
![Page 26: Contentsmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/... · 2014-08-20 · ListView for left side drawer. o drawerToggle private android.support.v4.app.ActionBarDrawerToggle](https://reader036.vdocuments.site/reader036/viewer/2022062602/5e90fd40a7131b5d835a74c4/html5/thumbnails/26.jpg)
com.realestate.ui
Class SearchResult
public class SearchResult
extends CustomFragment
The Class SearchResult is the Fragment class that is launched when the user
clicks on Search option Search screen and it simply shows a dummy list of
Search results with a MapView that shows dummy locations for properties.
You can customize this to load and display actual search result listing.
o Nested Class Summary
Nested Classes
Modifier and
Type Class and Description
private
class
SearchResult.SearchAdapter
The Class SearchAdapter is the adapter class for Search result
ListView.
Field Detail o sList
private java.util.ArrayList<java.lang.String[]> sList
The search result list.
![Page 27: Contentsmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/... · 2014-08-20 · ListView for left side drawer. o drawerToggle private android.support.v4.app.ActionBarDrawerToggle](https://reader036.vdocuments.site/reader036/viewer/2022062602/5e90fd40a7131b5d835a74c4/html5/thumbnails/27.jpg)
o rent
private boolean rent
The Flag to hold whether to search properties for buy or for rent..
o mMapView
private com.google.android.gms.maps.MapView mMapView
The map view.
o mMap
private com.google.android.gms.maps.GoogleMap mMap
The Google map.
Constructor Detail o SearchResult
public SearchResult()
Method Detail o onCreateView o public android.view.View onCreateView(android.view.LayoutInflater
inflater,
o android.view.ViewGroup container,
android.os.Bundle savedInstanceState)
Overrides:
onCreateView in class android.support.v4.app.Fragment
o onPause
public void onPause()
Overrides:
onPause in class android.support.v4.app.Fragment
o onDestroy
public void onDestroy()
Overrides:
![Page 28: Contentsmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/... · 2014-08-20 · ListView for left side drawer. o drawerToggle private android.support.v4.app.ActionBarDrawerToggle](https://reader036.vdocuments.site/reader036/viewer/2022062602/5e90fd40a7131b5d835a74c4/html5/thumbnails/28.jpg)
onDestroy in class android.support.v4.app.Fragment
o onResume
public void onResume()
Overrides:
onResume in class android.support.v4.app.Fragment
o setupMap o private void setupMap(android.view.View v,
android.os.Bundle savedInstanceState)
Setup and initialize the Google map view.
Parameters:
v - the root view
savedInstanceState - the saved instance state
o setupMarker
private void setupMarker()
This method simply place a few dummy location markers on Map View.
You can write your own logic for loading the locations and placing the
marker for each location as per your need.
o setSearchResultList
private void setSearchResultList(android.view.View v)
Setup and initialize the search result list view.
Parameters:
v - the root view
o loadDummyResults
private void loadDummyResults()
![Page 29: Contentsmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/... · 2014-08-20 · ListView for left side drawer. o drawerToggle private android.support.v4.app.ActionBarDrawerToggle](https://reader036.vdocuments.site/reader036/viewer/2022062602/5e90fd40a7131b5d835a74c4/html5/thumbnails/29.jpg)
Load a dummy list of search results. You need to write your own logic to
load actual list of results.
o onCreateOptionsMenu o public void onCreateOptionsMenu(android.view.Menu menu,
android.view.MenuInflater inflater)
Overrides:
onCreateOptionsMenu in class android.support.v4.app.Fragment
o onOptionsItemSelected
public boolean onOptionsItemSelected(android.view.MenuItem item)
Overrides:
onOptionsItemSelected in class android.support.v4.app.Fragment
o showSortPopup
private void showSortPopup()
Shows a sort dialog that holds a list of various sort options for sorting
the search results.
com.realestate
Class SearchResultActivity
public class SearchResultActivity
extends CustomActivity
![Page 30: Contentsmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/... · 2014-08-20 · ListView for left side drawer. o drawerToggle private android.support.v4.app.ActionBarDrawerToggle](https://reader036.vdocuments.site/reader036/viewer/2022062602/5e90fd40a7131b5d835a74c4/html5/thumbnails/30.jpg)
The SearchResultActivity is the activity class that shows a dummy list of
property search results. You need to write your own code to load and display
actual search results.
Constructor Detail o SearchResultActivity
public SearchResultActivity()
Method Detail o onCreate
protected void onCreate(android.os.Bundle savedInstanceState)
Overrides:
onCreate in class CustomActivity
o addFragment
private void addFragment()
Attach the appropriate SearchResult fragment with activity and also
passes the bundle with fragment based on the 'buy' parameter in Intent
to differentiate between Buy and Rent result listing. You may need to
pass additional parameters based on your needs.
o onOptionsItemSelected
public boolean onOptionsItemSelected(android.view.MenuItem item)
Overrides:
onOptionsItemSelected in class android.app.Activity
com.realestate
![Page 31: Contentsmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/... · 2014-08-20 · ListView for left side drawer. o drawerToggle private android.support.v4.app.ActionBarDrawerToggle](https://reader036.vdocuments.site/reader036/viewer/2022062602/5e90fd40a7131b5d835a74c4/html5/thumbnails/31.jpg)
Class SplashScreen
public class SplashScreen
extends android.app.Activity
The Class SplashScreen will launched at the start of the application. It will be
displayed for 3 seconds and than finished automatically and it will also start the
next activity of app.
Field Detail o isRunning
private boolean isRunning
Check if the app is running.
Constructor Detail o SplashScreen
public SplashScreen()
Method Detail o onCreate
public void onCreate(android.os.Bundle savedInstanceState)
Overrides:
onCreate in class android.app.Activity
o startSplash
private void startSplash()
Starts the count down timer for 3-seconds. It simply sleeps the thread
for 3-seconds.
o doFinish
private void doFinish()
![Page 32: Contentsmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/... · 2014-08-20 · ListView for left side drawer. o drawerToggle private android.support.v4.app.ActionBarDrawerToggle](https://reader036.vdocuments.site/reader036/viewer/2022062602/5e90fd40a7131b5d835a74c4/html5/thumbnails/32.jpg)
If the app is still running than this method will start the MainActivity
activity and finish the Splash.
o onKeyDown o public boolean onKeyDown(int keyCode,
android.view.KeyEvent event)
Specified by:
onKeyDown in interface android.view.KeyEvent.Callback
Overrides:
onKeyDown in class android.app.Activity
com.realestate.utils
Class TouchEffect
public class TouchEffect
extends java.lang.Object
implements android.view.View.OnTouchListener
The Class TouchEffect is the implementation of OnTouchListener interface.
You can apply this to views mostly Buttons to provide Touch effect and that
view must have a valid background. The current implementation simply set
Alpha value of View background.
Constructor Detail o TouchEffect
public TouchEffect()
![Page 33: Contentsmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/... · 2014-08-20 · ListView for left side drawer. o drawerToggle private android.support.v4.app.ActionBarDrawerToggle](https://reader036.vdocuments.site/reader036/viewer/2022062602/5e90fd40a7131b5d835a74c4/html5/thumbnails/33.jpg)
Method Detail o onTouch o public boolean onTouch(android.view.View v,
android.view.MotionEvent event)
Specified by:
onTouch in interface android.view.View.OnTouchListener