I am using Google Maps in fragment using Google Support Map Fragment to replace the parent fragment container with the Maps. Below is my code..
In my Fragment Layout
<LinearLayout 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:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="com.--.--.--.fragments.LocationFragment">
<FrameLayout
android:id="@+id/locationFragMapContainer"
android:layout_width="match_parent"
android:layout_height="match_parent">
</FrameLayout>
and then in my Fragment OnCreateView()
@Override
public View onCreateView(LayoutInflater inflater,
ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_location,container,false);
/**
* Get the Child fragment and replace it in the parent fragment container
*/
mSupportMapFragment = CustomChildMapFragment.newInstance();
getChildFragmentManager().beginTransaction().replace(R.id.locationFragMapContainer,mSupportMapFragment).commit();
return view;
}
One Solution to change location button from top to bottom can be found here but I want to change the location button to the left bottom just above the Google Icon on the Maps.
// Align it to - parent BOTTOM|LEFT
params.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
params.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT, 0);
params.addRule(RelativeLayout.ALIGN_PARENT_TOP, 0);
I got the above solution from Github GIST but it doesn't seem to work out.
Is Google trying to enforce to stop bad people from overriding their Brand Logo ? Or am I doing something wrong here ?
I have no intention to override or replace Google Logo it is just the requirement that I have. I will be keeping the button above the Logo complying to guidelines