Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Follow these steps :</p> <p>1- Create image_border.xml in the drawable with the below code : </p> <pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;layer-list xmlns:android="http://schemas.android.com/apk/res/android" &gt; &lt;item&gt; &lt;shape android:shape="rectangle" &gt; &lt;gradient android:angle="90" android:centerColor="#30ffffff" android:endColor="#30ffffff" android:startColor="#30ffffff" /&gt; &lt;/shape&gt; &lt;/item&gt; &lt;item &gt; &lt;shape android:shape="rectangle" &gt; &lt;solid android:color="#30ffffff" /&gt; &lt;/shape&gt; &lt;/item&gt; </code></pre> <p></p> <p>2- create another XML image_borderless.xml in the drawable with the below code :</p> <pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;layer-list xmlns:android="http://schemas.android.com/apk/res/android" &gt; &lt;item&gt; &lt;shape android:shape="rectangle" &gt; &lt;gradient android:angle="90" &gt;&lt;/gradient&gt; &lt;/shape&gt; &lt;/item&gt; &lt;item &gt; &lt;shape android:shape="rectangle" &gt; &lt;/shape&gt; &lt;/item&gt; </code></pre> <p></p> <p>3- in your onClick implementation add this code :</p> <pre><code> wp1.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { //wp1 to add a boarder if selected wp1.setBackgroundDrawable(getResources().getDrawable( R.drawable.image_border)); wp1.setPadding(8, 8, 8, 8); //wp3 to hide the boarder if not selected wp3.setBackgroundDrawable(getResources().getDrawable( R.drawable.image_borderless)); } }); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload