diff options
author | Thomas <tschneider.ac@gmail.com> | 2023-01-14 16:21:16 +0100 |
---|---|---|
committer | Thomas <tschneider.ac@gmail.com> | 2023-01-14 16:21:16 +0100 |
commit | 27423a6ab5254d103648bd00e07ae63e207b025b (patch) | |
tree | ffcc689f5f3ebfa2ce488baa75d0e70cb27b2ad9 /app/src/main/res | |
parent | a5d1e8efe006113612fc53b3b230fb5d8964d511 (diff) |
Improve behavior
Diffstat (limited to 'app/src/main/res')
-rw-r--r-- | app/src/main/res/layout/activity_media_pager.xml | 147 | ||||
-rw-r--r-- | app/src/main/res/layout/fragment_slide_media.xml | 146 | ||||
-rw-r--r-- | app/src/main/res/values/themes.xml | 8 |
3 files changed, 122 insertions, 179 deletions
diff --git a/app/src/main/res/layout/activity_media_pager.xml b/app/src/main/res/layout/activity_media_pager.xml index d4fdbd08b..497fe1397 100644 --- a/app/src/main/res/layout/activity_media_pager.xml +++ b/app/src/main/res/layout/activity_media_pager.xml @@ -14,92 +14,83 @@ You should have received a copy of the GNU General Public License along with Fedilab; if not, see <http://www.gnu.org/licenses>. --> -<app.futured.hauler.HaulerView xmlns:android="http://schemas.android.com/apk/res/android" +<androidx.constraintlayout.widget.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/haulerView" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="@color/transparent" - app:dragUpEnabled="true"> + android:animateLayoutChanges="true" + android:background="@android:color/transparent"> - <androidx.constraintlayout.widget.ConstraintLayout + <androidx.viewpager.widget.ViewPager + android:id="@+id/media_viewpager" android:layout_width="match_parent" android:layout_height="match_parent" - android:animateLayoutChanges="true" - android:background="@android:color/transparent"> + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> - <androidx.viewpager.widget.ViewPager - android:id="@+id/media_viewpager" - android:layout_width="match_parent" - android:layout_height="match_parent" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" /> + <TextView + android:id="@+id/media_description" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_gravity="center_horizontal|bottom" + android:background="#AA000000" + android:gravity="center" + android:padding="12dp" + android:textColor="#ffffffff" + android:textIsSelectable="true" + android:visibility="gone" + app:layout_constraintBottom_toTopOf="@+id/original_message" + app:layout_constraintEnd_toStartOf="@+id/translate" + app:layout_constraintStart_toStartOf="parent" + tools:visibility="visible" /> - <TextView - android:id="@+id/media_description" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_gravity="center_horizontal|bottom" - android:background="#AA000000" - android:gravity="center" - android:padding="12dp" - android:textColor="#ffffffff" - android:textIsSelectable="true" - android:visibility="gone" - app:layout_constraintBottom_toTopOf="@+id/original_message" - app:layout_constraintEnd_toStartOf="@+id/translate" - app:layout_constraintStart_toStartOf="parent" - tools:visibility="visible" /> + <TextView + android:id="@+id/media_description_translated" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_gravity="center_horizontal|bottom" + android:layout_marginBottom="70dp" + android:background="#AA000000" + android:gravity="center" + android:padding="12dp" + android:textColor="#ffffffff" + android:textIsSelectable="true" + android:visibility="gone" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + tools:visibility="visible" /> - <TextView - android:id="@+id/media_description_translated" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_gravity="center_horizontal|bottom" - android:layout_marginBottom="70dp" - android:background="#AA000000" - android:gravity="center" - android:padding="12dp" - android:textColor="#ffffffff" - android:textIsSelectable="true" - android:visibility="gone" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - tools:visibility="visible" /> + <com.google.android.material.button.MaterialButton + android:id="@+id/translate" + style="@style/Widget.Material3.Button.IconButton" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:contentDescription="@string/translate" + android:visibility="gone" + app:icon="@drawable/ic_baseline_translate_24" + app:iconPadding="0dp" + app:layout_constraintBottom_toBottomOf="@+id/media_description" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toEndOf="@+id/media_description" + tools:visibility="visible" /> - <com.google.android.material.button.MaterialButton - android:id="@+id/translate" - style="@style/Widget.Material3.Button.IconButton" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:contentDescription="@string/translate" - android:visibility="gone" - app:icon="@drawable/ic_baseline_translate_24" - app:iconPadding="0dp" - app:layout_constraintBottom_toBottomOf="@+id/media_description" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toEndOf="@+id/media_description" - tools:visibility="visible" /> - - <TextView - android:id="@+id/original_message" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="10dp" - android:layout_marginBottom="70dp" - android:padding="5dp" - android:text="@string/view_the_original_message" - android:textSize="18sp" - android:visibility="invisible" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/translate" - tools:visibility="visible" /> - </androidx.constraintlayout.widget.ConstraintLayout> - -</app.futured.hauler.HaulerView> + <TextView + android:id="@+id/original_message" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="10dp" + android:layout_marginBottom="70dp" + android:padding="5dp" + android:text="@string/view_the_original_message" + android:textSize="18sp" + android:visibility="invisible" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/translate" + tools:visibility="visible" /> +</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/fragment_slide_media.xml b/app/src/main/res/layout/fragment_slide_media.xml index bb91ac89a..b5361e12c 100644 --- a/app/src/main/res/layout/fragment_slide_media.xml +++ b/app/src/main/res/layout/fragment_slide_media.xml @@ -1,125 +1,69 @@ <?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/main_container" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@android:color/transparent"> - <androidx.core.widget.NestedScrollView + <RelativeLayout + android:id="@+id/media_fragment_container" android:layout_width="match_parent" android:layout_height="match_parent" - android:fillViewport="true" - android:keepScreenOn="true"> - + android:background="@color/black"> + <!-- Main Loader --> <RelativeLayout - android:id="@+id/media_fragment_container" + android:id="@+id/loader" android:layout_width="match_parent" - android:layout_height="match_parent" - android:background="@color/black"> - <!-- Main Loader --> - <RelativeLayout - android:id="@+id/loader" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_alignParentTop="true" - android:gravity="center"> + android:layout_height="wrap_content" + android:layout_alignParentTop="true" + android:gravity="center"> - <ProgressBar - android:id="@+id/pbar_inf" - style="@style/Base.Widget.AppCompat.ProgressBar.Horizontal" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:indeterminate="false" - android:max="100" - android:progress="0" /> - - <TextView - android:id="@+id/loader_progress" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_gravity="center" - android:gravity="center" - android:textSize="12sp" /> - </RelativeLayout> - - <RelativeLayout - android:id="@+id/videoLayout" + <ProgressBar + android:id="@+id/pbar_inf" + style="@style/Base.Widget.AppCompat.ProgressBar.Horizontal" android:layout_width="match_parent" - android:layout_height="match_parent" - android:background="@color/black" - android:visibility="gone" /> + android:layout_height="wrap_content" + android:indeterminate="false" + android:max="100" + android:progress="0" /> - <FrameLayout - android:id="@+id/media_picture_container" + <TextView + android:id="@+id/loader_progress" android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_centerInParent="true"> - <!-- Description is set dynamically --> - <com.github.chrisbanes.photoview.PhotoView - android:id="@+id/media_picture" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:adjustViewBounds="true" - android:visibility="gone" /> - </FrameLayout> + android:layout_height="wrap_content" + android:layout_gravity="center" + android:gravity="center" + android:textSize="12sp" /> + </RelativeLayout> + <RelativeLayout + android:id="@+id/videoLayout" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:background="@color/black" + android:visibility="gone" /> - <com.google.android.exoplayer2.ui.PlayerView - android:id="@+id/media_video" + <FrameLayout + android:id="@+id/media_picture_container" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_centerInParent="true"> + <!-- Description is set dynamically --> + <com.github.chrisbanes.photoview.PhotoView + android:id="@+id/media_picture" android:layout_width="match_parent" android:layout_height="match_parent" - android:layout_centerInParent="true" + android:adjustViewBounds="true" android:visibility="gone" /> + </FrameLayout> - <ImageView - android:id="@+id/media_prev" - android:layout_width="30dp" - android:layout_height="50dp" - android:layout_alignParentStart="true" - android:layout_centerVertical="true" - android:layout_marginStart="5dp" - android:layout_marginLeft="5dp" - android:layout_marginTop="5dp" - android:layout_marginEnd="5dp" - android:layout_marginRight="5dp" - android:layout_marginBottom="5dp" - android:background="@color/transparent_grey" - android:contentDescription="@string/previous" - android:src="@drawable/ic_baseline_first_page_24" - android:visibility="gone" - app:tint="@color/white" /> - - <ImageView - android:id="@+id/media_next" - android:layout_width="30dp" - android:layout_height="50dp" - android:layout_alignParentEnd="true" - android:layout_centerVertical="true" - android:layout_marginStart="5dp" - android:layout_marginLeft="5dp" - android:layout_marginTop="5dp" - android:layout_marginEnd="5dp" - android:layout_marginRight="5dp" - android:layout_marginBottom="5dp" - android:background="@color/transparent_grey" - android:contentDescription="@string/next" - android:src="@drawable/ic_baseline_last_page_24" - android:visibility="gone" /> - + <com.google.android.exoplayer2.ui.PlayerView + android:id="@+id/media_video" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_centerInParent="true" + android:visibility="gone" /> - <TextView - android:id="@+id/message_ready" - android:layout_width="match_parent" - android:layout_height="40dp" - android:layout_alignBottom="@+id/media_picture_container" - android:layout_marginBottom="40dp" - android:background="@drawable/media_message_border" - android:gravity="center" - android:text="@string/media_ready" - android:textSize="14sp" - android:visibility="gone" /> - </RelativeLayout> - </androidx.core.widget.NestedScrollView> + </RelativeLayout> </FrameLayout> diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index d13d71d92..f3fba9825 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -90,6 +90,14 @@ <item name="android:windowIsFloating">false</item> <item name="android:windowIsTranslucent">true</item> <item name="android:windowNoTitle">true</item> + + <item name="android:windowBackground">@android:color/transparent</item> + <item name="android:windowContentTransitions">true</item> + <item name="android:windowActivityTransitions">true</item> + <item name="android:windowLayoutInDisplayCutoutMode" tools:targetApi="o_mr1">shortEdges + </item> + <item name="android:windowTranslucentStatus">true</item> + <item name="android:windowTranslucentNavigation">true</item> </style> <style name="AppThemeAlertDialog" parent="Theme.Material3.Light.Dialog.Alert"> |