Created
August 13, 2015 05:22
-
-
Save notdrone-1/b4d6ca31bf2e2d8debf3 to your computer and use it in GitHub Desktop.
Creating a custom view to block image clicks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<com.d_r_o_a_n.inheritence.RestrictedImagView | |
android:id="@+id/image" | |
android:layout_width="50dp" | |
android:layout_height="50dp" | |
android:background="@android:color/holo_red_light" | |
/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ImageView img; | |
img= (ImageView) findViewById(R.id.image); | |
img.setOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View v) { | |
Log.e("DROAN", "Actual Log"); | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void setOnClickListener ( OnClickListener listener ) { | |
OnClickListener listnerNew= new View.OnClickListener() { | |
@Override | |
public void onClick(View v) { | |
Log.e("DROAN","replace with this log"); | |
} | |
}; | |
if (!true) | |
super.setOnClickListener(listener); | |
else | |
super.setOnClickListener(listnerNew); | |
} | |
public void helloDroan(){ | |
Log.e("Hello","Droan"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment