Skip to content
This repository has been archived by the owner on Jun 2, 2022. It is now read-only.

Commit

Permalink
All code just have been reformatted.
Browse files Browse the repository at this point in the history
  • Loading branch information
f77 committed Jun 16, 2020
1 parent 21389ce commit 351dd21
Show file tree
Hide file tree
Showing 364 changed files with 64,955 additions and 64,568 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Security


## [2.19.1] - 2020-06-14
### Changed
- All code just have been reformatted.

## [2.19.0] - 2020-06-14
### Changed
- Prevent sleep mode when playing with exoplayer.
Expand Down Expand Up @@ -152,6 +156,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Added this changelog.
- Rebuilt to a new Android SDK (29).

[2.19.1]: https://github.com/f77/Dashchan/compare/2.19.0...2.19.1
[2.19.0]: https://github.com/f77/Dashchan/compare/2.18.0...2.19.0
[2.18.0]: https://github.com/f77/Dashchan/compare/2.17.0...2.18.0
[2.17.0]: https://github.com/f77/Dashchan/compare/2.16.0...2.17.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package com.mishiranu.exoplayer;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
Expand Down Expand Up @@ -45,12 +46,17 @@
* A fullscreen activity to play audio or video streams.
*/
public class PlayerActivity extends AppCompatActivity {
public static final String STATE_PLAYLIST = "playlist";
public static final String STATE_KEY_HIDE_SYSTEM_UI = "hide_system_ui";
public static final String STATE_KEY_IS_REPEAT = "is_repeat";
public static final String DEBUG_TAG = PlayerActivity.class.getName();

public static final String STATE_PLAYLIST = "state_playlist";
public static final String STATE_KEY_HIDE_SYSTEM_UI = "state_hide_system_ui";
public static final String STATE_KEY_IS_REPEAT = "state_is_repeat";

public static final String RESULT_KEY_POSITION = "result_position";


private PlaybackStateListener playbackStateListener;
private static final String DEBUG_TAG = PlayerActivity.class.getName();
private GestureDetectorCompat gestureDetector;

private PlayerView playerView;
private SimpleExoPlayer player;
Expand All @@ -63,7 +69,7 @@ public class PlayerActivity extends AppCompatActivity {
private boolean isHideSystemUi;
private boolean isRepeat;

private GestureDetectorCompat gestureDetector;
private Intent resultIntent;

@Override
protected void onCreate(Bundle savedInstanceState) {
Expand All @@ -83,6 +89,7 @@ public boolean onTouch(View view, MotionEvent event) {
});

playbackStateListener = new PlaybackStateListener();
resultIntent = new Intent();

// Get state data.
initState(getIntent());
Expand Down Expand Up @@ -111,6 +118,12 @@ protected void initPlayerView(PlayerView playerView) {
playerView.setControllerHideOnTouch(false);
}

@Override
protected void onDestroy() {
super.onDestroy();
setResult(Activity.RESULT_OK, resultIntent);
}

@Override
public void onStart() {
super.onStart();
Expand Down Expand Up @@ -232,6 +245,7 @@ public void onPlayerStateChanged(boolean playWhenReady, int playbackState) {
@Override
public void onTracksChanged(TrackGroupArray trackGroups, TrackSelectionArray trackSelections) {
Log.d(DEBUG_TAG, "currentWindowIndex changed to " + player.getCurrentWindowIndex());
resultIntent.putExtra(RESULT_KEY_POSITION, player.getCurrentWindowIndex());
}

/**
Expand Down
9 changes: 4 additions & 5 deletions player-lib/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2017 The Android Open Source Project
<?xml version="1.0" encoding="utf-8"?><!-- Copyright (C) 2017 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.
Expand All @@ -13,7 +12,7 @@ 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. -->
<resources>
<color name="colorPrimary">#FFFFFF</color>
<color name="colorPrimaryDark">#000000</color>
<color name="colorAccent">#FF4081</color>
<color name="colorPrimary">#FFFFFF</color>
<color name="colorPrimaryDark">#000000</color>
<color name="colorAccent">#FF4081</color>
</resources>
12 changes: 6 additions & 6 deletions player-lib/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ See the License for the specific language governing permissions and
limitations under the License. -->
<resources>

<style name="PlayerTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@color/colorPrimaryDark</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:windowBackground">@null</item>
</style>
<style name="PlayerTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@color/colorPrimaryDark</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:windowBackground">@null</item>
</style>
</resources>
11 changes: 5 additions & 6 deletions res/anim/fast_fade_in.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@
limitations under the License.
-->

<alpha
xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/accelerate_interpolator"
android:fromAlpha="0"
android:toAlpha="1"
android:duration="100" />
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="100"
android:fromAlpha="0"
android:interpolator="@android:anim/accelerate_interpolator"
android:toAlpha="1" />
13 changes: 6 additions & 7 deletions res/anim/fast_fade_out.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@
limitations under the License.
-->

<alpha
xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/decelerate_interpolator"
android:zAdjustment="top"
android:fromAlpha="1"
android:toAlpha="0"
android:duration="150" />
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="150"
android:fromAlpha="1"
android:interpolator="@android:anim/decelerate_interpolator"
android:toAlpha="0"
android:zAdjustment="top" />
16 changes: 8 additions & 8 deletions res/drawable-v21/ic_arrow_back_white.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
-->

<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">

<path
android:fillColor="#ffffffff"
android:pathData="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" />
<path
android:fillColor="#ffffffff"
android:pathData="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" />

</vector>
</vector>
16 changes: 8 additions & 8 deletions res/drawable-v21/ic_arrow_drop_down_black.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
-->

<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">

<path
android:fillColor="#ff000000"
android:pathData="M7 10l5 5 5-5z" />
<path
android:fillColor="#ff000000"
android:pathData="M7 10l5 5 5-5z" />

</vector>
</vector>
16 changes: 8 additions & 8 deletions res/drawable-v21/ic_arrow_drop_down_white.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
-->

<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">

<path
android:fillColor="#ffffffff"
android:pathData="M7 10l5 5 5-5z" />
<path
android:fillColor="#ffffffff"
android:pathData="M7 10l5 5 5-5z" />

</vector>
</vector>
16 changes: 8 additions & 8 deletions res/drawable-v21/ic_arrow_forward_black.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
-->

<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">

<path
android:fillColor="#ff000000"
android:pathData="M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z" />
<path
android:fillColor="#ff000000"
android:pathData="M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z" />

</vector>
</vector>
16 changes: 8 additions & 8 deletions res/drawable-v21/ic_arrow_forward_white.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
-->

<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">

<path
android:fillColor="#ffffffff"
android:pathData="M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z" />
<path
android:fillColor="#ffffffff"
android:pathData="M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z" />

</vector>
</vector>
16 changes: 8 additions & 8 deletions res/drawable-v21/ic_attach_file_white_edited.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@
-->

<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">

<path
android:fillColor="#ffffffff"
android:pathData="M11.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5c0-1.38 1.12-2.5 2.5-2.5s2.5 1.12
<path
android:fillColor="#ffffffff"
android:pathData="M11.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5c0-1.38 1.12-2.5 2.5-2.5s2.5 1.12
2.5 2.5v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6H5v9.5c0 1.38 1.12 2.5 2.5 2.5s2.5-1.12
2.5-2.5V5c0-2.21-1.79-4-4-4S2 2.79 2 5v12.5c0 3.04 2.46 5.5 5.5 5.5s5.5-2.46
5.5-5.5V11h-1.5zM18 7v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4z" />

</vector>
</vector>
16 changes: 8 additions & 8 deletions res/drawable-v21/ic_camera_alt_white.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@
-->

<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">

<path
android:fillColor="#ffffffff"
android:pathData="M9 2L7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1 .9 2 2 2h16c1.1 0 2-.9
<path
android:fillColor="#ffffffff"
android:pathData="M9 2L7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1 .9 2 2 2h16c1.1 0 2-.9
2-2V6c0-1.1-.9-2-2-2h-3.17L15 2H9zm3 15c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5
5-2.24 5-5 5zm0 -1.8c-1.77 0-3.2-1.43-3.2-3.2s1.43-3.2 3.2-3.2 3.2 1.43 3.2
3.2-1.43 3.2-3.2 3.2z" />

</vector>
</vector>
16 changes: 8 additions & 8 deletions res/drawable-v21/ic_close_black.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
-->

<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">

<path
android:fillColor="#ff000000"
android:pathData="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19
<path
android:fillColor="#ff000000"
android:pathData="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19
17.59 13.41 12z" />

</vector>
</vector>
16 changes: 8 additions & 8 deletions res/drawable-v21/ic_close_grey.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
-->

<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">

<path
android:fillColor="#ff8b8b8b"
android:pathData="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19
<path
android:fillColor="#ff8b8b8b"
android:pathData="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19
17.59 13.41 12z" />

</vector>
</vector>
16 changes: 8 additions & 8 deletions res/drawable-v21/ic_close_white.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
-->

<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">

<path
android:fillColor="#ffffffff"
android:pathData="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19
<path
android:fillColor="#ffffffff"
android:pathData="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19
17.59 13.41 12z" />

</vector>
</vector>
Loading

0 comments on commit 351dd21

Please sign in to comment.