I want to implement the functionality that is in the Google Map application for Android. When you "click" on the marker on the map, a panel with information pops out below.

Unlike the application that Google wrote, I don’t need to “pull” it after that so that the bottom panel would “turn around” to full screen. This panel must be a fixed height. I solved this problem.

But now I need to fix Floating Action Button on this panel. As shown in the picture below:

enter image description here

activity_main.xml:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@android:color/holo_orange_light" tools:context=".MainActivity"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="@android:color/background_dark" android:text="@string/hello_world" /> <FrameLayout android:id="@+id/container" android:layout_height="100dp" android:layout_width="match_parent" android:layout_alignParentBottom="true" android:layout_alignParentLeft="true" android:layout_alignParentStart="true"> android:translationY="100dp" </FrameLayout> </RelativeLayout> 

fragment1.xml:

 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#FFF"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Panel" android:textColor="#0000DD" android:textStyle="bold" android:layout_centerHorizontal="true" android:padding="5dp" /> </RelativeLayout> 

Fragment1.java:

 public class Fragment1 extends Fragment { public static final String TAG = "FRAGMENT1"; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { return inflater.inflate(R.layout.fragment1, container, false); } } 

MainActivity.java:

 public class MainActivity extends AppCompatActivity { private Fragment1 fragment1; private FragmentManager fragmentManager; private FragmentTransaction fragmentTransaction; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); fragmentManager = getSupportFragmentManager(); fragment1 = new Fragment1(); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.menu_main, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); //noinspection SimplifiableIfStatement if (id == R.id.action_settings) { if (fragmentManager.findFragmentByTag(Fragment1.TAG) == null) { fragmentTransaction = fragmentManager.beginTransaction(); fragmentTransaction.setCustomAnimations(R.anim.slide_in_bottom, R.anim.slide_out_bottom); fragmentTransaction.add(R.id.container, fragment1, Fragment1.TAG); fragmentTransaction.commit(); } else { fragmentTransaction = fragmentManager.beginTransaction(); fragmentTransaction.setCustomAnimations(R.anim.slide_in_bottom, R.anim.slide_out_bottom); fragmentTransaction.remove(fragment1); fragmentTransaction.commit(); } return true; } return super.onOptionsItemSelected(item); } } 

I would be grateful for any ideas and solutions. The application should work with version 4.0.3.

    0