Skip to content

Commit ff96f50

Browse files
authored
Fixes commons-app#4287 "Tapping multiple items in explore should not be allowed" (commons-app#4310)
* only one media detail at a time * requested changes * disabled multitap on screen * requested changes
1 parent 4dfad52 commit ff96f50

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

app/src/main/java/fr/free/nrw/commons/explore/ExploreListRootFragment.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,24 @@
22

33
import android.content.Context;
44
import android.os.Bundle;
5-
import android.util.Log;
5+
import android.os.Handler;
66
import android.view.LayoutInflater;
77
import android.view.View;
88
import android.view.ViewGroup;
99
import android.widget.FrameLayout;
1010
import androidx.annotation.NonNull;
1111
import androidx.annotation.Nullable;
1212
import androidx.fragment.app.Fragment;
13-
import androidx.fragment.app.FragmentActivity;
1413
import butterknife.BindView;
1514
import butterknife.ButterKnife;
16-
import com.google.android.material.tabs.TabLayout;
1715
import fr.free.nrw.commons.Media;
1816
import fr.free.nrw.commons.R;
1917
import fr.free.nrw.commons.category.CategoryImagesCallback;
20-
import fr.free.nrw.commons.contributions.ContributionsListFragment;
2118
import fr.free.nrw.commons.contributions.MainActivity;
2219
import fr.free.nrw.commons.di.CommonsDaggerSupportFragment;
2320
import fr.free.nrw.commons.explore.categories.media.CategoriesMediaFragment;
2421
import fr.free.nrw.commons.media.MediaDetailPagerFragment;
2522
import fr.free.nrw.commons.navtab.NavTab;
26-
import fr.free.nrw.commons.settings.SettingsFragment;
2723

2824
public class ExploreListRootFragment extends CommonsDaggerSupportFragment implements
2925
MediaDetailPagerFragment.MediaDetailProvider, CategoryImagesCallback {
@@ -80,7 +76,7 @@ public void setFragment(Fragment fragment, Fragment otherFragment) {
8076
.addToBackStack("CONTRIBUTION_LIST_FRAGMENT_TAG")
8177
.commit();
8278
getChildFragmentManager().executePendingTransactions();
83-
}else if (!fragment.isAdded() && otherFragment != null ) {
79+
} else if (!fragment.isAdded() && otherFragment != null ) {
8480
getChildFragmentManager()
8581
.beginTransaction()
8682
.hide(otherFragment)
@@ -113,9 +109,8 @@ public void onAttach(final Context context) {
113109

114110
@Override
115111
public void onMediaClicked(int position) {
116-
Log.d("deneme8","on media clicked");
117112
container.setVisibility(View.VISIBLE);
118-
((ExploreFragment)getParentFragment()).tabLayout.setVisibility(View.GONE);
113+
((ExploreFragment) getParentFragment()).tabLayout.setVisibility(View.GONE);
119114
mediaDetails = new MediaDetailPagerFragment(false, true);
120115
mediaDetails.showImage(position);
121116
((ExploreFragment) getParentFragment()).setScroll(false);

app/src/main/res/values/styles.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@
5454
<item name="contributionsListTextSecondary">@color/white</item>
5555
<item name="menu_item_tint">@color/white</item>
5656
<item name="search_icon">@drawable/ic_search_white_24dp</item>
57+
<item name="android:windowEnableSplitTouch">false</item>
58+
<item name="android:splitMotionEvents">false</item>
5759
</style>
5860

5961
<style name="LightAppTheme" parent="Theme.AppCompat.Light.NoActionBar">
@@ -109,6 +111,8 @@
109111
<item name="contributionsListTextSecondary">@color/disabled_button_text_color_dark</item>
110112
<item name="menu_item_tint">@color/primaryDarkColor</item>
111113
<item name="search_icon">@drawable/ic_search_blue_24dp</item>
114+
<item name="android:windowEnableSplitTouch">false</item>
115+
<item name="android:splitMotionEvents">false</item>
112116
</style>
113117

114118
<style name="LightMoreBottomSheetStyle" parent="LightAppTheme">

0 commit comments

Comments
 (0)