Skip to content

Commit

Permalink
优化标题滚动
Browse files Browse the repository at this point in the history
  • Loading branch information
Doikki committed Mar 10, 2020
1 parent 67c49e5 commit cdaf128
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/**
* 此接口使用方法:
* 1.继承{@link AbstractPlayer}扩展自己的播放器。
* 2.继承此接口并实现${@link #createPlayer(Context)},返回步骤1中的播放器。
* 2.继承此接口并实现{@link #createPlayer(Context)},返回步骤1中的播放器。
* 可参照{@link AndroidMediaPlayer}和{@link AndroidMediaPlayerFactory}的实现。
*/
public abstract class PlayerFactory<P extends AbstractPlayer> {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,12 @@ public void onPlayerStateChanged(int playerState) {
if (activity != null && mControlWrapper.hasCutout()) {
int orientation = activity.getRequestedOrientation();
int cutoutHeight = mControlWrapper.getCutoutHeight();
LayoutParams sflp = (LayoutParams) mStopFullscreen.getLayoutParams();
if (orientation == ActivityInfo.SCREEN_ORIENTATION_PORTRAIT) {
LayoutParams sflp = (LayoutParams) mStopFullscreen.getLayoutParams();
sflp.setMargins(0, 0, 0, 0);
} else if (orientation == ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE) {
LayoutParams sflp = (LayoutParams) mStopFullscreen.getLayoutParams();
sflp.setMargins(cutoutHeight, 0, 0, 0);
} else if (orientation == ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE) {
LayoutParams sflp = (LayoutParams) mStopFullscreen.getLayoutParams();
sflp.setMargins(0, 0, 0, 0);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.dueeeke.videocontroller.MarqueeTextView;
import com.dueeeke.videocontroller.R;
import com.dueeeke.videoplayer.controller.IControlComponent;
import com.dueeeke.videoplayer.controller.ControlWrapper;
Expand All @@ -34,7 +33,7 @@ public class TitleView extends FrameLayout implements IControlComponent {
private ControlWrapper mControlWrapper;

private LinearLayout mTitleContainer;
private MarqueeTextView mTitle;
private TextView mTitle;
private TextView mSysTime;//系统当前时间

private BatteryReceiver mBatteryReceiver;
Expand Down Expand Up @@ -120,8 +119,8 @@ public void onVisibilityChanged(boolean isVisible, Animation anim) {
}
} else {
if (getVisibility() == VISIBLE) {
setVisibility(GONE);
if (anim != null) {
setVisibility(GONE);
startAnimation(anim);
}
}
Expand Down Expand Up @@ -149,10 +148,10 @@ public void onPlayerStateChanged(int playerState) {
setVisibility(VISIBLE);
mSysTime.setText(PlayerUtils.getCurrentSystemTime());
}
mTitle.setNeedFocus(true);
mTitle.setSelected(true);
} else {
setVisibility(GONE);
mTitle.setNeedFocus(false);
mTitle.setSelected(false);
}

Activity activity = PlayerUtils.scanForActivity(getContext());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,12 @@
android:padding="@dimen/dkplayer_controller_icon_padding"
android:src="@drawable/dkplayer_ic_action_arrow_back" />

<com.dueeeke.videocontroller.MarqueeTextView
<TextView
android:id="@+id/title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ellipsize="marquee"
android:focusable="true"
android:focusableInTouchMode="true"
android:marqueeRepeatLimit="marquee_forever"
android:paddingLeft="6dp"
android:paddingRight="6dp"
Expand Down

0 comments on commit cdaf128

Please sign in to comment.