Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.example.homin.test1;

import android.content.Context;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;
Expand All @@ -21,26 +22,40 @@ public CustomInfoWindowAdapter(Context context){
private void rendowWindowText(Marker marker, View view){
String title = marker.getTitle();
TextView tvTitle = (TextView) view.findViewById(R.id.title);

if(title == null){
return;
}
if(!title.equals("")){
tvTitle.setText(title);
}

String snippet = marker.getSnippet();
TextView tvSnippet = (TextView)view.findViewById(R.id.snippet);

if(snippet == null){
return;
}
if(!snippet.equals("")){
tvSnippet.setText(snippet);
}
}
@Override
public View getInfoWindow(Marker marker) {
if((DaoImple.getInstance().getContact().getUserId()).equals(marker.getTitle())){
return null;
}

rendowWindowText(marker, mWindow);

return mWindow;
}

@Override
public View getInfoContents(Marker marker) {

if((DaoImple.getInstance().getContact().getUserId()).equals(marker.getTitle())){

return null;
}
rendowWindowText(marker,mWindow);
return mWindow;
}
Expand Down
13 changes: 13 additions & 0 deletions app/src/main/java/com/example/homin/test1/ItemPerson.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,19 @@ public ItemPerson(double lat, double lng, String id,String name,String image) {

}

public void setUserId(String userId) {
this.userId = userId;
}

public void setUserName(String userName) {
this.userName = userName;
}

public void setImage(String image) {
this.image = image;
}


public String getTitle() {
return userId;
}
Expand Down
303 changes: 150 additions & 153 deletions app/src/main/java/com/example/homin/test1/MapsActivity.java

Large diffs are not rendered by default.

12 changes: 10 additions & 2 deletions app/src/main/java/com/example/homin/test1/PersonItemRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,21 @@ private static Activity getActivity(Context context) {
}

@Override
protected void onClusterItemRendered(final ClusterItem clusterItem, final Marker marker) {
protected void onClusterRendered(Cluster<ClusterItem> cluster, Marker marker) {
super.onClusterRendered(cluster, marker);
marker.setAnchor(0.5f,0.5f);

Log.i("dd4432", "context: " + context);
}

@Override
protected void onClusterItemRendered(final ClusterItem clusterItem, final Marker marker) {

marker.setAnchor(0.5f,0.5f);
Context get = getActivity(context);
if (clusterItem instanceof ItemPerson) {
if (get != null) {
Glide.with(get).load(((ItemPerson) clusterItem).getImage()).asBitmap().fitCenter().into(new SimpleTarget<Bitmap>() {

@Override
public void onResourceReady(Bitmap resource, GlideAnimation<? super Bitmap> glideAnimation) {
Bitmap roundBitmap = getCircleBitmap(resource);
Expand Down Expand Up @@ -107,6 +114,7 @@ public PersonItemRenderer(Context context, GoogleMap map, ClusterManager<Cluster
protected void onBeforeClusterItemRendered(final ClusterItem item, final MarkerOptions markerOptions) {
super.onBeforeClusterItemRendered(item, markerOptions);


if (item instanceof ItemPerson) {

if (((ItemPerson) item).getImage() != null) {
Expand Down
Binary file added app/src/main/res/drawable/arrow_final.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion app/src/main/res/drawable/shapetwo.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
<solid android:color="#ffffffff" />
<solid android:color="#4fa5d5" />
<stroke android:width="8dip" android:color="#4fa5d5"/>
</shape>
2 changes: 1 addition & 1 deletion app/src/main/res/drawable/white_border.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<item>
<shape android:shape="rectangle">
<solid android:color="#fff"/>
<corners android:radius="5dp"/>
<!--<corners android:radius="5dp"/>-->
</shape>
</item>
</layer-list>
29 changes: 15 additions & 14 deletions app/src/main/res/layout/activity_maps.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@

<RelativeLayout
android:id="@+id/relLayout1"
android:layout_width="0dp"
android:layout_width="match_parent"
android:layout_height="45dp"
android:background="@drawable/white_border"
android:elevation="10dp"
app:layout_constraintEnd_toStartOf="@id/floatingActionButton"
app:layout_constraintEnd_toStartOf="parent"
app:layout_constraintStart_toStartOf="parent">

<ImageView
Expand All @@ -47,27 +47,27 @@

<AutoCompleteTextView
android:id="@+id/input_search"
android:layout_width="match_parent"
android:layout_width="270dp"

android:layout_height="match_parent"
android:background="@null"
android:layout_centerVertical="true"
android:layout_toRightOf="@id/ic_magnify"
android:hint="가고 싶은 곳을 입력하세요"
android:imeOptions="actionSearch"
android:textColor="#000"
android:textSize="15sp" />

<Button
android:id="@+id/AddIndicator"
android:text="친구추가"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/input_search"
/>

</RelativeLayout>
<android.support.design.widget.FloatingActionButton
android:id="@+id/floatingActionButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_weight="1"
android:clickable="true"
android:src="@drawable/jt_logo2"
app:fabSize="mini"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />

</android.support.constraint.ConstraintLayout>

<android.support.constraint.ConstraintLayout
Expand Down Expand Up @@ -136,6 +136,7 @@
android:layout_width="match_parent"
android:layout_height="45dp"
android:background="@drawable/shapetwo"
android:textColor="#ffffff"
android:gravity="center"
android:visibility="gone"
app:layout_constraintEnd_toStartOf="parent"
Expand Down