I have cluster google map with markers, and now when i click marker info window is opened. But i want change info window position to down and if in one place there are many things i want display a list in horizontal recycler view , and after when i click to map it should dissapear.
I Also add that now i have slide tab and in one tab i have google maps.
So it should looks like this:
Some code: This is activity for slide tabs:
public class SlideTabsActivity extends AppCompatActivity {
private SectionsPagerAdapter mSectionsPagerAdapter;
private ViewPager mViewPager;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_slide_tabs);
if(SearchObjectList.getSearchObjectList().isEmpty()){
Toast.makeText(getApplicationContext(), "Nic nie zostalo wybrane, wroc do SLideTabsActivity class aby zrobic jakas operacje gdy pusta lista",Toast.LENGTH_LONG).show();
}
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
// Create the adapter that will return a fragment for each of the three
// primary sections of the activity.
mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());
// Set up the ViewPager with the sections adapter.
mViewPager = (ViewPager) findViewById(R.id.container);
mViewPager.setAdapter(mSectionsPagerAdapter);
TabLayout tabLayout = (TabLayout) findViewById(R.id.tabs);
mViewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout));
tabLayout.addOnTabSelectedListener(new TabLayout.ViewPagerOnTabSelectedListener(mViewPager));
}
public class SectionsPagerAdapter extends FragmentPagerAdapter {
public SectionsPagerAdapter(FragmentManager fm) {
super(fm);
}
@Override
public Fragment getItem(int position) {
// getItem is called to instantiate the fragment for the given page.
switch (position){
case 0:
FirstSlideTab firstSlideTab = new FirstSlideTab();
return firstSlideTab;
case 1:
SecondSlideTab secondSlideTab = new SecondSlideTab();
return secondSlideTab;
case 2:
ThirdSlideTab thirdSlideTab = new ThirdSlideTab();
return thirdSlideTab;
default:
return null;
}
}
@Override
public int getCount() {
// Show 3 total pages.
return 3;
}
@Override
public CharSequence getPageTitle(int position) {
switch (position){
case 0:
return "FIRST";
case 1:
return "SECOND";
case 2:
return "THIRD";
}
return null;
}
}
} In SecondSlideTab i have google map and class that is responsible for cluster in google map. This is xml file of SecondSlideTab:
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="kamilmilik.flatsearch.showresultactivity.SlideTabsActivity">
<com.google.android.gms.maps.MapView
android:id="@+id/mapView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<ProgressBar
android:id="@+id/progress"
style="?android:attr/progressBarStyleLarge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@+id/mapView"
app:layout_constraintEnd_toEndOf="@+id/mapView"
app:layout_constraintStart_toStartOf="@+id/mapView"
app:layout_constraintTop_toTopOf="@+id/mapView" />
<FrameLayout
android:id="@+id/fram_info_content"
android:layout_width="match_parent"
android:clickable="true"
android:layout_height="150dp"
app:layout_constraintBottom_toBottomOf="@+id/mapView"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
/>
What I should add to get this info window? I need fragment or something else? How add it to my slide tabs and my google map view ?