-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #325 from ourfor/develop
✨ add player advance config panel
- Loading branch information
Showing
13 changed files
with
229 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
android/app/src/main/java/top/ourfor/app/iplayx/view/video/PlayerAdvanceConfigView.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
package top.ourfor.app.iplayx.view.video; | ||
|
||
import android.content.Context; | ||
import android.text.Editable; | ||
import android.text.TextWatcher; | ||
import android.view.LayoutInflater; | ||
|
||
import androidx.annotation.NonNull; | ||
import androidx.constraintlayout.widget.ConstraintLayout; | ||
|
||
import top.ourfor.app.iplayx.databinding.PlayerAdvanceConfigBinding; | ||
import top.ourfor.app.iplayx.view.player.Player; | ||
|
||
public class PlayerAdvanceConfigView extends ConstraintLayout { | ||
PlayerAdvanceConfigBinding binding; | ||
Player player; | ||
|
||
public PlayerAdvanceConfigView(@NonNull Context context) { | ||
super(context); | ||
binding = PlayerAdvanceConfigBinding.inflate(LayoutInflater.from(context), this, true); | ||
setup(); | ||
bind(); | ||
} | ||
|
||
void setup() { | ||
|
||
} | ||
|
||
void bind() { | ||
binding.subDelay.addTextChangedListener(new TextWatcher() { | ||
@Override | ||
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { | ||
|
||
} | ||
|
||
@Override | ||
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) { | ||
|
||
} | ||
|
||
@Override | ||
public void afterTextChanged(Editable editable) { | ||
if (player != null) { | ||
double delay = Double.parseDouble(editable.toString()); | ||
player.setSubtitleDelay(delay); | ||
} | ||
} | ||
}); | ||
|
||
binding.subPos.addTextChangedListener(new TextWatcher() { | ||
@Override | ||
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { | ||
|
||
} | ||
|
||
@Override | ||
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) { | ||
|
||
} | ||
|
||
@Override | ||
public void afterTextChanged(Editable editable) { | ||
if (player != null) { | ||
double position = Double.parseDouble(editable.toString()); | ||
player.setSubtitlePosition(position); | ||
} | ||
} | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<top.ourfor.app.iplayx.view.LifecycleHolder | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
xmlns:app="http://schemas.android.com/apk/res-auto"> | ||
<com.google.android.flexbox.FlexboxLayout | ||
app:flexDirection="column" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content"> | ||
<com.google.android.flexbox.FlexboxLayout | ||
app:alignItems="center" | ||
app:justifyContent="center" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content"> | ||
<top.ourfor.app.iplayx.view.infra.TextView | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:id="@+id/sub_pos_label" | ||
android:text="@string/subtitle_position" | ||
android:textSize="18sp" | ||
android:maxLines="1" | ||
android:ellipsize="end" | ||
android:textColor="@color/onBackground" | ||
app:layout_constraintTop_toTopOf="parent" | ||
app:layout_constraintLeft_toLeftOf="parent" | ||
android:layout_marginTop="15dp" | ||
android:layout_marginLeft="10dp" | ||
android:layout_marginRight="10dp" | ||
android:layout_marginBottom="15dp" | ||
app:layout_flexGrow="1" | ||
/> | ||
<top.ourfor.app.iplayx.view.infra.EditText | ||
android:layout_width="wrap_content" | ||
android:layout_height="match_parent" | ||
android:inputType="number" | ||
android:id="@+id/sub_pos" | ||
app:layout_minWidth="50dp" | ||
android:layout_marginEnd="10dp" | ||
/> | ||
</com.google.android.flexbox.FlexboxLayout> | ||
<com.google.android.flexbox.FlexboxLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content"> | ||
<com.google.android.flexbox.FlexboxLayout | ||
app:alignItems="center" | ||
app:justifyContent="center" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content"> | ||
<top.ourfor.app.iplayx.view.infra.TextView | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:id="@+id/name_label" | ||
android:text="@string/subtitle_delay" | ||
android:textSize="18sp" | ||
android:maxLines="1" | ||
android:ellipsize="end" | ||
android:textColor="@color/onBackground" | ||
app:layout_constraintTop_toTopOf="parent" | ||
app:layout_constraintLeft_toLeftOf="parent" | ||
android:layout_marginTop="15dp" | ||
android:layout_marginLeft="10dp" | ||
android:layout_marginRight="10dp" | ||
android:layout_marginBottom="15dp" | ||
app:layout_flexGrow="1" | ||
/> | ||
<top.ourfor.app.iplayx.view.infra.EditText | ||
android:layout_width="wrap_content" | ||
android:layout_height="match_parent" | ||
android:inputType="number" | ||
android:id="@+id/sub_delay" | ||
app:layout_minWidth="50dp" | ||
android:layout_marginEnd="10dp" | ||
/> | ||
</com.google.android.flexbox.FlexboxLayout> | ||
</com.google.android.flexbox.FlexboxLayout> | ||
<com.google.android.flexbox.FlexboxLayout | ||
app:alignItems="center" | ||
app:justifyContent="center" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content"> | ||
<top.ourfor.app.iplayx.view.infra.TextView | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:id="@+id/warning_label" | ||
android:text="@string/advance_config_warning" | ||
/> | ||
</com.google.android.flexbox.FlexboxLayout> | ||
</com.google.android.flexbox.FlexboxLayout> | ||
</top.ourfor.app.iplayx.view.LifecycleHolder> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters