Photo viewer & video player UI

This commit is contained in:
Grishka
2022-04-20 15:23:52 +03:00
parent 2e1f08a096
commit 94c864c8ac
10 changed files with 620 additions and 6 deletions

View File

@@ -0,0 +1,3 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
<path android:pathData="M18.25 20.5c0.414 0 0.75 0.337 0.75 0.75 0 0.415-0.336 0.75-0.75 0.75l-13 0.005c-0.414 0-0.75-0.336-0.75-0.75s0.336-0.75 0.75-0.75l13-0.004zM11.648 2.014l0.102-0.007c0.38 0 0.694 0.282 0.743 0.648L12.5 2.756 12.499 16.44l3.722-3.72c0.266-0.267 0.683-0.29 0.976-0.073l0.085 0.073c0.266 0.266 0.29 0.683 0.072 0.976l-0.073 0.084-4.997 4.997c-0.266 0.266-0.683 0.29-0.976 0.073l-0.085-0.073-5.003-4.996c-0.293-0.293-0.293-0.768 0-1.061 0.265-0.267 0.682-0.291 0.976-0.073L7.28 12.72l3.719 3.714L11 2.756c0-0.38 0.282-0.694 0.648-0.743l0.102-0.007-0.102 0.007z" android:fillColor="@color/fluent_default_icon_tint"/>
</vector>

View File

@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:gravity="center_vertical">
<shape>
<solid android:color="@color/gray_500"/>
<corners android:radius="1dp"/>
<size android:height="2dp"/>
</shape>
</item>
<item android:gravity="center_vertical" android:id="@android:id/secondaryProgress">
<clip>
<shape android:tint="@color/gray_50">
<solid android:color="#40000000"/>
<corners android:radius="1dp"/>
<size android:height="2dp"/>
</shape>
</clip>
</item>
<item android:gravity="center_vertical" android:id="@android:id/progress">
<clip>
<shape>
<solid android:color="@color/gray_50"/>
<corners android:radius="1dp"/>
<size android:height="2dp"/>
</shape>
</clip>
</item>
</layer-list>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval">
<solid android:color="@color/gray_25"/>
<size android:width="18dp" android:height="18dp"/>
</shape>

View File

@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="utf-8"?>
<me.grishka.appkit.views.FragmentRootLinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/photo_viewer_overlay"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:theme="@style/Theme.Mastodon.Dark">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:id="@+id/toolbar_wrap"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="top"
android:background="#80000000">
<Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?android:attr/actionBarSize"
android:elevation="0dp"
android:navigationIcon="@drawable/ic_fluent_arrow_left_24_regular"
android:navigationContentDescription="@string/back"
android:theme="@style/Theme.Mastodon.Toolbar.Profile"
android:background="@null"/>
</FrameLayout>
<RelativeLayout
android:id="@+id/video_player_controls"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="#80000000">
<SeekBar
android:id="@+id/seekbar"
android:layout_width="match_parent"
android:layout_height="34dp"
android:layout_marginTop="8dp"
android:max="10000"
android:progressDrawable="@drawable/seekbar_video_player"
android:thumb="@drawable/seekbar_video_player_thumb"/>
<ImageButton
android:id="@+id/play_pause_btn"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_below="@id/seekbar"
android:layout_alignParentStart="true"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginBottom="8dp"
android:src="@drawable/ic_pause_24"
android:tint="@color/gray_50"
android:contentDescription="@string/pause"
android:background="?android:selectableItemBackgroundBorderless"/>
<TextView
android:id="@+id/time"
android:layout_width="wrap_content"
android:layout_height="24dp"
android:layout_below="@id/seekbar"
android:layout_alignParentEnd="true"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:gravity="center_vertical"
android:textAppearance="@style/m3_body_large"
android:textColor="#fff"
tools:text="1:23 / 4:56"/>
</RelativeLayout>
</FrameLayout>
</me.grishka.appkit.views.FragmentRootLinearLayout>

View File

@@ -298,4 +298,11 @@
<string name="profile_header">Header image</string>
<string name="profile_picture">Profile picture</string>
<string name="reorder">Reorder</string>
<string name="download">Download</string>
<string name="permission_required">Permission required</string>
<string name="storage_permission_to_download">The app needs access to your storage to save this file.</string>
<string name="open_settings">Open settings</string>
<string name="error_saving_file">Error saving file</string>
<string name="file_saved">File saved</string>
<string name="downloading">Downloading…</string>
</resources>