Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8010123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T18:38:52+00:00 2026-06-04T18:38:52+00:00

I am trying to build a simple app that will show a bidimensional, scrollable

  • 0

I am trying to build a simple app that will show a bidimensional, scrollable matrix of square tiles. Imagine a 2D Rubick’s Cube, where you can choose to scroll a single row or a single column as if it was a ring.

I’ve placed a RelativeLayout inside the main view, and placed all the tiles of the matrix inside of it, through a custom implementation of the ImageView component. I set the exact position of the single tile manipulating its RelativeLayout.LayoutParams value:

RelativeLayout rl = ...;
TileView tile = ...;
RelativeLayout.LayoutParams rlp = new RelativeLayout.LayoutParams(size, size);
rlp.setMargins(left, top, 0, 0);
rl.addView(tile, rlp);

I really do not like this approach since I would like to change the top and left parameters of the tile instead of the margins, but that’s the best I have been able to do.

I attached a listener to each tile to handle the dragging of the relative row or column, depending on the direction of the dragging event. Everything seems to work quite fine, except for a few problems:

  1. When I scroll a row to the right, the last tile on the right margin will progressively shrink as if it was trying to fill the remaining space, and will eventually disappear.
  2. When I then scroll back to the left the disappeared tiles will not reappear.

Furthermore, I still have to figure what is the best way to give the user the illusion of an infinite row/column. I think I should replicate all the tiles on both sides of each row/column, probably only when that row/column is being scrolled.

I am asking you for help just to understand what you think is the best way to realize this interface, since I think I am messing up with the code. If you need any more details, just ask me.

Thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T18:38:54+00:00Added an answer on June 4, 2026 at 6:38 pm

    If I were doing this, my inclination would be to go at it at a lower level than you are. I’d use a SurfaceView as the main View and render the tiles with Canvas.drawBitmap(). It probably sounds like more work, but I think that it’s the right way to do what you’re trying to do, and that ultimately you’ll be happier with the results.

    To address your two problems:

    1. The version of drawBitmap() I linked to lets you specify the subset of the Bitmap to draw, so you can clip the tile rather than shrinking it as it goes off the screen.
    2. You’ll be responsible for determining what goes where (and drawing it there), so your data structure representing the tile matrix needs to represent off-screen tiles as well.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to build a simple GUI app in java that will show
I'm trying to build a simple Asp.Net website that will list some files. Each
I'm trying to build an app that will display stats for a certain game
I'm new to ruby/rails and trying to build a simple Projects / Tags app
I'm trying to build a simple Magento Module that needs to connect to the
I'm trying to build a simple jquery plugin that can take selectors as parameters.
I'm trying to build a simple GAE application that would read a textbox, pass
I'm trying to learn how to build apps for Android. The first simple app,
I am trying to create an android app that will connect to various web
I'm trying to build a very simple sinatra app deployed on heroku. our app

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.