Better positioning of preview media fragment

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
tobiasKaminsky 2021-12-08 10:03:52 +01:00
parent b7de19236f
commit 57f21e50ce
No known key found for this signature in database
GPG key ID: 0E00D4D47D0C5AF7
4 changed files with 8 additions and 3 deletions

View file

@ -48,7 +48,6 @@ import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.view.ViewTreeObserver; import android.view.ViewTreeObserver;
import android.view.WindowManager; import android.view.WindowManager;
import android.widget.Toast;
import com.google.android.material.appbar.AppBarLayout; import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.snackbar.Snackbar; import com.google.android.material.snackbar.Snackbar;
@ -1124,6 +1123,8 @@ public class FileDisplayActivity extends FileActivity
createMinFragments(null); createMinFragments(null);
} else { } else {
// pop back // pop back
((CoordinatorLayout.LayoutParams) binding.rootLayout.getLayoutParams())
.setBehavior(new AppBarLayout.ScrollingViewBehavior());
hideSearchView(getCurrentDir()); hideSearchView(getCurrentDir());
showSortListGroup(true); showSortListGroup(true);
super.onBackPressed(); super.onBackPressed();
@ -2187,6 +2188,7 @@ public class FileDisplayActivity extends FileActivity
Fragment mediaFragment = PreviewMediaFragment.newInstance(file, user.get(), startPlaybackPosition, autoplay); Fragment mediaFragment = PreviewMediaFragment.newInstance(file, user.get(), startPlaybackPosition, autoplay);
setLeftFragment(mediaFragment); setLeftFragment(mediaFragment);
binding.rightFragmentContainer.setVisibility(View.GONE); binding.rightFragmentContainer.setVisibility(View.GONE);
((CoordinatorLayout.LayoutParams) binding.rootLayout.getLayoutParams()).setBehavior(null);
super.updateActionBarTitleAndHomeButton(file); super.updateActionBarTitleAndHomeButton(file);
} else { } else {
Intent previewIntent = new Intent(); Intent previewIntent = new Intent();

View file

@ -178,6 +178,8 @@ public class PreviewMediaFragment extends FileFragment implements OnTouchListene
emptyListView = binding.emptyView.emptyListView; emptyListView = binding.emptyView.emptyListView;
getActivity().findViewById(R.id.sort_list_button_group).setVisibility(View.GONE);
setLoadingView(); setLoadingView();
return view; return view;
} }

View file

@ -26,6 +26,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:gravity="center" android:gravity="center"
android:layout_marginTop="?attr/actionBarSize"
tools:context=".ui.preview.PreviewMediaFragment"> tools:context=".ui.preview.PreviewMediaFragment">
<ImageView <ImageView

View file

@ -65,7 +65,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingEnd="@dimen/standard_quarter_padding" android:paddingEnd="@dimen/standard_quarter_padding"
android:text="@string/placeholder_media_time" android:text="@string/placeholder_media_time"
android:textColor="@color/text_color_inverse" android:textColor="@color/text_color"
/> />
<SeekBar <SeekBar
@ -87,7 +87,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingStart="@dimen/standard_quarter_padding" android:paddingStart="@dimen/standard_quarter_padding"
android:text="@string/placeholder_media_time" android:text="@string/placeholder_media_time"
android:textColor="@color/text_color_inverse" android:textColor="@color/text_color"
/> />
</LinearLayout> </LinearLayout>