Skip to content

Commit

Permalink
fix layout for music player style
Browse files Browse the repository at this point in the history
  • Loading branch information
theScrabi committed Mar 31, 2021
1 parent ad7a347 commit 31debf9
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 22 deletions.
10 changes: 5 additions & 5 deletions owncloudApp/src/main/res/drawable/ic_music_note_eighth.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="199.30469dp"
android:height="181.83203dp"
android:viewportWidth="199.30469"
android:viewportHeight="181.83203">
android:width="200dp"
android:height="200dp"
android:viewportWidth="200"
android:viewportHeight="200">
<path
android:pathData="M60,0V105.5C54.1,102.1 47.3,100 40,100 17.9,100 0,117.9 0,140c0,22.1 17.9,40 40,40 22.1,0 40,-17.9 40,-40V40c33.102,0 66.203,0 99.305,0v67.332c-5.9,-3.4 -12.7,-5.5 -20,-5.5 -22.1,0 -40,17.9 -40,40 0,22.1 17.9,40 40,40 22.1,0 40,-17.9 40,-40V0C152.87,0 106.435,0 60,0Z"
android:pathData="M60,8V113.5C54.1,110.1 47.3,108 40,108 17.9,108 0,125.9 0,148c0,22.1 17.9,40 40,40 22.1,0 40,-17.9 40,-40V48c33.102,0 66.203,0 99.305,0v67.332c-5.9,-3.4 -12.7,-5.5 -20,-5.5 -22.1,0 -40,17.9 -40,40 0,22.1 17.9,40 40,40 22.1,0 40,-17.9 40,-40V8C152.87,8 106.435,8 60,8Z"
android:strokeWidth="10"
android:fillColor="#cccccc"/>
</vector>
67 changes: 67 additions & 0 deletions owncloudApp/src/main/res/layout-land/preview_audio_fragment.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="utf-8"?><!--
ownCloud Android client application
Copyright (C) 2021 ownCloud GmbH.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/top"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
tools:context=".ui.preview.PreviewAudioFragment"
android:filterTouchesWhenObscured="true">


<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/visual_area"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_above="@+id/media_controller"
android:layout_gravity="center"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="@dimen/standard_padding">

<ImageView
android:id="@+id/image_preview"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintDimensionRatio="V,1:1"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:scaleType="centerCrop"
app:layout_constraintBottom_toBottomOf="parent"
android:contentDescription="@string/preview_image_description"
android:src="@drawable/ic_music_note_eighth" />

</androidx.constraintlayout.widget.ConstraintLayout>


<!-- last to draw, will be top in Z axis -->
<com.owncloud.android.media.MediaControlView
android:id="@id/media_controller"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:layout_alignParentBottom="true" />

<include layout="@layout/top_progress_bar" />

</RelativeLayout>
42 changes: 25 additions & 17 deletions owncloudApp/src/main/res/layout/preview_audio_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
ownCloud Android client application
Copyright (C) 2020 ownCloud GmbH.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
as published by the Free Software Foundation.
Expand All @@ -14,47 +14,55 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->

<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/top"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
tools:context=".ui.preview.PreviewAudioFragment"
android:filterTouchesWhenObscured="true">

<FrameLayout

<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/visual_area"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_above="@+id/media_controller"
>
android:layout_gravity="center"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="40dp">


<ImageView
android:id="@+id/image_preview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="@dimen/standard_margin"
android:layout_gravity="center"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintDimensionRatio="H,1:1"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:scaleType="centerCrop"
app:layout_constraintBottom_toBottomOf="parent"
android:contentDescription="@string/preview_image_description"
android:src="@drawable/logo" />
android:src="@drawable/ic_music_note_eighth" />

</androidx.constraintlayout.widget.ConstraintLayout>

</FrameLayout>

<!-- last to draw, will be top in Z axis -->
<com.owncloud.android.media.MediaControlView
android:id="@id/media_controller"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_margin="16dp"
/>
android:layout_alignParentBottom="true" />

<!-- last to draw, will be top in Z axis -->
<include layout="@layout/top_progress_bar" />

</RelativeLayout>

0 comments on commit 31debf9

Please sign in to comment.