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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:00:29+00:00 2026-06-11T01:00:29+00:00

I created glow effect imageview application. its working fine, my problem is glow effect

  • 0

I created glow effect imageview application. its working fine, my problem is glow effect left,right,bottom,top was little bit hiding so i am trying to set padding but still i have same problem. how to solve this problem?

code:

ImageView mImageBk = (ImageView)itemTemplate.findViewById(R.id.imgBk);
RelativeLayout.LayoutParams ImgBKLayoutParams = new RelativeLayout.LayoutParams(scrWidth/8 + scrWidth/20, scrWidth/8 + scrWidth/20 );
ImgBKLayoutParams.leftMargin =0;
ImgBKLayoutParams.topMargin = 0;
mImageBk.setLayoutParams(ImgBKLayoutParams);
mImageBk.setImageResource(R.drawable.glow_effect);
mImageBk.setPadding(10, 10, 10, 10);
mImageBk.setVisibility(View.GONE);

full code :

public class tttAdapter extends BaseAdapter{
    private Context mContext;
    private int scrWidth=0;
    private int scrHeight=0;
    private int scrDpi = 0;
    private boolean setInvisible = false;
    private boolean visibleConf[];
    private boolean selected[];
    private boolean innerListView = false;


    private int[] IMAGE_IDS = {  
            R.drawable.s_record, R.drawable.s_record
    };  
    private String[] title = {
            "Tv", "My Favorites List1"
    };

    private String[] detail = {
            "Tv", "My Favorites List1"  
            };

    public favoritesAdapter(Context context) {
        mContext = context;
        visibleConf = new boolean[IMAGE_IDS.length];
        selected = new boolean[IMAGE_IDS.length];
    }

    public void updateImageSize(int width, int height, int dpi) {
        scrWidth= width;
        scrHeight = height;
        scrDpi = dpi;

    }
    public void setTextVisible(int position){
        if(IMAGE_IDS.length <= position)
            return;

        for(int i=0; i < IMAGE_IDS.length; i++) {
            visibleConf[i] = false;
        }

        visibleConf[position] = true;
    }
    public int getCount() {
        return IMAGE_IDS.length;
    }

    public Object getItem(int position) {
        return position;
    }

    public long getItemId(int position) {
        return position;
    }

    public void setTextInvisible(int position) {
        visibleConf[position] = false;
    }

    public void setInnerViewVisible(boolean enable) {
        innerListView = enable;
    }

    public void unsetSelectedItem(int position) {
        for(int i=0; i < IMAGE_IDS.length; i++) {
            selected[i] = false;
        }
    }

    public void setSelectedItem(int position) {
        for(int i=0; i < IMAGE_IDS.length; i++) {
            selected[i] = false;
        }

        selected[position] = true;
    }

    public View getView(int position, View view, ViewGroup parent) {
        LayoutInflater inflater = LayoutInflater.from(mContext);
        View itemTemplate = inflater.inflate(R.layout.list_item, null);


        ImageView mImageBk = (ImageView)itemTemplate.findViewById(R.id.imgBk);
        RelativeLayout.LayoutParams ImgBKLayoutParams = new RelativeLayout.LayoutParams(scrWidth/8 + scrWidth/20, scrWidth/8 + scrWidth/20 );
        ImgBKLayoutParams.leftMargin =0;
        ImgBKLayoutParams.topMargin = 0;
        mImageBk.setLayoutParams(ImgBKLayoutParams);
        mImageBk.setImageResource(R.drawable.glow_effect);
        mImageBk.setPadding(10, 10, 10, 10);
        mImageBk.setVisibility(View.GONE);


        ImageView mImage = (ImageView)itemTemplate.findViewById(R.id.img);
        RelativeLayout.LayoutParams ImgLayoutParams = new RelativeLayout.LayoutParams(scrWidth/8 , scrWidth/8 );
        ImgLayoutParams.leftMargin = scrWidth/38;
        ImgLayoutParams.topMargin = scrWidth/38;

        mImage.setLayoutParams(ImgLayoutParams);
        mImage.setImageResource(IMAGE_IDS[position]);
        mImage.bringToFront();

        TextView mTextTitle = (TextView)itemTemplate.findViewById(R.id.title);
        mTextTitle.setClickable(false);
        mTextTitle.setEnabled(true);
        mTextTitle.setText(title[position]);

        TextView mTextDetail = (TextView)itemTemplate.findViewById(R.id.detail);
        mTextDetail.setClickable(false);
        mTextDetail.setEnabled(true);
        mTextDetail.setText(detail[position]);      

        if(selected[position] == true) {
            ImageView mArrowImg = (ImageView)itemTemplate.findViewById(R.id.imgArrow);
            //mArrowImg.setLayoutParams(new RelativeLayout.LayoutParams(scrWidth/32, scrHeight/32));
            RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(scrWidth/32, scrHeight/32);
            layoutParams.leftMargin = scrWidth / 8;
            layoutParams.topMargin = scrWidth / 16;
            mArrowImg.setLayoutParams(layoutParams);
            mArrowImg.setImageResource(R.drawable.arrow);           
            mImage.setBackgroundResource(R.drawable.test_glowb);
            mTextTitle.setVisibility(View.GONE);
            mTextDetail.setVisibility(View.GONE);
            mImageBk.setVisibility(View.VISIBLE);
        } else {
            if(innerListView == true) {
                mImage.setVisibility(View.GONE);
            }
        }

        if(visibleConf[position] == true) {
            mTextTitle.setTextSize((scrWidth*160) / (30 * scrDpi));
            mTextDetail.setTextSize((scrWidth*160) / (50 * scrDpi));                        
            mTextTitle.setTypeface(null,Typeface.BOLD);
            mTextDetail.setTypeface(null,Typeface.BOLD);
            mImageBk.setVisibility(View.VISIBLE);

        } else {

            mTextTitle.setTextSize((scrWidth*160) / (40 * scrDpi));
            mTextDetail.setTextSize((scrWidth*160) / (70 * scrDpi));
            //mTextTitle.setVisibility(View.GONE);
            //mTextDetail.setVisibility(View.GONE);         
            mImage.setAlpha(150);
        }

        if(innerListView == true) {
            mTextTitle.setVisibility(View.GONE);
            mTextDetail.setVisibility(View.GONE);
        }
        return itemTemplate;
    }
}

xml:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal" >

    <RelativeLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/thumb"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:padding="3dip"
        android:layout_alignParentLeft="true"
        android:layout_marginRight="5dip">

        <ImageView
            android:id="@+id/img"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"/>

         <ImageView
            android:id="@+id/imgBk"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"/>

    </RelativeLayout>

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginRight="14dip"
        android:layout_marginTop="30dp"
        android:layout_centerInParent="true"
        android:layout_toRightOf="@+id/thumb"
        android:orientation="vertical" >

        <TextView
            android:id="@+id/title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignTop="@+id/thumb"
            android:layout_toRightOf="@+id/thumb"
            android:layout_centerVertical="true"
            android:textColor="#ffffff" />

        <TextView
            android:id="@+id/detail"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_toRightOf="@+id/thumb"     
            android:layout_alignParentBottom="true"
            android:textColor="#ffffff" />

        <ImageView 
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/imgArrow"
            android:layout_alignParentRight="true"
            android:layout_centerVertical="true"/>  
    </LinearLayout>
</RelativeLayout>
  • 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-06-11T01:00:31+00:00Added an answer on June 11, 2026 at 1:00 am

    Be sure that you are setting margins/padding for the imageview widget as opposed to the layout container.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a little glow-animation with Core Animation. Animation works fine so
Created application is working toooo slow, looks like there are a lot of memory
I am wondering how I can create an outer glow effect outside a UIView
Created a button in my aspx file and add its click method in the
created a singleview application with storyboard. Added three viewcontrollers apart from the one view
I need to implement outer glow effect on UILabel (or CATextLayer) as above. I
Im trying to create a 'neon glow effect thru a combination of both BlendModes
The following css creates a nice neon-glow effect around text { text-shadow: 0em 0em
I'm trying to create a 'glow' effect using the Android Path class. However, the
I've got a Glow effect (glowIn) being applied to an object on the roll

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.