Skip to content

Commit

Permalink
1.rename resources,prevent duplicate names
Browse files Browse the repository at this point in the history
2.globalization
  • Loading branch information
Doikki committed Jul 18, 2018
1 parent 91ad411 commit eaed2d8
Show file tree
Hide file tree
Showing 141 changed files with 152 additions and 96 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import android.support.annotation.Nullable;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.view.MenuItem;
import android.view.View;

import com.dueeeke.dkplayer.R;
Expand Down Expand Up @@ -36,6 +37,14 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
}
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == android.R.id.home) {
finish();
}
return super.onOptionsItemSelected(item);
}

public void skipToVodPlayer(View view) {
// String path = Environment.getExternalStorageDirectory().getAbsolutePath();
// String url = "file://" + path + File.separator + "test.mp4";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import android.support.annotation.Nullable;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.view.MenuItem;
import android.view.View;

import com.dueeeke.dkplayer.R;
Expand All @@ -27,6 +28,14 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
}
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == android.R.id.home) {
finish();
}
return super.onOptionsItemSelected(item);
}

public void startFullScreen(View view) {
startActivity(new Intent(this, FullScreenActivity.class));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import android.support.annotation.Nullable;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.view.MenuItem;
import android.view.View;

import com.dueeeke.dkplayer.R;
Expand All @@ -27,6 +28,14 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
}
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == android.R.id.home) {
finish();
}
return super.onOptionsItemSelected(item);
}

public void list(View view) {
startActivity(new Intent(this, ListViewActivity.class));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,21 +81,21 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
public void onVideoPaused() {
super.onVideoPaused();
updatePictureInPictureActions(
R.drawable.ic_action_play_arrow, "播放", CONTROL_TYPE_PLAY, REQUEST_PLAY);
R.drawable.dkplayer_ic_action_play_arrow, "播放", CONTROL_TYPE_PLAY, REQUEST_PLAY);
}

@Override
public void onVideoStarted() {
super.onVideoStarted();
updatePictureInPictureActions(
R.drawable.ic_action_pause, "暂停", CONTROL_TYPE_PAUSE, REQUEST_PAUSE);
R.drawable.dkplayer_ic_action_pause, "暂停", CONTROL_TYPE_PAUSE, REQUEST_PAUSE);
}

@Override
public void onComplete() {
super.onComplete();
updatePictureInPictureActions(
R.drawable.ic_action_replay, "重新播放", CONTROL_TYPE_PLAY, REQUEST_PLAY);
R.drawable.dkplayer_ic_action_replay, "重新播放", CONTROL_TYPE_PLAY, REQUEST_PLAY);
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
Glide.with(this)
.load("http://sh.people.com.cn/NMediaFile/2016/0112/LOCAL201601121344000138197365721.jpg")
.asBitmap()
.animate(R.anim.anim_player_alpha_in)
.animate(R.anim.dkplayer_anim_alpha_in)
.placeholder(android.R.color.darker_gray)
.into(controller.getThumb());
ijkVideoView.setUrl(URL);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import android.support.annotation.Nullable;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.view.MenuItem;
import android.view.View;
import android.widget.Toast;

Expand All @@ -24,6 +25,14 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
}
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == android.R.id.home) {
finish();
}
return super.onOptionsItemSelected(item);
}


public void pip(View view) {
startActivity(new Intent(this, PIPActivity.class));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ public class FullScreenController extends GestureVideoController implements View
private ImageView playButton;
private ProgressBar loadingProgress;
private LinearLayout completeContainer;
private Animation showAnim = AnimationUtils.loadAnimation(getContext(), R.anim.anim_player_alpha_in);
private Animation hideAnim = AnimationUtils.loadAnimation(getContext(), R.anim.anim_player_alpha_out);
private Animation showAnim = AnimationUtils.loadAnimation(getContext(), R.anim.dkplayer_anim_alpha_in);
private Animation hideAnim = AnimationUtils.loadAnimation(getContext(), R.anim.dkplayer_anim_alpha_out);


public FullScreenController(@NonNull Context context) {
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions app/src/main/res/layout/item_float_video.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
android:layout_width="@dimen/player_play_btn_size"
android:layout_height="@dimen/player_play_btn_size"
android:layout_gravity="center"
android:background="@drawable/shape_play_bg"
android:background="@drawable/dkplayer_shape_play_bg"
android:padding="@dimen/player_default_spacing"
android:src="@drawable/selector_play_button" />
android:src="@drawable/dkplayer_selector_play_button" />
</FrameLayout>

</FrameLayout>
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/res/layout/layout_ad_controller.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<ImageView
android:id="@+id/back"
style="@style/adIcon"
android:src="@drawable/ic_action_arrow_back" />
android:src="@drawable/dkplayer_ic_action_arrow_back" />

<TextView
android:id="@+id/ad_time"
Expand All @@ -31,7 +31,7 @@
<ImageView
android:id="@+id/iv_play"
style="@style/adIcon"
android:src="@drawable/selector_play_button" />
android:src="@drawable/dkplayer_selector_play_button" />

<View
android:layout_width="0dp"
Expand All @@ -51,6 +51,6 @@
<ImageView
android:id="@+id/fullscreen"
style="@style/adIcon"
android:src="@drawable/selector_full_screen_button" />
android:src="@drawable/dkplayer_selector_full_screen_button" />
</LinearLayout>
</FrameLayout>
10 changes: 5 additions & 5 deletions app/src/main/res/layout/layout_float_controller.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
android:layout_width="@dimen/player_play_btn_size"
android:layout_height="@dimen/player_play_btn_size"
android:layout_gravity="center"
android:background="@drawable/shape_play_bg"
android:background="@drawable/dkplayer_shape_play_bg"
android:padding="@dimen/player_default_spacing"
android:src="@drawable/selector_play_button" />
android:src="@drawable/dkplayer_selector_play_button" />

<ProgressBar
android:id="@+id/loading"
android:layout_width="@dimen/player_play_btn_size"
android:layout_height="@dimen/player_play_btn_size"
android:layout_gravity="center"
android:indeterminateDrawable="@drawable/progress_loading"
android:indeterminateDrawable="@drawable/dkplayer_progress_loading"
android:visibility="gone"
tools:visibility="visible" />
<ImageView
Expand All @@ -26,12 +26,12 @@
android:layout_height="20dp"
android:layout_gravity="end"
android:layout_margin="4dp"
android:src="@drawable/ic_action_close" />
android:src="@drawable/dkplayer_ic_action_close" />
<ImageView
android:id="@+id/btn_skip"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_margin="4dp"
android:src="@drawable/ic_action_fullscreen" />
android:src="@drawable/dkplayer_ic_action_fullscreen" />

</FrameLayout>
24 changes: 12 additions & 12 deletions app/src/main/res/layout/layout_fullscreen_controller.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
android:id="@+id/top_container"
android:layout_width="match_parent"
android:layout_height="@dimen/controller_height"
android:background="@drawable/shape_standard_controller_top_bg"
android:background="@drawable/dkplayer_shape_standard_controller_top_bg"
android:gravity="center_vertical"
android:orientation="horizontal"
android:visibility="gone"
Expand All @@ -21,7 +21,7 @@
android:layout_height="@dimen/controller_height"
android:layout_gravity="center"
android:padding="@dimen/controller_icon_padding"
android:src="@drawable/ic_action_arrow_back" />
android:src="@drawable/dkplayer_ic_action_arrow_back" />

<TextView
android:id="@+id/title"
Expand All @@ -41,7 +41,7 @@
android:layout_width="match_parent"
android:layout_height="@dimen/controller_height"
android:layout_gravity="bottom"
android:background="@drawable/shape_stardard_controller_bottom_bg"
android:background="@drawable/dkplayer_shape_stardard_controller_bottom_bg"
android:gravity="center_vertical"
android:orientation="horizontal"
android:visibility="gone"
Expand All @@ -52,7 +52,7 @@
android:layout_width="@dimen/controller_height"
android:layout_height="@dimen/controller_height"
android:padding="@dimen/player_default_spacing"
android:src="@drawable/selector_play_button" />
android:src="@drawable/dkplayer_selector_play_button" />

<TextView
android:id="@+id/curr_time"
Expand All @@ -73,8 +73,8 @@
android:background="@null"
android:max="1000"
android:maxHeight="2dp"
android:progressDrawable="@drawable/layer_dkplayer_progress_bar"
android:thumb="@drawable/seekbar_thumb" />
android:progressDrawable="@drawable/dkplayer_layer_progress_bar"
android:thumb="@drawable/dkplayer_seekbar_thumb" />

<TextView
android:id="@+id/total_time"
Expand All @@ -93,9 +93,9 @@
android:layout_height="40dp"
android:layout_gravity="center|start"
android:layout_margin="24dp"
android:background="@drawable/shape_back_bg"
android:background="@drawable/dkplayer_shape_back_bg"
android:padding="@dimen/player_default_spacing"
android:src="@drawable/selector_lock_button"
android:src="@drawable/dkplayer_selector_lock_button"
android:visibility="gone"
tools:visibility="visible" />

Expand All @@ -106,7 +106,7 @@
android:layout_height="1dp"
android:layout_gravity="bottom"
android:max="1000"
android:progressDrawable="@drawable/layer_dkplayer_progress_bar"
android:progressDrawable="@drawable/dkplayer_layer_progress_bar"
android:visibility="gone" />

<LinearLayout
Expand All @@ -122,9 +122,9 @@
android:layout_width="@dimen/player_play_btn_size"
android:layout_height="@dimen/player_play_btn_size"
android:layout_gravity="center"
android:background="@drawable/shape_play_bg"
android:background="@drawable/dkplayer_shape_play_bg"
android:padding="@dimen/controller_icon_padding"
android:src="@drawable/ic_action_replay" />
android:src="@drawable/dkplayer_ic_action_replay" />

<TextView
android:layout_width="wrap_content"
Expand All @@ -140,7 +140,7 @@
android:layout_width="@dimen/player_play_btn_size"
android:layout_height="@dimen/player_play_btn_size"
android:layout_gravity="center"
android:indeterminateDrawable="@drawable/progress_loading"
android:indeterminateDrawable="@drawable/dkplayer_progress_loading"
android:visibility="gone"
tools:visibility="visible" />

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<item name="android:padding">6dp</item>
<item name="android:layout_width">30dp</item>
<item name="android:layout_height">30dp</item>
<item name="android:background">@drawable/shape_back_bg</item>
<item name="android:background">@drawable/dkplayer_shape_back_bg</item>
<item name="android:layout_margin">5dp</item>
</style>
<style name="adText">
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand All @@ -34,6 +34,6 @@ ext {
buildToolsVersion = '27.0.3'

// App dependencies
supportLibraryVersion = '27.1.1'
supportLibraryVersion = '27.0.2'
ijkPlayerVersion = '0.8.8'
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import com.dueeeke.videoplayer.controller.MediaPlayerControl;
import com.dueeeke.videoplayer.listener.PlayerEventListener;
import com.dueeeke.videoplayer.listener.VideoListener;
import com.dueeeke.videoplayer.util.L;
import com.dueeeke.videoplayer.util.ProgressUtil;
import com.dueeeke.videoplayer.util.WindowUtil;

Expand Down Expand Up @@ -391,9 +390,11 @@ public int getBufferPercentage() {
*/
@Override
public void setMute(boolean isMute) {
this.isMute = isMute;
float volume = isMute ? 1.0f : 0.0f;
mMediaPlayer.setVolume(volume, volume);
if (isInPlaybackState()) {
this.isMute = isMute;
float volume = isMute ? 0.0f : 1.0f;
mMediaPlayer.setVolume(volume, volume);
}
}

/**
Expand Down Expand Up @@ -483,7 +484,6 @@ public void onInfo(int what, int extra) {
public void onPrepared() {
setPlayState(STATE_PREPARED);
if (mCurrentPosition > 0) {
L.d("seek to:" + mCurrentPosition);
seekTo(mCurrentPosition);
}
if (mVideoListener != null) mVideoListener.onPrepared();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public CenterView(Context context) {

private void init() {
setGravity(Gravity.CENTER);
View view = LayoutInflater.from(getContext()).inflate(R.layout.layout_dkplayer_center_window, this);
View view = LayoutInflater.from(getContext()).inflate(R.layout.dkplayer_layout_center_window, this);
ivIcon = view.findViewById(R.id.iv_icon);
tvPercent = view.findViewById(R.id.tv_percent);
proPercent = view.findViewById(R.id.pro_percent);
Expand All @@ -58,7 +58,7 @@ public void setProVisibility(int visibility) {
public void setVisibility(int visibility) {
super.setVisibility(visibility);
if (visibility != VISIBLE) {
Animation animation = AnimationUtils.loadAnimation(getContext(), R.anim.anim_dkplayer_center_view);
Animation animation = AnimationUtils.loadAnimation(getContext(), R.anim.dkplayer_anim_center_view);
this.startAnimation(animation);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public StatusView(Context context, @Nullable AttributeSet attrs) {
}

private void init() {
View root = LayoutInflater.from(getContext()).inflate(R.layout.layout_dkplayer_status_view, this);
View root = LayoutInflater.from(getContext()).inflate(R.layout.dkplayer_layout_status_view, this);
tvMessage = root.findViewById(R.id.message);
btnAction = root.findViewById(R.id.status_btn);
this.setBackgroundResource(android.R.color.black);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@
android:layout_width="100dp"
android:layout_height="3dp"
android:max="100"
android:progressDrawable="@drawable/layer_dkplayer_progress_bar" />
android:progressDrawable="@drawable/dkplayer_layer_progress_bar" />

</LinearLayout>
Loading

0 comments on commit eaed2d8

Please sign in to comment.