Giter Club home page Giter Club logo

Comments (13)

brkckr avatar brkckr commented on May 18, 2024

I may help if you can give me more details about what you want to do.

from tableview.

mahramane avatar mahramane commented on May 18, 2024

i use android:layoutDirection="rtl"

I want to show the horizontal scrollbar recyclerView from the right for the first time.

from tableview.

mahramane avatar mahramane commented on May 18, 2024

photo_2020-03-21_21-58-21

from tableview.

brkckr avatar brkckr commented on May 18, 2024

As far as I understand, you want RecyclerView to scroll right on the first boot.

manager.smoothScrollToPosition(rvClub, null,0);

manager : FixedGridLayoutManager manager;
rvClub : your RecyclerView.

state and the position are not important at this time. keep it null and 0.

from tableview.

mahramane avatar mahramane commented on May 18, 2024

Unfortunately it didn't work 😢

from tableview.

brkckr avatar brkckr commented on May 18, 2024

Then I have no other solution or idea. Good luck. Please let me know when you find the answer.

from tableview.

mahramane avatar mahramane commented on May 18, 2024

Hi
How can I use scrollHorizontallyBy in the FixedGridLayoutManager?

from tableview.

brkckr avatar brkckr commented on May 18, 2024

The parameter dx means the change in x coordinate. In your case, you want to move it in the opposite direction. which means dx must be a negative value. But I have no idea about other parameters of scrollHorizontallyBy.

Still, I am not sure if you use manager.smoothScrollToPosition(rvClub, null,0) correctly.

 /**
     * Handles RecyclerView for the action
     */
    private void setUpRecyclerView()
    {
        clubAdapter = new ClubAdapter(MainActivity.this, clubList);

        FixedGridLayoutManager manager = new FixedGridLayoutManager();
        manager.setTotalColumnCount(1);
        rvClub.setLayoutManager(manager);
        rvClub.setAdapter(clubAdapter);
        rvClub.addItemDecoration(new DividerItemDecoration(MainActivity.this, DividerItemDecoration.VERTICAL));


        manager.smoothScrollToPosition(rvClub, null, 0);
    }

I got the following result from physical device, operating system Android 9.

ezgif-3-275bb0cd79b1

from tableview.

monsterbrain avatar monsterbrain commented on May 18, 2024

Did you tried setReverseLayout(true) ? https://stackoverflow.com/questions/31728837/recyclerview-grow-element-from-right-to-left

from tableview.

SaggamAnand avatar SaggamAnand commented on May 18, 2024

Hi, Could you please help me out? I am trying to add views dynamically (not fixed in size) for each recycler view item, but the problem is after adding views, it's not scrolling horizontally. Attached screenshot for reference
Scroll_issue
.

from tableview.

brkckr avatar brkckr commented on May 18, 2024

Hi,

Can you give 200dp width to each element you add to the row of the RecyclerView and tell me if it works? The width of each row of the RecyclerView must be wrap_content.

Do you have the 16th, 17th or 20th element in each row?

from tableview.

SaggamAnand avatar SaggamAnand commented on May 18, 2024

Hi,
I tried to set a fixed height/width for the row item element, but still, it is not getting scroll. It gets scrolled when we have fixed views in each item of recycler view.

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content">

    <TextView
        android:id="@+id/score_text_view"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:layout_centerInParent="true"
        android:gravity="center"
        android:textColor="@color/colorPrimaryDark" />

</RelativeLayout>

from tableview.

brkckr avatar brkckr commented on May 18, 2024

Then I have no other solution. Hope you can solve it.

from tableview.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.