Enable sharing media directly from Tusky (#852)
* Extract duplicated code into BaseActivity * Migrate MediaUtils to kotlin * Migrate ViewVideoActivity to kotlin * Migrate ViewMediaActivity to kotlin * Initial media sharing functionality * Address code review feedback * Make share icon match * Address code review feedback
This commit is contained in:
parent
ab601c4566
commit
0bca94b94e
18 changed files with 785 additions and 690 deletions
25
app/src/main/res/drawable/ic_menu_share_24dp.xml
Normal file
25
app/src/main/res/drawable/ic_menu_share_24dp.xml
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
<!--
|
||||
Copyright (C) 2014 The Android Open Source Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0"
|
||||
>
|
||||
<path
|
||||
android:pathData="M18,16.1c-0.8,0 -1.5,0.3 -2,0.8l-7.1,-4.2C9,12.5 9,12.2 9,12s0,-0.5 -0.1,-0.7L16,7.2C16.5,7.7 17.200001,8 18,8c1.7,0 3,-1.3 3,-3s-1.3,-3 -3,-3s-3,1.3 -3,3c0,0.2 0,0.5 0.1,0.7L8,9.8C7.5,9.3 6.8,9 6,9c-1.7,0 -2.9,1.2 -2.9,2.9s1.3,3 3,3c0.8,0 1.5,-0.3 2,-0.8l7.1,4.2c-0.1,0.3 -0.1,0.5 -0.1,0.7c0,1.6 1.3,2.9 2.9,2.9s2.9,-1.3 2.9,-2.9S19.6,16.1 18,16.1z"
|
||||
android:fillColor="#FFF"/>
|
||||
</vector>
|
||||
|
|
@ -9,7 +9,7 @@
|
|||
<com.keylesspalace.tusky.view.ImageViewPager
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/view_pager" />
|
||||
android:id="@+id/viewPager" />
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
|
|
|
|||
|
|
@ -9,12 +9,12 @@
|
|||
android:id="@+id/view_video_container"
|
||||
tools:context=".ViewVideoActivity">
|
||||
<VideoView
|
||||
android:id="@+id/video_player"
|
||||
android:id="@+id/videoPlayer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center" />
|
||||
<ProgressBar
|
||||
android:id="@+id/video_progress"
|
||||
android:id="@+id/videoProgressBar"
|
||||
android:layout_gravity="center"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
|
@ -23,6 +23,6 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:theme="@style/AppTheme.Account.AppBarLayout"
|
||||
app:popupTheme="@style/AppTheme.Account.ToolbarPopupTheme.Dark"
|
||||
android:background="@color/semi_transparent" />
|
||||
app:popupTheme="?attr/toolbar_popup_theme"
|
||||
android:background="@color/toolbar_view_media" />
|
||||
</android.support.design.widget.CoordinatorLayout>
|
||||
|
|
@ -6,6 +6,11 @@
|
|||
android:icon="@drawable/ic_file_download_black_24dp"
|
||||
android:title="@string/dialog_download_image"
|
||||
app:showAsAction="ifRoom" />
|
||||
<item
|
||||
android:id="@+id/action_share_media"
|
||||
android:icon="@drawable/ic_menu_share_24dp"
|
||||
android:title="@string/action_share"
|
||||
app:showAsAction="ifRoom" />
|
||||
<item
|
||||
android:id="@+id/action_open_status"
|
||||
android:title="@string/action_open_toot"
|
||||
|
|
|
|||
|
|
@ -114,6 +114,7 @@
|
|||
|
||||
<string name="send_status_link_to">Share toot URL to…</string>
|
||||
<string name="send_status_content_to">Share toot to…</string>
|
||||
<string name="send_media_to">Share media to…</string>
|
||||
|
||||
<string name="confirmation_reported">Sent!</string>
|
||||
<string name="confirmation_unblocked">User unblocked</string>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue