Click here to Skip to main content
15,902,189 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
collage_item_one.xml
HTML
<relativelayout xmlns:android="http://schemas.android.com/apk/res/android">
    android:id="@+id/rel"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="center">
    <com.cgfx.photo.cgspecialfx.widget.photosortrview>
        android:id="@+id/photoSortrViewOne"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />
    <ImageView
        android:id="@+id/ivOne"
        android:layout_width="50dp"
        android:layout_height="50dp"
        android:layout_centerInParent="true"
        android:src="@drawable/addnewpic"/>
</com.cgfx.photo.cgspecialfx.widget.photosortrview>
</relativelayout>





one.xml
XML
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/rlScreenShot"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <LinearLayout
        android:id="@+id/llBackground"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_centerInParent="true"
        android:removed="@android:color/transparent"
        android:orientation="vertical" >
        <include
            android:id="@+id/view1"
            layout="@layout/college_item_one" />
    </LinearLayout>

</RelativeLayout>


main.xml

HTML
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:whatever="http://schemas.android.com/apk/res-auto"
    xmlns:widget="http://schemas.android.com/apk/res-auto"
    xmlns:ads="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:removed="@color/gray"
    android:orientation="vertical" >

HTML
<com.pixr.photo.cgspecialfx.widget.SquareFrameLayout
        android:id="@+id/squareFrameLayout"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_centerInParent="true"
        android:layout_below="@+id/adView"
        android:removed="@android:color/white" >

        <ViewStub
            android:id="@+id/changeLayout"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            layout="@layout/college_item_one" />

        <ImageView
            android:id="@+id/ivFrame"
            android:layout_width="match_parent"
            android:layout_height="match_parent" >
        </ImageView>

        <com.pixr.photo.cgspecialfx.widget.PhotoSortrView
            android:id="@+id/photoSorterStickerView"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:visibility="gone" />
    </com.pixr.photo.cgspecialfx.widget.SquareFrameLayout>

HTML
</RelativeLayout>


activity.java
Java
public class CollegeActivity extends Activity implements OnClickListener,
		OnTouchListener, OnItemClickListener, SeekBar.OnSeekBarChangeListener {

Java
@Override
	protected void onCreate(Bundle savedInstanceState) {

		super.onCreate(savedInstanceState);

		Intent intent = getIntent();
		int id = intent.getIntExtra(Utils.GRID_ITEM_NO, 0);
		setLayoutBasedFromChooser(id);

		ParseInstallation.getCurrentInstallation().saveInBackground();
	}


Java
private void setLayoutBasedFromChooser(int id) {
		System.out.println("Selected ID is : - " + id);
		switch (id) {
		case 0:
			layout = R.layout.one;
			break;
}
		setContentView(R.layout.college_main);

		initilizationView();
	}
private void initilizationView() {

		squareFrameLayout = (SquareFrameLayout) findViewById(R.id.squareFrameLayout);
		stub = (ViewStub) findViewById(R.id.changeLayout);
		stub.setLayoutResource(layout);
		View inflated = stub.inflate();

              includeView1 = (View) findViewById(R.id.view1);

if (includeView1 != null) {
			pView1 = (PhotoSortrView) includeView1
					.findViewById(R.id.photoSortrViewOne);
			pView1.setBackgroundColor(Color.DKGRAY);
			params1 = (RelativeLayout.LayoutParams) pView1.getLayoutParams();
			ivSelectorImage[0] = (ImageView) includeView1
					.findViewById(R.id.ivOne);

@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		switch (v.getId()) {
		case R.id.ivOne:
			pSelected = pView1;
			onGalleryClicked();
			break;
}}
		}

......

What I have tried:

above code will give a square shape grid i want make it as a round shape .what should i do..?
Posted
Updated 8-Aug-16 0:30am
v6
Comments
Suvendu Shekhar Giri 3-Aug-16 4:49am    
please update with more details

1 solution

Couple of things here. Do you tried creating a custom round shape by xml code and apply it inside imageview? Do you tried that round shape as a background of photosortrview?

Beyond these 2 options there is another one, create custom shaped imageview from raw code like this one [^]and apply it in place of default imageview. Hope you get it.
 
Share this answer
 
Comments
lavanya dhoni 8-Aug-16 9:01am    
already i tried the shape but it's not applicable to that photosortrview,it shows square shape only.thanks for answering..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900