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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T17:44:56+00:00 2026-05-20T17:44:56+00:00

I have a widget and I want to draw an orange frame around a

  • 0

I have a widget and I want to draw an orange frame around a tap zone on the widget. The frame should appear when a user tapped on the tap zone and disapper when the user releases his/her finger.

At this time I’m using separate layouts for each tap zone. Them works fine except the frame. I guess, I need to set

android:clickable="true"
android:focuseable="true"

for each layout. Also, I prepared a transparent shape drawable with orange border. But I can’t find out what should I do next. How to draw the shape on the tap zone only while it’s tapped?

  • 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-20T17:44:57+00:00Added an answer on May 20, 2026 at 5:44 pm

    I found the answer on my question here. I have no enough reputation to vote for abscondment’s answer. So, could someone please to vote at his post?
    As about this question,

    android:clickable="true"
    android:focuseable="true"
    

    attributes are not needed. I simple created a drawable:

    <?xml version="1.0" encoding="UTF-8"?>
    <selector
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:constantSize="true">
      <item android:state_pressed="true">
        <shape android:shape="rectangle">
          <corners android:radius="4dp" />
          <solid android:color="@android:color/transparent" />
          <stroke
            android:width="2dp"
            android:color="#eeffd700"
          />
        </shape>
      </item>
    </selector>
    

    and set the drawable as a background to my tap zones, like this:

    <LinearLayout
      android:background="@drawable/selection_rectangle"
    />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a gtk widget and I want to find out if within its
I have a recaptcha widget in my form and i want it to be
I have a widget with a prefs activity. In that activity the user is
I have a 4x4 widget and i want to update a little piece of
I have a widget containing multiple child objects, which the user can select by
I want to write a widget in Qt that doesn't have decoration. And here
I have home screen widget and I want add sizes *x5 to it. But
Here I have a widget and I want to call a function once #slider.slider();
I have a widget that is configured through an activity (I do not want
I have the following widget that I want to set the footerText option when

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.