How to let user know, an ImageView is clickable

Vojtěch Pešek

I have an ImageView(see image below), which is clickable. When the user clicks on the ImageView, he gets redirected to website. This is all running fine.

My question is, how to let user know, he can click the image, how to make this feature visible?

I can add text under the image, but thats not, what i want. I would like some small icon or window(like dialog), which can be closed.

Thanks!

Image

Vojtěch Pešek

So I searched and found this. This is @kgandroid suggested.

I add a little bit of code:

private FrameLayout mFrame;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    mFrame = new FrameLayout(this);
    mFrame.addView(LayoutInflater.from(getBaseContext()).inflate(R.layout.activity_single_list_view, null));
    setContentView(mFrame);

    SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0);
    boolean overlayShown = settings.getBoolean("overlayShown", false);
    if(!overlayShown){
        setupHelpOverlay();
    }
    ...
}

private void setupHelpOverlay(){

    final View tutView = LayoutInflater.from(getBaseContext()).inflate(R.layout.activity_detail_overlay, null);
    if(mFrame != null){
        mFrame.addView(tutView);
    }

    // We need an Editor object to make preference changes.
    // All objects are from android.context.Context
    SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0);
    SharedPreferences.Editor editor = settings.edit();
    editor.putBoolean("overlayShown", true);

    // Commit the edits!
    editor.commit();

    Button btnDismiss = (Button) tutView.findViewById(R.id.button_overlay);
    btnDismiss.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v){
            mFrame.removeView(tutView);
        }
    });
}

And the activity_deatil_overlay.xml:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/transparent_gray" >

    <TextView
        android:id="@+id/textView2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_above="@+id/textView1"
        android:layout_centerHorizontal="true"
        android:textSize="20sp"
        android:gravity="center"
        android:textColor="@color/white"
        android:text="@string/overlay_text"
        android:paddingBottom="10dp" />

    <View
        android:id="@+id/textView1"
        android:layout_width="1dp"
        android:layout_height="1dp"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true" />

    <Button
        android:id="@+id/button_overlay"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/textView1"
        android:layout_centerHorizontal="true"
        android:text="@string/overlay_button"
        android:textColor="@color/white"
        android:paddingTop="10dp" />

</RelativeLayout>

On the first start, it shows help overlay.

Image

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to let user know, an ImageView is clickable

From Dev

How to grey out a button to let the user know that it is currently disabled in iOS?

From Dev

How to make a pin markers clickable on Imageview

From Dev

How to make a clickable imageview from png image

From Dev

How to make a pin markers clickable on Imageview

From Dev

How to know which imageview is selected

From Dev

How can show the "Action Bar Sherlock" for only a moment to let the user know that it exists?

From Dev

How do you let the browser know that the user already viewed the specific page in - Ioinic

From Dev

How to create programatically Hexagon UIButton or Clickable ImageView with Swift

From Dev

How to create programatically Hexagon UIButton or Clickable ImageView with Swift

From Dev

How to let the .bashrc know the current operation system

From Dev

ImageView not Clickable in Dialog Fragment

From Dev

Clickable ImageView during TranslateAnimation

From Dev

Android GridView clickable ImageView

From Dev

imageView clickable and scrollable

From Dev

Make imageView in gridView clickable

From Dev

Let user start celery task, and let user know when task is completed

From Dev

Display [...] to let user know more characters are available off screen

From Dev

Let a ViewModel know when the user scrolled to the end of a ListView in XAML with MVVM

From Dev

How to let user pick colormap?

From Dev

How to let a user input a function

From Dev

How to not let the user divide by 0?

From Dev

Android How to know if the user is inactive

From Dev

android selector for clickable layout with imageview

From Dev

Android - create clickable area on imageview

From Dev

Button behind Surface / Imageview is clickable?

From Dev

Drawable Button or Clickable ImageView in android

From Dev

How to find OldPassword to let the user change it

From Dev

How to let the user reorder sections in a UITableView

Related Related

  1. 1

    How to let user know, an ImageView is clickable

  2. 2

    How to grey out a button to let the user know that it is currently disabled in iOS?

  3. 3

    How to make a pin markers clickable on Imageview

  4. 4

    How to make a clickable imageview from png image

  5. 5

    How to make a pin markers clickable on Imageview

  6. 6

    How to know which imageview is selected

  7. 7

    How can show the "Action Bar Sherlock" for only a moment to let the user know that it exists?

  8. 8

    How do you let the browser know that the user already viewed the specific page in - Ioinic

  9. 9

    How to create programatically Hexagon UIButton or Clickable ImageView with Swift

  10. 10

    How to create programatically Hexagon UIButton or Clickable ImageView with Swift

  11. 11

    How to let the .bashrc know the current operation system

  12. 12

    ImageView not Clickable in Dialog Fragment

  13. 13

    Clickable ImageView during TranslateAnimation

  14. 14

    Android GridView clickable ImageView

  15. 15

    imageView clickable and scrollable

  16. 16

    Make imageView in gridView clickable

  17. 17

    Let user start celery task, and let user know when task is completed

  18. 18

    Display [...] to let user know more characters are available off screen

  19. 19

    Let a ViewModel know when the user scrolled to the end of a ListView in XAML with MVVM

  20. 20

    How to let user pick colormap?

  21. 21

    How to let a user input a function

  22. 22

    How to not let the user divide by 0?

  23. 23

    Android How to know if the user is inactive

  24. 24

    android selector for clickable layout with imageview

  25. 25

    Android - create clickable area on imageview

  26. 26

    Button behind Surface / Imageview is clickable?

  27. 27

    Drawable Button or Clickable ImageView in android

  28. 28

    How to find OldPassword to let the user change it

  29. 29

    How to let the user reorder sections in a UITableView

HotTag

Archive