Commit a6d015f5 authored by Thomas's avatar Thomas
Browse files

fix media

parent 9c4a54f9
Loading
Loading
Loading
Loading
+5 −39
Original line number Diff line number Diff line
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();
        }
    }
@@ -400,6 +365,7 @@ public class MediaActivity extends BaseActivity implements OnDownloadInterface {
        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);
    }

+1 −2
Original line number Diff line number Diff line
@@ -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() {
    }
+9 −11
Original line number Diff line number Diff line
@@ -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>
+13 −7
Original line number Diff line number Diff line
@@ -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>
+1 −0
Original line number Diff line number Diff line
@@ -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>
Loading