Minor refactoring
This commit is contained in:
parent
6a51f72da4
commit
5b5ba0bde7
@ -12,6 +12,7 @@ import fishrungames.yelpmapapp.records.MapMarkerRecord
|
||||
import fishrungames.yelpmapapp.records.ReviewListRecord
|
||||
import java.util.*
|
||||
|
||||
|
||||
/**
|
||||
* Created by mephi on 09.06.2017.
|
||||
*/
|
||||
@ -100,7 +101,7 @@ class DataProvider(
|
||||
}
|
||||
|
||||
HandleMapMarkersResponseAsyncTask(onUpdateMapMarkers).execute(result)
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -128,7 +129,7 @@ class DataProvider(
|
||||
}
|
||||
|
||||
HandleBusinessDetailResponseAsyncTask(this::handleUpdateBusinessDetail).execute(result)
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
fun requestReviewList(id: String)
|
||||
@ -155,7 +156,7 @@ class DataProvider(
|
||||
}
|
||||
|
||||
HandleReviewListResponseAsyncTask(id, this::handleUpdateReviewList).execute(result)
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
fun handleUpdateBusinessDetail(businessDetailRecord : BusinessDetailRecord?)
|
||||
|
@ -3,7 +3,7 @@ package fishrungames.yelpmapapp
|
||||
import android.support.v4.app.Fragment
|
||||
import android.os.Bundle
|
||||
import android.support.design.widget.AppBarLayout
|
||||
import android.support.v7.widget.LinearLayoutCompat
|
||||
|
||||
import android.support.v7.widget.LinearLayoutManager
|
||||
|
||||
import android.view.ViewGroup
|
||||
@ -12,12 +12,12 @@ import android.view.View
|
||||
import fishrungames.yelpmapapp.records.BusinessDetailRecord
|
||||
import fishrungames.yelpmapapp.records.ReviewListRecord
|
||||
import android.support.v7.widget.RecyclerView
|
||||
import android.util.Log
|
||||
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import com.koushikdutta.ion.Ion
|
||||
import fishrungames.yelpmapapp.records.MapMarkerRecord
|
||||
import org.w3c.dom.Text
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
@ -1,17 +1,13 @@
|
||||
package fishrungames.yelpmapapp
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.support.v4.content.ContextCompat
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import android.widget.LinearLayout
|
||||
|
||||
import com.google.android.gms.maps.model.Marker
|
||||
import android.widget.TextView
|
||||
import com.google.android.gms.maps.GoogleMap.InfoWindowAdapter
|
||||
import android.widget.RelativeLayout
|
||||
import fishrungames.yelpmapapp.Utils.Companion.getStarRatingId
|
||||
import java.text.DecimalFormat
|
||||
|
||||
@ -69,4 +65,4 @@ class YelpInfoWindowProvider(val activity: Activity) : InfoWindowAdapter {
|
||||
return null
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -2,11 +2,10 @@ package fishrungames.yelpmapapp
|
||||
|
||||
import android.location.Location
|
||||
import android.os.Bundle
|
||||
import android.os.Handler
|
||||
|
||||
import com.google.android.gms.maps.GoogleMap
|
||||
import com.google.android.gms.maps.model.Marker
|
||||
import com.google.maps.android.clustering.Cluster
|
||||
import java.util.*
|
||||
|
||||
import com.google.maps.android.clustering.ClusterManager
|
||||
import fishrungames.yelpmapapp.google.MapsActivity
|
||||
import fishrungames.yelpmapapp.records.BusinessDetailRecord
|
||||
@ -47,10 +46,6 @@ class YelpMapActivity : MapsActivity(), ClusterManager.OnClusterItemInfoWindowCl
|
||||
|
||||
googleMap.setOnInfoWindowClickListener(this)
|
||||
|
||||
//yelpInfoWindowProvider = YelpInfoWindowProvider(this)
|
||||
|
||||
//googleMap.setInfoWindowAdapter(yelpInfoWindowProvider)
|
||||
|
||||
setUpClusterer(googleMap)
|
||||
}
|
||||
|
||||
@ -107,10 +102,6 @@ class YelpMapActivity : MapsActivity(), ClusterManager.OnClusterItemInfoWindowCl
|
||||
|
||||
mClusterManager?.markerCollection?.setOnInfoWindowAdapter(yelpInfoWindowProvider)
|
||||
|
||||
//mClusterManager?.markerCollection?.setOnInfoWindowClickListener(this)
|
||||
|
||||
//mClusterManager?.setOnClusterItemInfoWindowClickListener(this)
|
||||
|
||||
mClusterManager?.setOnClusterItemClickListener(this)
|
||||
|
||||
}
|
||||
|
@ -5,7 +5,6 @@ import com.google.gson.JsonObject
|
||||
import com.google.gson.Gson
|
||||
import com.google.gson.reflect.TypeToken
|
||||
import fishrungames.yelpmapapp.records.BusinessDetailRecord
|
||||
import fishrungames.yelpmapapp.records.MapMarkerRecord
|
||||
|
||||
|
||||
/**
|
||||
|
@ -4,8 +4,6 @@ import android.os.AsyncTask
|
||||
import com.google.gson.JsonObject
|
||||
import com.google.gson.Gson
|
||||
import com.google.gson.reflect.TypeToken
|
||||
import fishrungames.yelpmapapp.records.BusinessDetailRecord
|
||||
import fishrungames.yelpmapapp.records.MapMarkerRecord
|
||||
import fishrungames.yelpmapapp.records.ReviewListRecord
|
||||
|
||||
|
||||
@ -30,7 +28,7 @@ class HandleReviewListResponseAsyncTask(val id: String, val onUpdateReviewList :
|
||||
|
||||
if (result != null)
|
||||
{
|
||||
resultPair = Pair<String, ReviewListRecord>(id, result);
|
||||
resultPair = Pair<String, ReviewListRecord>(id, result)
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -5,11 +5,11 @@ import android.content.pm.PackageManager
|
||||
import android.location.Location
|
||||
|
||||
|
||||
import com.google.android.gms.common.ConnectionResult;
|
||||
import com.google.android.gms.common.api.GoogleApiClient;
|
||||
import com.google.android.gms.location.LocationListener;
|
||||
import com.google.android.gms.location.LocationRequest;
|
||||
import com.google.android.gms.location.LocationServices;
|
||||
import com.google.android.gms.common.ConnectionResult
|
||||
import com.google.android.gms.common.api.GoogleApiClient
|
||||
import com.google.android.gms.location.LocationListener
|
||||
import com.google.android.gms.location.LocationRequest
|
||||
import com.google.android.gms.location.LocationServices
|
||||
|
||||
|
||||
import android.os.Bundle
|
||||
@ -122,7 +122,7 @@ open class MapsActivity : AppCompatActivity(), OnMapReadyCallback, LocationListe
|
||||
AlertDialog.Builder(this)
|
||||
.setTitle("Location Permission Needed")
|
||||
.setMessage("This app needs the Location permission, please accept to use location functionality")
|
||||
.setPositiveButton("OK", DialogInterface.OnClickListener { dialogInterface, i ->
|
||||
.setPositiveButton("OK", DialogInterface.OnClickListener { _, i ->
|
||||
|
||||
ActivityCompat.requestPermissions(this,
|
||||
arrayOf(Manifest.permission.ACCESS_FINE_LOCATION),
|
||||
|
@ -1,8 +1,6 @@
|
||||
package fishrungames.yelpmapapp.records
|
||||
|
||||
import java.io.Serializable
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
@ -19,12 +19,12 @@
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView5"
|
||||
android:id="@+id/activityTitleTextView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="18dp"
|
||||
android:layout_marginStart="18dp"
|
||||
android:text="Yelp Map App"
|
||||
android:text="@string/title_activity_maps"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Large.Inverse" />
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -43,14 +43,14 @@
|
||||
android:layout_gravity="bottom|left"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:text="Toolbar Title"
|
||||
android:text=""
|
||||
android:textColor="#ffffff"
|
||||
android:textSize="22sp"
|
||||
android:textSize="24sp"
|
||||
android:textStyle="bold"
|
||||
android:shadowColor="#000000"
|
||||
android:shadowDx="1.5"
|
||||
android:shadowDy="1.3"
|
||||
android:shadowRadius="1.6"/>
|
||||
android:shadowDx="0"
|
||||
android:shadowDy="0"
|
||||
android:shadowRadius="1.8"/>
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
@ -64,14 +64,14 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="left"
|
||||
android:text="Toolbar Title"
|
||||
android:text=""
|
||||
android:textColor="#ffffff"
|
||||
android:textSize="22sp"
|
||||
android:textSize="24sp"
|
||||
android:textStyle="bold"
|
||||
android:shadowColor="#000000"
|
||||
android:shadowDx="1.5"
|
||||
android:shadowDy="1.3"
|
||||
android:shadowRadius="1.6"/>
|
||||
android:shadowDx="0"
|
||||
android:shadowDy="0"
|
||||
android:shadowRadius="1.8"/>
|
||||
</android.support.v7.widget.Toolbar>
|
||||
</android.support.design.widget.CollapsingToolbarLayout>
|
||||
</android.support.design.widget.AppBarLayout>
|
||||
|
@ -7,12 +7,12 @@
|
||||
android:id="@+id/textView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Address:"
|
||||
android:text="@string/addressTitle"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Medium"/>
|
||||
<TextView
|
||||
android:id="@+id/addressTextView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="123 Main st."
|
||||
android:text="@string/notSet"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Large"/>
|
||||
</LinearLayout>
|
@ -8,14 +8,14 @@
|
||||
android:id="@+id/ratingTitleTextView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Rating:"
|
||||
android:text="@string/ratingTitle"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Medium" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/ratingTextView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="5.0" />
|
||||
android:text="@string/notSet" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -29,14 +29,14 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="TextView"
|
||||
android:text="@string/notSet"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Medium" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/ratingTextView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="TextView"
|
||||
android:text="@string/notSet"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Small" />
|
||||
|
||||
<LinearLayout
|
||||
@ -84,14 +84,14 @@
|
||||
android:id="@+id/messageTextView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="TextView TextView TextView TextView TextView TextView TextView TextView TextView TextView TextView TextView TextView TextView"
|
||||
android:text="@string/notSet"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Small" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/dateTextView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="TextView"
|
||||
android:text="@string/notSet"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Small" />
|
||||
|
||||
</LinearLayout>
|
||||
|
@ -7,13 +7,14 @@
|
||||
android:id="@+id/textView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Reviews:"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Medium"/>
|
||||
android:layout_marginTop="12dp"
|
||||
android:text="@string/reviewsTitle"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Medium" />
|
||||
<TextView
|
||||
android:id="@+id/noReviewsTextView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="No reviews yet"
|
||||
android:text="@string/noReviewsYet"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Large"/>
|
||||
|
||||
<ProgressBar
|
||||
|
@ -15,7 +15,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:text="McDonalds"
|
||||
android:text=""
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Large" />
|
||||
|
||||
<ImageView
|
||||
@ -29,14 +29,14 @@
|
||||
android:id="@+id/ratingTitleTextView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Rating:"
|
||||
android:text="@string/ratingTitle"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Medium" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/ratingTextView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="5.0" />
|
||||
android:text="@string/notSet" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
@ -90,14 +90,14 @@
|
||||
android:id="@+id/addressTitleTextView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Address:"
|
||||
android:text="@string/addressTitle"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Medium" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/addressTextView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="123 Main" />
|
||||
android:text="@string/notSet" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -1,4 +1,13 @@
|
||||
<resources>
|
||||
<string name="app_name">YelpMapApp</string>
|
||||
<string name="title_activity_maps">Yelp Map App</string>
|
||||
|
||||
<string name="addressTitle">Address:</string>
|
||||
<string name="phoneTitle">Phone:</string>
|
||||
<string name="ratingTitle">Rating:</string>
|
||||
<string name="reviewsTitle">Reviews:</string>
|
||||
<string name="noReviewsYet">No reviews yet</string>
|
||||
<string name="notSet">Not set</string>
|
||||
|
||||
|
||||
</resources>
|
||||
|
Loading…
Reference in New Issue
Block a user