Git Product home page Git Product logo

android-shape-imageview's People

Contributors

siyamed avatar stefma avatar twiceyuan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-shape-imageview's Issues

Rounded Hexagon

It seems that i can't make my hexagon corners go round

<com.github.siyamed.shapeimageview.HexagonImageView
                        android:layout_width="@dimen/profile_picture_size"
                        android:layout_height="@dimen/profile_picture_size"
                        android:src="@drawable/neo"
                        app:siBorderWidth="10dp"
                        app:siBorderColor="@color/blue"
                        app:siRadius="10dp"
                        android:layout_alignParentTop="true"
                        android:layout_centerHorizontal="true"
                        android:id="@+id/view_profile_pic"
                        android:scaleType="centerCrop"/>

Am I doing it wrong?

Not work with Glide

Hi,

I'm using Glide to load an image to your DiamondImageView and it show as square. But it work well with Picasso. So, without using Picasso do you have any hint for it?

i habe error when using library android-shape-imageview

In my layout i using CircularImageView :
////-------
--- com.github.siyamed.shapeimageview.CircularImageView
android:id="@+id/imgShow"
android:layout_width="64dp"
android:layout_height="64dp"
android:src="@drawable/photo"/ // set my image (photo.jpg 88x88 px)

i habe a result :

image

it remains straight line in four edge of image. i dont know why . i try to fix but dont

unable to move image in imageview

I was using your library and i found this very useful . I am making an app where i want to add a functionality for drag ,zoom image within the imageview . I have tried to implement that functionality but couldn't help myself . I was wondering if you could do something

Update request.

I want to read source codes of this project. But settings are too old to succeed opening the project. So could you update them? Thanks for your contribution.

After updating to 0.9.2 I am having problem in project

Error:(222) No resource identifier found for attribute 'borderWidth' in package 'com.app.demo'
Error:(222) No resource identifier found for attribute 'borderAlpha' in package 'com.app.demo'
Error:(222) No resource identifier found for attribute 'borderColor' in package 'com.app.demo'

Please check, also Let me know if some thing needs to be done from my end to fix these

👍 for the great library

Error on running

hi, i can't use this your project in Android Studio 1.1
image has attached. please check and help me :)
tnx dear friend

scaleimage_gradle_eroor

Get same effect on TextView

Hi,nice work.I know this is off-topic but would it be possible to create an hexagon textview using same principles? I need an hexagon with borders and transparent background as the background of android textview...Thanks...

Black line when roundedimageview used issue

hi,
great library thanks for all of it. I have an issue when I try to use your roundedimageview view. This is my xml define :
<com.github.siyamed.shapeimageview.RoundedImageView
android:id="@+id/iv_message_image"
android:layout_width="250dp"
android:layout_height="match_parent"
android:contentDescription="@string/app_name"
android:scaleType="fitXY"
app:siRadius="11dp"
app:siBorderWidth="2dp"
android:padding="1dp"
app:siBorderColor="@color/chat_bubble_green"
app:siSquare="true"
android:src="@drawable/profile" />

In the top layout I have a linearlayout which has a 9 png as background. Anyway this implementation is in a recyclerview. And some items in that view some of the roundedimageview's side have black line. This is what I want to mean :
issue

Any ideas? Thanks...

Circular imageView orientation wrong

Hi,

I have a problem when setting image from a phone gallery. It doesn't change orientation of the image. I tried changing bitmap orientation programmatically, but nothing happened.

Here is my code:
Uri selectedImage = data.getData();
String[] filePathColumn = { MediaStore.Images.Media.DATA };

        Cursor cursor = getActivity().getContentResolver().query(selectedImage,
                filePathColumn, null, null, null);
        cursor.moveToFirst();

        int columnIndex = cursor.getColumnIndex(filePathColumn[0]);
        selectedImagePath = cursor.getString(columnIndex);
        cursor.close();
        avatar.setImageBitmap(BitmapFactory.decodeFile(selectedImagePath));

This is the xml:

<com.github.siyamed.shapeimageview.RoundedImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/avatar"
app:siRadius="100dp"
app:siBorderWidth="0dp"
app:siBorderColor="#666"
app:siSquare="true"
android:id="@+id/imageViewAv"
/>

This is just a preview of a profile photo.

Thanks,
Jovan

Bug: truncated borders when setting image later

This is what I get for this code:

    final CircularImageView imageView = (CircularImageView) findViewById(R.id.image);
    new Handler().postDelayed(new Runnable() {
        @Override
        public void run() {
            imageView.setBorderWidth(4);
            imageView.setBorderColor(0xff000000);
            imageView.setImageResource(R.drawable.landscape);
        }
    },1000);


<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="center"
    android:orientation="vertical"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context="com.example.user.myapplication.MainActivity">

    <com.github.siyamed.shapeimageview.CircularImageView
        android:id="@+id/image"
        android:layout_width="100dp"
        android:layout_height="100dp"/>

    <ImageView
        android:id="@+id/original"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="4dp"
        android:background="#3300ff00"
        android:src="@drawable/landscape"/>
</LinearLayout>

device-2016-02-18-152229

CircularImageView has no size until it draws itself

It's using a fixed width and height, but in the editor it has width/height of 0. At runtime, it has width/height of 0 until it draws something. This is a problem because it's in a RelativeLayout and other views are aligned to it, which makes them shift in front of you.

I looked at the onMeasure code and I can't see why this happens.

I am settings its content with Picasso, but that shouldn't matter - the size is fixed so it should never be getting resized.

<com.github.siyamed.shapeimageview.CircularImageView
android:id="@+id/user_photo_image_view"
android:layout_width="66dp"
android:layout_height="66dp"
/>

My workaround is to put it inside of a LinearLayout that has a fixed size.

License

Siyamed, thank you for great library. I would love to use in my project but I have a small problem with your license.

Apache License 2.0 standard legal line typically begins with:
Copyright {yyyy} {name of copyright owner}
In the case of your Android-ShapeImageView, only the subsequent “Licensed under the Apache License, Version 2.0 ...” is listed without any copyright owner preceding it.

Would you mind adding your copyright information to it?
thank you,
Janusz

Don't show image Android API 15

Some images with shape are not displayed on the Android API level 15.
For example: HeartImageView, HexagonImageView does not work, but with CircularImageView works.

<com.github.siyamed.shapeimageview.CircularImageView
        android:layout_width="48dp"
        android:layout_height="48dp"
        android:src="@android:drawable/sym_def_app_icon"
        app:siBorderWidth="2dp"
        app:siBorderColor="#fff"
        android:id="@+id/imgUsuario" />

Bug: siBorderWidth=0px doesn't really disable the border

Try setting this:

<com.github.siyamed.shapeimageview.CircularImageView
    android:id="@+id/image"
    android:layout_width="100dp"
    android:layout_height="100dp"
    android:src="@drawable/landscape"
    app:siBorderWidth="0px"/>

It will still show a border.
Even when I set app:siBorderColor="#00000000" , it still appears...

Anyone able to use this with proguard on?

Loving this project!

Can't seem to build an APK if proguard is turned on though. Tried different -dontwarn schemes, but to no avail. Any ideas? Seems related to the kXML?

REQUEST si square reversal

is it possible to make si square true give the max height or width rather than the minimum,
thanks for your library it works well for my requirement other than sometimes part of my image is cut off, changing si square to look for the max would fix this, you could then offer a color the background should be inside the empty space

SVG-based ImageView can't be displayed on Samsung GT-N7100

I run the sample code and find out that all svg-based ImageView can't be displayed on Samsung GT-N7100 and GT-I9100G. I don't have many handsets to test but those are the only handsets with the issue.

I am integrating this library into a commercial project and I am trying to figure out the cause. It's important for me to resolve the issue.

CenterInside not working with pentagonImageView

I have an image with scaletype centerInside but isn't working, i have this:
<com.github.siyamed.shapeimageview.PentagonImageView
android:layout_width="match_parent"
android:layout_height="75dp"
android:src="@drawable/restaurant"
android:scaleType="centerInside"
/>

No Borders are showing up

The shape works however no borders are showing up

    <com.github.siyamed.shapeimageview.HexagonImageView
        android:id="@+id/img_circle"
        android:layout_width="40dp"
        android:layout_height="40dp"
        android:src="@drawable/pub"
        app:siBorderWidth="6dp"
        app:siBorderColor="@color/colorPrimaryDark"/>

Zoom in/out not working

Hello.

Zoom In/out not working. what should be wrong?
Same code working with normal ImageView.

How to using with Picasso library

I using Picasso to load image from network and display on CircularImageView. code :

Picasso.with(mContext).load(feedItem.getUrlImgShow())
.error(R.drawable.sample_2)
.placeholder(R.drawable.placeholder)
.into(myViewholder.thumbnail);

Aber it dont load image. i reading in Sample. you creat the Contructor in Adapter class with Picasso .

private Adapter(Context context, Picasso picasso, int layout) {
super(context, 0);
this.picasso = picasso;
this.layout = layout;
}
aber i dont. Creat picasso in Adapter Contructor,it is mandatory(required )

What is the Latest version of this Library?

Your library is very useful. Thank You.

The version as seen in the below statement is 0.9+ and android studio throws a warning for such statements.
compile 'com.github.siyamed:android-shape-imageview:0.9.+@aar'

Can you tell me whats the new version is ??

Posible memory leak issue

Hello,

First of all great library, thank you. I think you have a memory leak in your code that is causing OutOfMemory errors. I have added these lines of code in the PorterImageView class and they are gone now. I'm not really sure if they are all needed.

    @Override
    protected void onDetachedFromWindow()
    {
        super.onDetachedFromWindow();
        if (maskBitmap != null && !maskBitmap.isRecycled()) maskBitmap.recycle();
        if (drawableBitmap != null && !drawableBitmap.isRecycled()) drawableBitmap.recycle();
    }
 private void createMaskCanvas(int width, int height, int oldw, int oldh)
    {
            ...
            Bitmap oldBitmap = maskBitmap;
            maskBitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
            if (oldBitmap != null && oldBitmap != maskBitmap && !oldBitmap.isRecycled()) oldBitmap.recycle();
            maskCanvas.setBitmap(maskBitmap);

            ...

            oldBitmap = drawableBitmap;
            drawableBitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
            if (oldBitmap != null && oldBitmap != drawableBitmap && !oldBitmap.isRecycled()) oldBitmap.recycle();
            drawableCanvas.setBitmap(drawableBitmap);
            ...
        }
    }

How to set custom background color to Controller

Hey! How could I set a custom background for CircularImageView?
I´ve got the CircularImageView onto another ImageView and I want to make the background inside the circle be white instead of transparent. How could I do?

image

I tried using setBackground color and got this :(

image

Thanks in advance!

i cant it libery in eclipce

hi dear,
I want libery android-shape-imageview import into eclipse
but i cant.i want just diamond shape image view

Is it possible for me to put diamond class ????

Shaped Network ImageView

Is it possible to combine this with the Volley NetworkImageView? I would like to pull my images from url's or json but have them take the shape of my svg/shape once loaded. Is this possible or can it be done? I tried combining the two classes into one class but it didn't work. I think the way ShapeImageView and NetworkImageView set/load the image(s) is different. Trying to figure this out but would appreciate any help. I'm sure this idea/concept would come in very handy for a lot of other people. Thanks in advance for any reply.

attrs shape and radius already defined

Hi, I am trying to add the aar using gradle as below
compile 'com.github.siyamed:android-shape-imageview:0.9.+@aar'

upon using find tool I found that radius is already used my ViewPagerIndicator, because of which I am unable to add the library.

Is there any workaround to change the attrs name so that I can add it into my project?

How to Rotate Hexagon shape?

I would like to rotate hexagon shape for my design. You can just consider your svg that rotates 90 angle. How can I make this? Please help me....

Package name was changed.

com.github.siyamed.shapeimageview.shape.PorterShapeImageView
was changed to
com.github.siyamed.shapeimageview.mask.PorterShapeImageView

please update README.
Thx.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.