Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Locked Scrolling in Dashboard fragment #951

Open
wants to merge 1 commit into
base: gsoc2022
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CompoundButton;
Expand All @@ -56,6 +57,7 @@
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.constraintlayout.widget.ConstraintSet;
import androidx.core.app.ActivityCompat;
import androidx.core.widget.NestedScrollView;

import com.afollestad.materialdialogs.MaterialDialog;
import com.google.android.material.bottomnavigation.BottomNavigationView;
Expand Down Expand Up @@ -210,6 +212,9 @@ public class DashboardFragment extends BaseInjectorFragment {
@BindView(R.id.fragment_dashboard_start_track_button_text)
protected TextView startTrackButtonText;

@BindView(R.id.fragment_dashboard_scrollview)
protected NestedScrollView dashboardScrollView;

// injected variables
@Inject
protected UserPreferenceHandler userHandler;
Expand Down Expand Up @@ -253,6 +258,14 @@ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup c
// Bind views
ButterKnife.bind(this, contentView);

dashboardScrollView.setNestedScrollingEnabled(false);
dashboardScrollView.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
return true;
}
});

// inflate menus and init toolbar clicks
toolbar.inflateMenu(R.menu.menu_dashboard_logged_out);
toolbar.getOverflowIcon().setColorFilter(Color.WHITE, PorterDuff.Mode.SRC_ATOP);
Expand Down