Skip to content

Commit

Permalink
Update VOD focus size x1.2 Update VOD controller UI Fix crash during …
Browse files Browse the repository at this point in the history
…search subtitle on enter

Update VOD focus size x1.2

Update VOD controller UI
Fix crash during search subtitle on enter
  • Loading branch information
hlh2518 committed Sep 18, 2023
1 parent 7c5f78a commit d787950
Show file tree
Hide file tree
Showing 10 changed files with 131 additions and 71 deletions.
43 changes: 26 additions & 17 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import android.app.Activity;
import android.content.Context;
import android.text.TextUtils;
import android.view.KeyEvent;
import android.view.View;
import android.widget.EditText;
import android.widget.ProgressBar;
Expand Down Expand Up @@ -33,7 +34,8 @@

public class SearchSubtitleDialog extends BaseDialog {

private Context mContext;
//private Context mContext;
private final Context mContext;
private TvRecyclerView mGridView;
private SearchSubtitleAdapter searchAdapter;

Expand All @@ -43,7 +45,8 @@ public class SearchSubtitleDialog extends BaseDialog {
private ProgressBar loadingBar;
private SubtitleViewModel subtitleViewModel;
private int page = 1;
private int maxPage = 5;
//private int maxPage = 5;
private final int maxPage = 5;
private String searchWord = "";

private List<Subtitle> zipSubtitles = new ArrayList<>();
Expand All @@ -64,7 +67,8 @@ public SearchSubtitleDialog(@NonNull @NotNull Context context) {
protected void initView(Context context) {
loadingBar = findViewById(R.id.loadingBar);
mGridView = findViewById(R.id.mGridView);
subtitleSearchEt = findViewById(R.id.input);
//subtitleSearchEt = findViewById(R.id.input);
subtitleSearchEt = findViewById(R.id.input_sub);
subtitleSearchBtn = findViewById(R.id.inputSubmit);
subtitleSearchBtn.setText(HomeActivity.getRes().getString(R.string.vod_sub_search));

Expand Down Expand Up @@ -101,6 +105,8 @@ public void onLoadMoreRequested() {
}
}, mGridView);

// takagen99 : Fix on Key Enter
subtitleSearchEt.setOnKeyListener(onSoftKeyPress);
subtitleSearchBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Expand All @@ -111,7 +117,17 @@ public void onClick(View v) {
});
searchAdapter.setNewData(new ArrayList<>());
}

// takagen99 : Fix on Key Enter
private final View.OnKeyListener onSoftKeyPress = new View.OnKeyListener() {
public boolean onKey(View v, int keyCode, KeyEvent event) {
if (event.getKeyCode() == KeyEvent.KEYCODE_ENTER) {
// hide soft keyboard, set focus on next button
subtitleSearchEt.clearFocus();
subtitleSearchBtn.requestFocus();
}
return false;
}
};
public void setSearchWord(String wd) {
wd = wd.replaceAll("(?:(|\\(|\\[|【|\\.mp4|\\.mkv|\\.avi|\\.MP4|\\.MKV|\\.AVI)", "");
wd = wd.replaceAll("(?::|\\:|)|\\)|\\]|】|\\.)", " ");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ public void onItemPreSelected(TvRecyclerView parent, View itemView, int position

@Override
public void onItemSelected(TvRecyclerView parent, View itemView, int position) {
itemView.animate().scaleX(1.05f).scaleY(1.05f).setDuration(300).setInterpolator(new BounceInterpolator()).start();
//itemView.animate().scaleX(1.05f).scaleY(1.05f).setDuration(300).setInterpolator(new BounceInterpolator()).start();
itemView.animate().scaleX(1.2f).scaleY(1.2f).setDuration(300).setInterpolator(new BounceInterpolator()).start();
}

@Override
Expand All @@ -232,7 +233,8 @@ public void onItemPreSelected(TvRecyclerView parent, View itemView, int position

@Override
public void onItemSelected(TvRecyclerView parent, View itemView, int position) {
itemView.animate().scaleX(1.05f).scaleY(1.05f).setDuration(300).setInterpolator(new BounceInterpolator()).start();
//itemView.animate().scaleX(1.05f).scaleY(1.05f).setDuration(300).setInterpolator(new BounceInterpolator()).start();
itemView.animate().scaleX(1.2f).scaleY(1.2f).setDuration(300).setInterpolator(new BounceInterpolator()).start();
}

@Override
Expand Down
8 changes: 6 additions & 2 deletions app/src/main/res/layout-v21/dialog_search_subtitle.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">

Expand All @@ -18,21 +19,24 @@
android:orientation="horizontal">

<EditText
android:id="@+id/input"
android:id="@+id/input_sub"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/input_search"
android:hint="请输入字幕名称"
android:imeOptions="actionDone"
android:inputType="text"
android:maxLines="1"
android:paddingLeft="@dimen/vs_20"
android:paddingTop="@dimen/vs_10"
android:paddingRight="@dimen/vs_2"
android:paddingBottom="@dimen/vs_10"
android:singleLine="true"
android:textColor="@color/color_FFFFFF"
android:textColorHint="@color/color_6CFFFFFF"
android:textSize="@dimen/ts_26" />
android:textSize="@dimen/ts_26"
tools:ignore="TouchTargetSizeCheck" />

<TextView
android:id="@+id/inputSubmit"
Expand Down
10 changes: 6 additions & 4 deletions app/src/main/res/layout/activity_collect.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
android:paddingLeft="@dimen/vs_50"
android:paddingTop="@dimen/vs_20"
android:paddingRight="@dimen/vs_50"
android:paddingBottom="@dimen/vs_20">
android:paddingBottom="@dimen/vs_15">

<View
android:layout_width="@dimen/vs_5"
Expand Down Expand Up @@ -47,7 +47,8 @@
android:layout_width="wrap_content"
android:layout_height="@dimen/vs_50"
android:layout_gravity="center"
android:layout_marginRight="@dimen/vs_10"
android:layout_marginStart="@dimen/vs_10"
android:layout_marginEnd="@dimen/vs_10"
android:focusable="false"
android:focusableInTouchMode="false"
android:gravity="center"
Expand Down Expand Up @@ -81,6 +82,7 @@
android:gravity="center"
android:padding="@dimen/vs_5"
android:src="@drawable/icon_clear" />

</LinearLayout>

<com.owen.tvrecyclerview.widget.TvRecyclerView
Expand All @@ -90,9 +92,9 @@
android:clipChildren="false"
android:clipToPadding="false"
android:paddingLeft="@dimen/vs_60"
android:paddingTop="@dimen/vs_10"
android:paddingTop="@dimen/vs_30"
android:paddingRight="@dimen/vs_60"
android:paddingBottom="@dimen/vs_10"
android:paddingBottom="@dimen/vs_30"
app:tv_horizontalSpacingWithMargins="@dimen/vs_10"
app:tv_selectedItemIsCentered="true"
app:tv_verticalSpacingWithMargins="@dimen/vs_10" />
Expand Down
20 changes: 13 additions & 7 deletions app/src/main/res/layout/activity_detail.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
android:layout_height="@dimen/vs_300"
android:clickable="true"
android:focusable="false"
android:scaleType="fitXY" />
android:scaleType="fitXY"
tools:ignore="SpeakableTextPresentCheck" />

<View
android:id="@+id/previewPlayerPlace"
Expand Down Expand Up @@ -151,7 +152,7 @@
android:lineSpacingMultiplier="1.2"
android:maxLines="4"
android:textColor="@color/color_FFFFFF_80"
android:textSize="@dimen/ts_18" />
android:textSize="@dimen/ts_16" />

<Space
android:layout_width="wrap_content"
Expand All @@ -174,7 +175,8 @@
android:gravity="center"
android:text="@string/det_play"
android:textColor="@android:color/white"
android:textSize="@dimen/vs_20" />
android:textSize="@dimen/vs_20"
tools:ignore="TextSizeCheck" />

<TextView
android:id="@+id/tvQuickSearch"
Expand All @@ -187,7 +189,8 @@
android:gravity="center"
android:text="@string/det_search"
android:textColor="@android:color/white"
android:textSize="@dimen/vs_20" />
android:textSize="@dimen/vs_20"
tools:ignore="TextSizeCheck" />

<TextView
android:id="@+id/tvSort"
Expand All @@ -200,7 +203,8 @@
android:gravity="center"
android:text="@string/det_sort"
android:textColor="@android:color/white"
android:textSize="@dimen/vs_20" />
android:textSize="@dimen/vs_20"
tools:ignore="TextSizeCheck" />

<TextView
android:id="@+id/tvPush"
Expand All @@ -213,7 +217,8 @@
android:gravity="center"
android:text="@string/det_push"
android:textColor="@android:color/white"
android:textSize="@dimen/vs_20" />
android:textSize="@dimen/vs_20"
tools:ignore="TextSizeCheck" />

<TextView
android:id="@+id/tvCollect"
Expand All @@ -224,7 +229,8 @@
android:gravity="center"
android:text="@string/det_fav"
android:textColor="@android:color/white"
android:textSize="@dimen/vs_20" />
android:textSize="@dimen/vs_20"
tools:ignore="TextSizeCheck" />

<ImageView
android:id="@+id/tvPlayUrl"
Expand Down
9 changes: 5 additions & 4 deletions app/src/main/res/layout/activity_history.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
android:paddingLeft="@dimen/vs_50"
android:paddingTop="@dimen/vs_20"
android:paddingRight="@dimen/vs_50"
android:paddingBottom="@dimen/vs_20">
android:paddingBottom="@dimen/vs_15">

<View
android:layout_width="@dimen/vs_5"
Expand Down Expand Up @@ -47,7 +47,8 @@
android:layout_width="wrap_content"
android:layout_height="@dimen/vs_50"
android:layout_gravity="center"
android:layout_marginRight="@dimen/vs_10"
android:layout_marginStart="@dimen/vs_10"
android:layout_marginEnd="@dimen/vs_10"
android:focusable="false"
android:focusableInTouchMode="false"
android:gravity="center"
Expand Down Expand Up @@ -90,9 +91,9 @@
android:clipChildren="false"
android:clipToPadding="false"
android:paddingLeft="@dimen/vs_60"
android:paddingTop="@dimen/vs_10"
android:paddingTop="@dimen/vs_30"
android:paddingRight="@dimen/vs_60"
android:paddingBottom="@dimen/vs_10"
android:paddingBottom="@dimen/vs_30"
app:tv_horizontalSpacingWithMargins="@dimen/vs_10"
app:tv_selectedItemIsCentered="true"
app:tv_verticalSpacingWithMargins="@dimen/vs_10" />
Expand Down
8 changes: 6 additions & 2 deletions app/src/main/res/layout/dialog_search_subtitle.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">

Expand All @@ -18,21 +19,24 @@
android:orientation="horizontal">

<EditText
android:id="@+id/input"
android:id="@+id/input_sub"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/input_search"
android:hint="请输入字幕名称"
android:imeOptions="actionDone"
android:inputType="text"
android:maxLines="1"
android:paddingLeft="@dimen/vs_20"
android:paddingTop="@dimen/vs_10"
android:paddingRight="@dimen/vs_2"
android:paddingBottom="@dimen/vs_10"
android:singleLine="true"
android:textColor="@color/color_FFFFFF"
android:textColorHint="@color/color_6CFFFFFF"
android:textSize="@dimen/ts_26" />
android:textSize="@dimen/ts_26"
tools:ignore="TouchTargetSizeCheck" />

<TextView
android:id="@+id/inputSubmit"
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/fragment_grid.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
android:clipChildren="false"
android:clipToPadding="false"
android:paddingLeft="@dimen/vs_60"
android:paddingTop="@dimen/vs_10"
android:paddingTop="@dimen/vs_30"
android:paddingRight="@dimen/vs_60"
android:paddingBottom="@dimen/vs_10"
android:paddingBottom="@dimen/vs_30"
app:tv_horizontalSpacingWithMargins="@dimen/vs_10"
app:tv_selectedItemIsCentered="true"
app:tv_verticalSpacingWithMargins="@dimen/vs_10" />
Expand Down
Loading

0 comments on commit d787950

Please sign in to comment.