fixed tweet link click
added player control
@ -7,7 +7,7 @@ buildscript {
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.github.ben-manes:gradle-versions-plugin:0.9'
|
||||
classpath 'com.android.tools.build:gradle:1.2.2'
|
||||
classpath 'com.android.tools.build:gradle:1.2.3'
|
||||
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
|
||||
classpath('fr.avianey.androidsvgdrawable:gradle-plugin:1.0.1') {
|
||||
// should be excluded to avoid conflict
|
||||
|
@ -108,7 +108,6 @@ import org.mariotaku.twidere.util.support.view.ViewOutlineProviderCompat;
|
||||
import org.mariotaku.twidere.view.ExtendedViewPager;
|
||||
import org.mariotaku.twidere.view.HomeSlidingMenu;
|
||||
import org.mariotaku.twidere.view.LeftDrawerFrameLayout;
|
||||
import org.mariotaku.twidere.view.RightDrawerFrameLayout;
|
||||
import org.mariotaku.twidere.view.TabPagerIndicator;
|
||||
import org.mariotaku.twidere.view.TintedStatusFrameLayout;
|
||||
import org.mariotaku.twidere.view.iface.IHomeActionButton;
|
||||
@ -159,7 +158,6 @@ public class HomeActivity extends BaseAppCompatActivity implements OnClickListen
|
||||
private View mActionsButton;
|
||||
private View mActionBarWithOverlay;
|
||||
private LeftDrawerFrameLayout mLeftDrawerContainer;
|
||||
private RightDrawerFrameLayout mRightDrawerContainer;
|
||||
private TintedStatusFrameLayout mColorStatusFrameLayout;
|
||||
|
||||
private UpdateUnreadCountTask mUpdateUnreadCountTask;
|
||||
@ -270,7 +268,8 @@ public class HomeActivity extends BaseAppCompatActivity implements OnClickListen
|
||||
switch (action) {
|
||||
case ACTION_NAVIGATION_PREVIOUS_TAB: {
|
||||
final int previous = mViewPager.getCurrentItem() - 1;
|
||||
if (previous < 0) {
|
||||
final int mode = mSlidingMenu.getMode();
|
||||
if (previous < 0 && (mode == SlidingMenu.LEFT || mode == SlidingMenu.LEFT_RIGHT)) {
|
||||
mSlidingMenu.showMenu(true);
|
||||
setControlBarVisibleAnimate(true);
|
||||
} else if (previous < mPagerAdapter.getCount()) {
|
||||
@ -284,7 +283,8 @@ public class HomeActivity extends BaseAppCompatActivity implements OnClickListen
|
||||
}
|
||||
case ACTION_NAVIGATION_NEXT_TAB: {
|
||||
final int next = mViewPager.getCurrentItem() + 1;
|
||||
if (next >= mPagerAdapter.getCount()) {
|
||||
final int mode = mSlidingMenu.getMode();
|
||||
if (next >= mPagerAdapter.getCount() && (mode == SlidingMenu.RIGHT || mode == SlidingMenu.LEFT_RIGHT)) {
|
||||
mSlidingMenu.showSecondaryMenu(true);
|
||||
setControlBarVisibleAnimate(true);
|
||||
} else if (next >= 0) {
|
||||
@ -438,6 +438,7 @@ public class HomeActivity extends BaseAppCompatActivity implements OnClickListen
|
||||
final ContentResolver resolver = getContentResolver();
|
||||
resolver.registerContentObserver(Accounts.CONTENT_URI, true, mAccountChangeObserver);
|
||||
final Bus bus = TwidereApplication.getInstance(this).getMessageBus();
|
||||
assert bus != null;
|
||||
bus.register(this);
|
||||
// UCD
|
||||
ProfilingUtil.profile(this, ProfilingUtil.FILE_NAME_APP, "App onStart");
|
||||
@ -472,6 +473,7 @@ public class HomeActivity extends BaseAppCompatActivity implements OnClickListen
|
||||
mMultiSelectHandler.dispatchOnStop();
|
||||
mReadStateManager.unregisterOnSharedPreferenceChangeListener(mReadStateChangeListener);
|
||||
final Bus bus = TwidereApplication.getInstance(this).getMessageBus();
|
||||
assert bus != null;
|
||||
bus.unregister(this);
|
||||
final ContentResolver resolver = getContentResolver();
|
||||
resolver.unregisterContentObserver(mAccountChangeObserver);
|
||||
@ -841,7 +843,7 @@ public class HomeActivity extends BaseAppCompatActivity implements OnClickListen
|
||||
final Resources res = getResources();
|
||||
final int marginThreshold = res.getDimensionPixelSize(R.dimen.default_sliding_menu_margin_threshold);
|
||||
final boolean relativeBehindWidth = res.getBoolean(R.bool.relative_behind_width);
|
||||
mSlidingMenu.setMode(SlidingMenu.LEFT_RIGHT);
|
||||
mSlidingMenu.setMode(SlidingMenu.LEFT);
|
||||
mSlidingMenu.setShadowWidthRes(R.dimen.default_sliding_menu_shadow_width);
|
||||
mSlidingMenu.setShadowDrawable(R.drawable.shadow_left);
|
||||
mSlidingMenu.setSecondaryShadowDrawable(R.drawable.shadow_right);
|
||||
@ -853,17 +855,12 @@ public class HomeActivity extends BaseAppCompatActivity implements OnClickListen
|
||||
mSlidingMenu.setTouchmodeMarginThreshold(marginThreshold);
|
||||
mSlidingMenu.setFadeDegree(0.5f);
|
||||
mSlidingMenu.setMenu(R.layout.drawer_home_accounts);
|
||||
mSlidingMenu.setSecondaryMenu(R.layout.drawer_home_quick_menu);
|
||||
mSlidingMenu.setOnOpenedListener(this);
|
||||
mSlidingMenu.setOnClosedListener(this);
|
||||
mLeftDrawerContainer = (LeftDrawerFrameLayout) mSlidingMenu.getMenu().findViewById(R.id.left_drawer_container);
|
||||
mRightDrawerContainer = (RightDrawerFrameLayout) mSlidingMenu.getSecondaryMenu().findViewById(
|
||||
R.id.right_drawer_container);
|
||||
final boolean isTransparentBackground = ThemeUtils.isTransparentBackground(getCurrentThemeBackgroundOption());
|
||||
mLeftDrawerContainer.setClipEnabled(isTransparentBackground);
|
||||
mLeftDrawerContainer.setScrollScale(mSlidingMenu.getBehindScrollScale());
|
||||
mRightDrawerContainer.setClipEnabled(isTransparentBackground);
|
||||
mRightDrawerContainer.setScrollScale(mSlidingMenu.getBehindScrollScale());
|
||||
mSlidingMenu.setBehindCanvasTransformer(new ListenerCanvasTransformer(this));
|
||||
final Window window = getWindow();
|
||||
ThemeUtils.applyWindowBackground(this, mSlidingMenu.getContent(), getCurrentThemeResourceId(),
|
||||
@ -942,9 +939,8 @@ public class HomeActivity extends BaseAppCompatActivity implements OnClickListen
|
||||
}
|
||||
|
||||
private void updateDrawerPercentOpen(final float percentOpen, final boolean horizontalScroll) {
|
||||
if (mLeftDrawerContainer == null || mRightDrawerContainer == null) return;
|
||||
if (mLeftDrawerContainer == null) return;
|
||||
mLeftDrawerContainer.setPercentOpen(percentOpen);
|
||||
mRightDrawerContainer.setPercentOpen(percentOpen);
|
||||
}
|
||||
|
||||
private void updateSlidingMenuTouchMode() {
|
||||
|
@ -51,8 +51,11 @@ import android.view.View.OnClickListener;
|
||||
import android.view.View.OnGenericMotionListener;
|
||||
import android.view.ViewGroup;
|
||||
import android.webkit.MimeTypeMap;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.MediaController;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.SeekBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.davemorrissey.labs.subscaleview.ImageSource;
|
||||
import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView;
|
||||
@ -553,7 +556,7 @@ public final class MediaViewerActivity extends BaseAppCompatActivity implements
|
||||
}
|
||||
|
||||
public static final class VideoPageFragment extends BaseSupportFragment
|
||||
implements VideoLoadingListener, OnPreparedListener, OnErrorListener, OnCompletionListener {
|
||||
implements VideoLoadingListener, OnPreparedListener, OnErrorListener, OnCompletionListener, OnClickListener {
|
||||
|
||||
private static final String[] SUPPORTED_VIDEO_TYPES;
|
||||
|
||||
@ -568,7 +571,9 @@ public final class MediaViewerActivity extends BaseAppCompatActivity implements
|
||||
private VideoLoader mVideoLoader;
|
||||
|
||||
private TextureVideoView mVideoView;
|
||||
private ProgressBar mVideoViewProgress;
|
||||
private SeekBar mVideoViewProgress;
|
||||
private TextView mDurationLabel, mPositionLabel;
|
||||
private ImageButton mPlayPauseButton, mVolumeButton;
|
||||
|
||||
private boolean mPlayAudio;
|
||||
private VideoPlayProgressRunnable mVideoProgressRunnable;
|
||||
@ -576,6 +581,7 @@ public final class MediaViewerActivity extends BaseAppCompatActivity implements
|
||||
private File mVideoFile;
|
||||
private Pair<String, String> mVideoUrlAndType;
|
||||
private ProgressWheel mProgressBar;
|
||||
private MediaPlayer mMediaPlayer;
|
||||
|
||||
public boolean isLoopEnabled() {
|
||||
return getArguments().getBoolean(EXTRA_LOOP, false);
|
||||
@ -588,14 +594,26 @@ public final class MediaViewerActivity extends BaseAppCompatActivity implements
|
||||
mVideoLoader.loadVideo(urlAndType.first, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStop() {
|
||||
super.onStop();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCompletion(MediaPlayer mp) {
|
||||
mMediaPlayer = null;
|
||||
// mVideoViewProgress.removeCallbacks(mVideoProgressRunnable);
|
||||
// mVideoViewProgress.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onError(MediaPlayer mp, int what, int extra) {
|
||||
mMediaPlayer = null;
|
||||
mVideoViewProgress.removeCallbacks(mVideoProgressRunnable);
|
||||
mVideoViewProgress.setVisibility(View.GONE);
|
||||
return true;
|
||||
@ -604,16 +622,28 @@ public final class MediaViewerActivity extends BaseAppCompatActivity implements
|
||||
@Override
|
||||
public void onPrepared(MediaPlayer mp) {
|
||||
if (getUserVisibleHint()) {
|
||||
mMediaPlayer = mp;
|
||||
mp.setAudioStreamType(AudioManager.STREAM_MUSIC);
|
||||
if (mPlayAudio) {
|
||||
mp.setVolume(1, 1);
|
||||
} else {
|
||||
mp.setVolume(0, 0);
|
||||
}
|
||||
updateVolume();
|
||||
mp.setLooping(isLoopEnabled());
|
||||
mp.start();
|
||||
mVideoViewProgress.setVisibility(View.VISIBLE);
|
||||
mVideoViewProgress.post(mVideoProgressRunnable);
|
||||
updatePlayerState();
|
||||
}
|
||||
}
|
||||
|
||||
private void updateVolume() {
|
||||
final ImageButton b = mVolumeButton;
|
||||
if (b != null) {
|
||||
b.setImageResource(mPlayAudio ? R.drawable.ic_action_speaker_max : R.drawable.ic_action_speaker_muted);
|
||||
}
|
||||
final MediaPlayer mp = mMediaPlayer;
|
||||
if (mp == null) return;
|
||||
if (mPlayAudio) {
|
||||
mp.setVolume(1, 1);
|
||||
} else {
|
||||
mp.setVolume(0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -628,8 +658,12 @@ public final class MediaViewerActivity extends BaseAppCompatActivity implements
|
||||
public void onBaseViewCreated(View view, Bundle savedInstanceState) {
|
||||
super.onBaseViewCreated(view, savedInstanceState);
|
||||
mVideoView = (TextureVideoView) view.findViewById(R.id.video_view);
|
||||
mVideoViewProgress = (ProgressBar) view.findViewById(R.id.video_view_progress);
|
||||
mVideoViewProgress = (SeekBar) view.findViewById(R.id.video_view_progress);
|
||||
mProgressBar = (ProgressWheel) view.findViewById(R.id.load_progress);
|
||||
mDurationLabel = (TextView) view.findViewById(R.id.duration_label);
|
||||
mPositionLabel = (TextView) view.findViewById(R.id.position_label);
|
||||
mPlayPauseButton = (ImageButton) view.findViewById(R.id.play_pause_button);
|
||||
mVolumeButton = (ImageButton) view.findViewById(R.id.volume_button);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -671,6 +705,7 @@ public final class MediaViewerActivity extends BaseAppCompatActivity implements
|
||||
super.setUserVisibleHint(isVisibleToUser);
|
||||
if (!isVisibleToUser && mVideoView != null && mVideoView.isPlaying()) {
|
||||
mVideoView.pause();
|
||||
updatePlayerState();
|
||||
}
|
||||
}
|
||||
|
||||
@ -679,14 +714,23 @@ public final class MediaViewerActivity extends BaseAppCompatActivity implements
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
setHasOptionsMenu(true);
|
||||
mVideoLoader = TwidereApplication.getInstance(getActivity()).getVideoLoader();
|
||||
mVideoProgressRunnable = new VideoPlayProgressRunnable(mVideoViewProgress.getHandler(),
|
||||
mVideoViewProgress, mVideoView);
|
||||
|
||||
Handler handler = mVideoViewProgress.getHandler();
|
||||
if (handler == null) {
|
||||
handler = new Handler(getActivity().getMainLooper());
|
||||
}
|
||||
mVideoProgressRunnable = new VideoPlayProgressRunnable(handler, mVideoViewProgress,
|
||||
mDurationLabel, mPositionLabel, mVideoView);
|
||||
|
||||
|
||||
mVideoView.setOnPreparedListener(this);
|
||||
mVideoView.setOnErrorListener(this);
|
||||
mVideoView.setOnCompletionListener(this);
|
||||
|
||||
mPlayPauseButton.setOnClickListener(this);
|
||||
mVolumeButton.setOnClickListener(this);
|
||||
loadVideo();
|
||||
updateVolume();
|
||||
}
|
||||
|
||||
private Pair<String, String> getBestVideoUrlAndType(ParcelableMedia media) {
|
||||
@ -732,16 +776,51 @@ public final class MediaViewerActivity extends BaseAppCompatActivity implements
|
||||
mSaveFileTask = AsyncTaskUtils.executeTask(new SaveFileTask(getActivity(), file, mimeType, saveDir));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.volume_button: {
|
||||
mPlayAudio = !mPlayAudio;
|
||||
updateVolume();
|
||||
break;
|
||||
}
|
||||
case R.id.play_pause_button: {
|
||||
final MediaPlayer mp = mMediaPlayer;
|
||||
if (mp != null) {
|
||||
if (mp.isPlaying()) {
|
||||
mp.pause();
|
||||
} else {
|
||||
mp.start();
|
||||
}
|
||||
}
|
||||
updatePlayerState();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void updatePlayerState() {
|
||||
final MediaPlayer mp = mMediaPlayer;
|
||||
if (mp != null) {
|
||||
mPlayPauseButton.setImageResource(mp.isPlaying() ? R.drawable.ic_action_pause : R.drawable.ic_action_play_arrow);
|
||||
} else {
|
||||
mPlayPauseButton.setImageResource(R.drawable.ic_action_play_arrow);
|
||||
}
|
||||
}
|
||||
|
||||
private static class VideoPlayProgressRunnable implements Runnable {
|
||||
|
||||
private final Handler mHandler;
|
||||
private final ProgressBar mProgressBar;
|
||||
private final TextView mDurationLabel, mPositionLabel;
|
||||
private final MediaController.MediaPlayerControl mMediaPlayerControl;
|
||||
|
||||
VideoPlayProgressRunnable(Handler handler, ProgressBar progressBar,
|
||||
MediaController.MediaPlayerControl mediaPlayerControl) {
|
||||
VideoPlayProgressRunnable(Handler handler, ProgressBar progressBar, TextView durationLabel,
|
||||
TextView positionLabel, MediaController.MediaPlayerControl mediaPlayerControl) {
|
||||
mHandler = handler;
|
||||
mProgressBar = progressBar;
|
||||
mDurationLabel = durationLabel;
|
||||
mPositionLabel = positionLabel;
|
||||
mMediaPlayerControl = mediaPlayerControl;
|
||||
mProgressBar.setMax(1000);
|
||||
}
|
||||
@ -752,6 +831,9 @@ public final class MediaViewerActivity extends BaseAppCompatActivity implements
|
||||
final int position = mMediaPlayerControl.getCurrentPosition();
|
||||
if (duration <= 0 || position < 0) return;
|
||||
mProgressBar.setProgress(Math.round(1000 * position / (float) duration));
|
||||
final int durationSecs = duration / 1000, positionSecs = position / 1000;
|
||||
mDurationLabel.setText(String.format("%02d:%02d", durationSecs / 60, durationSecs % 60));
|
||||
mPositionLabel.setText(String.format("%02d:%02d", positionSecs / 60, positionSecs % 60));
|
||||
mHandler.postDelayed(this, 16);
|
||||
}
|
||||
}
|
||||
|
@ -57,6 +57,7 @@ import android.support.v7.widget.RecyclerView.ViewHolder;
|
||||
import android.text.Html;
|
||||
import android.text.Spanned;
|
||||
import android.text.TextUtils;
|
||||
import android.text.method.ArrowKeyMovementMethod;
|
||||
import android.text.method.LinkMovementMethod;
|
||||
import android.view.Gravity;
|
||||
import android.view.KeyEvent;
|
||||
@ -824,11 +825,11 @@ public class StatusFragment extends BaseSupportFragment implements LoaderCallbac
|
||||
|
||||
Utils.setMenuForStatus(context, menuBar.getMenu(), status, adapter.getStatusAccount());
|
||||
|
||||
quoteTextView.setTextIsSelectable(true);
|
||||
textView.setTextIsSelectable(true);
|
||||
quoteTextView.setTextIsSelectable(true);
|
||||
|
||||
quoteTextView.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
textView.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
textView.setMovementMethod(ArrowKeyMovementMethod.getInstance());
|
||||
quoteTextView.setMovementMethod(ArrowKeyMovementMethod.getInstance());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -54,13 +54,16 @@ public class DataImportExportUtils implements Constants {
|
||||
public static final String ENTRY_USER_COLORS = "user_colors.json";
|
||||
public static final String ENTRY_HOST_MAPPING = "host_mapping.json";
|
||||
public static final String ENTRY_KEYBOARD_SHORTCUTS = "keyboard_shortcuts.json";
|
||||
public static final String ENTRY_FILTERS = "filters.json";
|
||||
|
||||
public static final int FLAG_PREFERENCES = 0x1;
|
||||
public static final int FLAG_NICKNAMES = 0x2;
|
||||
public static final int FLAG_USER_COLORS = 0x4;
|
||||
public static final int FLAG_HOST_MAPPING = 0x8;
|
||||
public static final int FLAG_KEYBOARD_SHORTCUTS = 0x10;
|
||||
public static final int FLAG_ALL = FLAG_PREFERENCES | FLAG_NICKNAMES | FLAG_USER_COLORS | FLAG_HOST_MAPPING | FLAG_KEYBOARD_SHORTCUTS;
|
||||
public static final int FLAG_FILTERS = 0x20;
|
||||
public static final int FLAG_ALL = FLAG_PREFERENCES | FLAG_NICKNAMES | FLAG_USER_COLORS
|
||||
| FLAG_HOST_MAPPING | FLAG_KEYBOARD_SHORTCUTS | FLAG_FILTERS;
|
||||
|
||||
public static void exportData(final Context context, final File dst, final int flags) throws IOException {
|
||||
if (dst == null) throw new FileNotFoundException();
|
||||
@ -107,6 +110,9 @@ public class DataImportExportUtils implements Constants {
|
||||
if (zipFile.getEntry(ENTRY_KEYBOARD_SHORTCUTS) != null) {
|
||||
flags |= FLAG_KEYBOARD_SHORTCUTS;
|
||||
}
|
||||
if (zipFile.getEntry(ENTRY_FILTERS) != null) {
|
||||
flags |= FLAG_FILTERS;
|
||||
}
|
||||
zipFile.close();
|
||||
return flags;
|
||||
}
|
||||
@ -145,6 +151,9 @@ public class DataImportExportUtils implements Constants {
|
||||
}
|
||||
if (hasFlag(flags, FLAG_KEYBOARD_SHORTCUTS)) {
|
||||
importSharedPreferencesData(zipFile, context, KEYBOARD_SHORTCUTS_PREFERENCES_NAME, ENTRY_KEYBOARD_SHORTCUTS, ConvertToStringProcessStrategy.SINGLETON);
|
||||
}
|
||||
if (hasFlag(flags,FLAG_FILTERS)) {
|
||||
|
||||
}
|
||||
zipFile.close();
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ import android.util.AttributeSet;
|
||||
import org.mariotaku.twidere.text.SafeSpannableString;
|
||||
import org.mariotaku.twidere.text.SafeSpannableStringBuilder;
|
||||
|
||||
public class StatusTextView extends AppCompatTextView {
|
||||
public class StatusTextView extends HandleSpanClickTextView {
|
||||
|
||||
public StatusTextView(final Context context) {
|
||||
this(context, null);
|
||||
|
BIN
twidere/src/main/res-svg2png/drawable-hdpi/ic_action_pause.png
Normal file
After Width: | Height: | Size: 258 B |
After Width: | Height: | Size: 473 B |
After Width: | Height: | Size: 724 B |
After Width: | Height: | Size: 788 B |
BIN
twidere/src/main/res-svg2png/drawable-mdpi/ic_action_pause.png
Normal file
After Width: | Height: | Size: 223 B |
After Width: | Height: | Size: 380 B |
After Width: | Height: | Size: 507 B |
After Width: | Height: | Size: 615 B |
BIN
twidere/src/main/res-svg2png/drawable-xhdpi/ic_action_pause.png
Normal file
After Width: | Height: | Size: 255 B |
After Width: | Height: | Size: 543 B |
After Width: | Height: | Size: 868 B |
After Width: | Height: | Size: 938 B |
BIN
twidere/src/main/res-svg2png/drawable-xxhdpi/ic_action_pause.png
Normal file
After Width: | Height: | Size: 289 B |
After Width: | Height: | Size: 642 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 337 B |
After Width: | Height: | Size: 731 B |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 401 B |
Before Width: | Height: | Size: 291 B |
Before Width: | Height: | Size: 588 B |
Before Width: | Height: | Size: 595 B |
29
twidere/src/main/res/drawable/bg_shadow_video_player.xml
Normal file
@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
~ Twidere - Twitter client for Android
|
||||
~
|
||||
~ Copyright (C) 2012-2015 Mariotaku Lee <mariotaku.lee@gmail.com>
|
||||
~
|
||||
~ This program is free software: you can redistribute it and/or modify
|
||||
~ it under the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation, either version 3 of the License, or
|
||||
~ (at your option) ny later version.
|
||||
~
|
||||
~ 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/>.
|
||||
-->
|
||||
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<gradient
|
||||
android:angle="270"
|
||||
android:centerColor="#30000000"
|
||||
android:endColor="#80000000"
|
||||
android:centerX="0.7"
|
||||
android:startColor="#00000000" />
|
||||
|
||||
</shape>
|
@ -18,9 +18,8 @@
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
<FrameLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:animateLayoutChanges="true">
|
||||
@ -34,19 +33,65 @@
|
||||
android:id="@+id/video_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"/>
|
||||
android:layout_centerInParent="true" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/video_view_progress"
|
||||
style="?android:progressBarStyleHorizontal"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/element_spacing_xsmall"
|
||||
android:layout_alignBottom="@+id/video_view"
|
||||
android:layout_gravity="bottom"
|
||||
android:background="@color/bg_color_video_playback_progress"
|
||||
android:indeterminateDrawable="@android:color/transparent"
|
||||
android:progressDrawable="@drawable/progress_bar_video"
|
||||
android:visibility="gone"/>
|
||||
android:layout_height="@dimen/height_player_control_panel"
|
||||
android:layout_alignBottom="@id/video_view"
|
||||
android:background="@drawable/bg_shadow_video_player"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/play_pause_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0"
|
||||
android:background="?selectableItemBackgroundBorderless"
|
||||
android:clickable="true"
|
||||
android:minWidth="@dimen/element_size_normal"
|
||||
android:src="@drawable/ic_action_play_arrow" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/position_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0"
|
||||
android:gravity="center"
|
||||
android:minWidth="@dimen/element_size_normal"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
tools:text="12:34" />
|
||||
|
||||
<SeekBar
|
||||
android:id="@+id/video_view_progress"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/duration_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0"
|
||||
android:gravity="center"
|
||||
android:minWidth="@dimen/element_size_normal"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
tools:text="27:56" />
|
||||
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/volume_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0"
|
||||
android:background="?selectableItemBackgroundBorderless"
|
||||
android:clickable="true"
|
||||
android:minWidth="@dimen/element_size_normal"
|
||||
android:src="@drawable/ic_action_speaker_max" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
@ -95,4 +95,6 @@
|
||||
<dimen name="activity_horizontal_margin">16dp</dimen>
|
||||
<dimen name="activity_vertical_margin">16dp</dimen>
|
||||
|
||||
<dimen name="height_player_control_panel">40dp</dimen>
|
||||
|
||||
</resources>
|
4
twidere/src/main/svg-png/ic_action_pause-mdpi.svg
Normal file
@ -0,0 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
||||
<path transform="translate(4,4)" fill="white" d="M6 19h4V5H6v14zm8-14v14h4V5h-4z"/>
|
||||
<path transform="translate(4,4)" fill="none" d="M0 0h24v24h-24z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 250 B |
4
twidere/src/main/svg-png/ic_action_play_arrow-mdpi.svg
Normal file
@ -0,0 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
||||
<path transform="translate(4,4)" fill="white" d="M8 5v14l11-7z"/>
|
||||
<path transform="translate(4,4)" fill="none" d="M0 0h24v24h-24z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 232 B |
4
twidere/src/main/svg-png/ic_action_speaker_max-mdpi.svg
Normal file
@ -0,0 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
||||
<path transform="translate(4,4)" fill="white" d="M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z"/>
|
||||
<path transform="translate(4,4)" fill="none" d="M0 0h24v24H0z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 404 B |
@ -0,0 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
||||
<path transform="translate(4,4)" fill="white" d="M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zM4.27 3L3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9L4.27 3zM12 4L9.91 6.09 12 8.18V4z"/>
|
||||
<path transform="translate(4,4)" fill="none" d="M0 0h24v24H0z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 568 B |