Skip to content

Commit

Permalink
Merge pull request #329 from ourfor/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
ourfor authored Dec 10, 2024
2 parents 6eb3063 + 612f7a1 commit 13ed800
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ public void pushPage(int id, Map<String, Object> params) {
page.viewWillDisappear();
val newPage = makePage(id);
pageId.put(newPage, id);
assert newPage != null;
newPage.create(container.getContext(), params);
pages.push(newPage);
val view = newPage.view();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public class LoginPage extends BottomSheetDialogFragment implements OneDriveActi
);

LoginPageBinding binding = null;
boolean isFragment = false;
boolean isPage = false;
@Setter
public boolean isDialogModel = false;
@Setter
Expand All @@ -100,7 +100,7 @@ public class LoginPage extends BottomSheetDialogFragment implements OneDriveActi
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
super.onCreateView(inflater, container, savedInstanceState);
binding = LoginPageBinding.inflate(inflater, container, false);
isFragment = container != null;
isPage = false;
val actionBar = XGET(ActionBar.class);
if (!isDialogModel) {
XGET(NavigationTitleBar.class).setNavTitle(R.string.login);
Expand All @@ -119,7 +119,6 @@ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup c

void setup(LayoutInflater inflater, ViewGroup container) {
binding = LoginPageBinding.inflate(inflater, container, false);
isFragment = container != null;
val actionBar = XGET(ActionBar.class);
if (!isDialogModel) {
XGET(NavigationTitleBar.class).setNavTitle(R.string.login);
Expand Down Expand Up @@ -302,7 +301,7 @@ private void loginToEmby(String remake, String server, String username, String p
val action = XGET(SiteUpdateAction.class);
action.onSiteUpdate();
Toast.makeText(context, "Login success", Toast.LENGTH_SHORT).show();
if (isFragment) {
if (isPage) {
XGET(Navigator.class).popPage();
} else {
dismiss();
Expand Down Expand Up @@ -342,7 +341,7 @@ private void loginToJellyfin(String remake, String server, String username, Stri
val action = XGET(SiteUpdateAction.class);
action.onSiteUpdate();
Toast.makeText(context, "Login success", Toast.LENGTH_SHORT).show();
if (isFragment) {
if (isPage) {
XGET(Navigator.class).popPage();
} else {
dismiss();
Expand Down Expand Up @@ -586,6 +585,7 @@ public View view() {
@Override
public void create(Context context, Map<String, Object> params) {
this.context = context;
this.isPage = true;
setup(LayoutInflater.from(context), null);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,9 @@ public void onAnimationStart(Animator animation) {
@Override
public void onAnimationEnd(Animator animation) {
view.setVisibility(View.GONE);
((ViewGroup) view.getParent()).removeView(view);
val superview = view.getParent();
if (superview == null) return;
((ViewGroup) superview).removeView(view);
recycleView((TextView) view);
}

Expand Down
22 changes: 22 additions & 0 deletions android/app/src/main/res/drawable/bg_spinner.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item android:state_pressed="false">
<layer-list>
<item android:drawable="@drawable/ic_fluent_caret_down_24_filled"
android:gravity="end"
android:tintMode="src_in"
android:tint="@color/onBackground"
android:right="15dp" />
</layer-list>
</item>
<item android:state_window_focused="true" android:state_pressed="true">
<layer-list>
<item android:drawable="@drawable/ic_fluent_caret_up_24_filled"
android:gravity="end"
android:tintMode="src_in"
android:tint="@color/onBackground"
android:right="15dp" />
</layer-list>
</item>
</selector>
3 changes: 3 additions & 0 deletions android/app/src/main/res/layout/player_config_panel.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
app:layout_constraintTop_toBottomOf="@id/video_label"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:background="@drawable/bg_spinner"
/>

<top.ourfor.app.iplayx.view.infra.TextView
Expand Down Expand Up @@ -55,6 +56,7 @@
app:layout_constraintTop_toBottomOf="@id/audio_label"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:background="@drawable/bg_spinner"
/>

<top.ourfor.app.iplayx.view.infra.TextView
Expand Down Expand Up @@ -82,6 +84,7 @@
app:layout_constraintTop_toBottomOf="@id/subtitle_label"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:background="@drawable/bg_spinner"
/>


Expand Down

0 comments on commit 13ed800

Please sign in to comment.