Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix audio controller fragment and overlapping fragment #458

Merged
merged 1 commit into from
Jun 22, 2020
Merged
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
Expand Up @@ -41,6 +41,7 @@
import android.support.v7.app.AppCompatActivity;
import android.view.MenuItem;
import android.view.View;
import android.widget.FrameLayout;

import com.google.android.gms.cast.framework.CastContext;
import com.google.android.gms.cast.framework.CastState;
Expand Down Expand Up @@ -584,6 +585,9 @@ protected void onResume() {

if (mCastContext.getCastState() != CastState.CONNECTED) {
setUpAudioServiceBind();
} else {
getAudioController().getView().setVisibility(View.GONE);
getFrameLayout().setVisibility(View.VISIBLE);
}
}

Expand Down Expand Up @@ -618,7 +622,12 @@ private AudioControllerFragment getAudioController() {
return (AudioControllerFragment) getSupportFragmentManager().findFragmentById(R.id.audio_controller_fragment);
}

private FrameLayout getFrameLayout() {
return (FrameLayout) findViewById(R.id.controller);
}

private void showAudioControls() {
getFrameLayout().setVisibility(View.VISIBLE);
getSupportFragmentManager().beginTransaction()
.show(getAudioController())
.commit();
Expand Down
7 changes: 4 additions & 3 deletions src/main/res/layout/activity_server_files.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,16 @@
~ along with Amahi. If not, see <http ://www.gnu.org/licenses/>.
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">

<FrameLayout
android:id="@+id/controller"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true">
android:layout_alignParentBottom="true"
android:visibility="gone">

<fragment
android:id="@+id/audio_controller_fragment"
Expand Down Expand Up @@ -59,12 +60,12 @@

<android.support.design.widget.FloatingActionButton
android:id="@+id/fab_upload"
android:contentDescription="@string/upload"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_marginBottom="25dp"
android:layout_marginEnd="25dp"
android:contentDescription="@string/upload"
android:src="@drawable/ic_add" />

</android.support.design.widget.CoordinatorLayout>
Expand Down