pull/254/head
Thomas 2 years ago
parent 9c4a54f9d6
commit a6d015f53c

@ -1,3 +1,4 @@
package app.fedilab.android.activities;
/* Copyright 2022 Thomas Schneider
*
* This file is a part of Fedilab
@ -12,8 +13,6 @@
*
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
* see <http://www.gnu.org/licenses>. */
package app.fedilab.android.activities;
import android.Manifest;
import android.app.DownloadManager;
@ -144,18 +143,7 @@ public class MediaActivity extends BaseActivity implements OnDownloadInterface {
handler = new Handler();
if (description != null && description.trim().length() > 0 && description.trim().compareTo("null") != 0) {
binding.mediaDescription.setText(description);
binding.mediaDescription.setVisibility(View.VISIBLE);
handler.postDelayed(() -> {
if (binding != null && !binding.mediaDescription.hasSelection()) {
binding.mediaDescription.setVisibility(View.GONE);
}
}, med_desc_timeout);
} else {
if (!binding.mediaDescription.hasSelection()) {
binding.mediaDescription.setVisibility(View.GONE);
}
}
binding.mediaViewpager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
public void onPageScrollStateChanged(int state) {
@ -172,18 +160,6 @@ public class MediaActivity extends BaseActivity implements OnDownloadInterface {
handler = new Handler();
if (description != null && description.trim().length() > 0 && description.trim().compareTo("null") != 0) {
binding.mediaDescription.setText(description);
binding.mediaDescription.setVisibility(View.VISIBLE);
handler.postDelayed(() -> {
if (binding != null && !binding.mediaDescription.hasSelection()) {
binding.mediaDescription.setVisibility(View.GONE);
}
}, med_desc_timeout);
} else {
if (!binding.mediaDescription.hasSelection()) {
binding.mediaDescription.setVisibility(View.GONE);
}
}
}
});
@ -302,18 +278,6 @@ public class MediaActivity extends BaseActivity implements OnDownloadInterface {
handler = new Handler();
if (description != null && description.trim().length() > 0 && description.trim().compareTo("null") != 0) {
binding.mediaDescription.setText(description);
binding.mediaDescription.setVisibility(View.VISIBLE);
handler.postDelayed(() -> {
if (binding != null && !binding.mediaDescription.hasSelection()) {
binding.mediaDescription.setVisibility(View.GONE);
}
}, med_desc_timeout);
} else {
if (!binding.mediaDescription.hasSelection()) {
binding.mediaDescription.setVisibility(View.GONE);
}
}
}
}
@ -371,8 +335,9 @@ public class MediaActivity extends BaseActivity implements OnDownloadInterface {
this.fullscreen = fullscreen;
if (!fullscreen) {
showSystemUI();
binding.mediaDescription.setVisibility(View.VISIBLE);
} else {
binding.mediaDescription.setVisibility(View.GONE);
hideSystemUI();
}
}
@ -395,11 +360,12 @@ public class MediaActivity extends BaseActivity implements OnDownloadInterface {
}
// Shows the system bars by removing all the flags
// except for the ones that make the content appear under the system bars.
// except for the ones that make the content appear under the system bars.
private void showSystemUI() {
View decorView = getWindow().getDecorView();
decorView.setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
}

@ -33,7 +33,6 @@ import androidx.core.app.ActivityCompat;
import androidx.fragment.app.Fragment;
import androidx.preference.PreferenceManager;
import com.arges.sepan.argmusicplayer.Models.ArgAudio;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.target.CustomTarget;
import com.bumptech.glide.request.transition.Transition;
@ -68,7 +67,7 @@ public class FragmentMedia extends Fragment {
private boolean swipeEnabled;
private CustomWebview webview_video;
private FragmentSlideMediaBinding binding;
private ArgAudio audio;
public FragmentMedia() {
}

@ -16,15 +16,13 @@
-->
<app.futured.hauler.HaulerView 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:id="@+id/haulerView"
android:background="@color/transparent"
app:dragUpEnabled="true"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
@ -52,10 +50,10 @@
android:textColor="#ffffffff"
android:textIsSelectable="true"
android:visibility="gone"
tools:visibility="visible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
</app.futured.hauler.HaulerView>

@ -6,6 +6,11 @@
android:layout_height="match_parent"
android:background="@android:color/transparent">
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<RelativeLayout
android:id="@+id/media_fragment_container"
android:layout_width="match_parent"
@ -131,4 +136,5 @@
android:textSize="14sp"
android:visibility="gone" />
</RelativeLayout>
</androidx.core.widget.NestedScrollView>
</FrameLayout>

@ -10,6 +10,7 @@
<color name="no_description">#FFEA00</color>
<color name="having_description">#42A5F5</color>
<color name="dark_gray">#333</color>
<color name="dark_text">#f3f3f3</color>
<color name="dark_icon">#606984</color>
<color name="marked_icon">#ca8f04</color>

@ -138,6 +138,14 @@
<item name="colorControlActivated">@color/cyanea_accent_dark_reference</item>
</style>
<style name="AppTheme.Draggable" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowIsFloating">false</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowBackground">@color/dark_gray</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="Theme.Cyanea.Dark" />

Loading…
Cancel
Save