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 6334519
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T18:40:30+00:00 2026-05-24T18:40:30+00:00

How to design movable (Drag/Drop) view in android. In my case There will be

  • 0

How to design movable (Drag/Drop) view in android.

In my case
enter image description here

There will be four rows and all will be movable.

User can arrange all 4 rows like 1234, 2341, 3421, 1243…… any combination of 1234.

So how can it will be?

All rows are layouts.

  • 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-05-24T18:40:31+00:00Added an answer on May 24, 2026 at 6:40 pm

    Have a members declared for holding the currently dragging bitmap, view, and current dragging x and y coords.

    • Override the onTouch of the parent view.
    • In ACTION_DOWN event get the drawing cache(Bitmap) of the dragging view by calling getDrawingCache() and set to the drag bitmap member. Invalidate the layout (so that onDraw gets called, where you draw the currently dragging view). Hide the current dragging view.
    • In ACTION_MOVE draw (invalidate) the dragging view bitmap at current x and y coordinates.
    • In ACTION_UP destroy the dragging bitmap. calculate the current drop location and add the current dragging view to that position in the layout. UnHide the current dragging view. Reset the dragging members.

    In onDraw of parent layout.

    canvas.save();
    canvas.drawBitmap(mDragBmp, mDragX, mDragY);
    canvas.restore();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Design patterns are usually related to object oriented design. Are there design patterns for
Quick design question. ClassA has a method called DoSomething(args) In DoSomething(), before it can
Design pattern can separate 3 important parts. Why three part? Creational Patterns Structural Patterns
I design my database incorrectly, should I fix this while its in development? user
Hey design pattern experts- I'm trying to build a four step process into a
I have a design in an psd file. So I copied all text properties
Design :- 1)A story board has a number of slides, each slide can have
I design a multi-threaded application that will monitor and handle files in selected folders
Design an OO parking lot. What classes and functions will it have? It should
Design an algorithm to find all pairs of integers within an array which sum

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.