Android Open Source - android-shape-imageview Sample Activity






From Project

Back to project page android-shape-imageview.

License

The source code is released under:

Apache License

If you think the Android project android-shape-imageview listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.github.siyamed.shapeimageview.sample;
// w w w . ja  v a  2  s  .  c om
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v7.app.ActionBarActivity;

import com.astuetz.PagerSlidingTabStrip;

public class SampleActivity extends ActionBarActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_sample);

        getSupportActionBar().hide();

        ViewPager pager = (ViewPager) findViewById(R.id.pager);
        pager.setAdapter(new PagerAdapter(getSupportFragmentManager()));
        PagerSlidingTabStrip tabStrip = (PagerSlidingTabStrip) findViewById(R.id.tabs);
        tabStrip.setViewPager(pager);
    }

    public class PagerAdapter extends FragmentPagerAdapter {
        public PagerAdapter(FragmentManager fm) {
            super(fm);
        }

        @Override
        public Fragment getItem(int position) {
            Fragment fragment;

            switch (position) {
                case 0:
                    fragment = SampleBubbleFragment.newInstance(R.layout.list_item_shader_bubble_left, R.layout.list_item_shader_bubble_right);
                    break;
                case 1:
                    fragment = SampleListFragment.newInstance(R.layout.list_item_shader_circle);
                    break;
                case 2:
                    fragment = SampleListFragment.newInstance(R.layout.list_item_shader_rounded);
                    break;
                case 3:
                    fragment = SampleFragment.newInstance(R.layout.fragment_all_sample);
                    break;
                case 4:
                    fragment = SampleFragment.newInstance(R.layout.fragment_shader_sample);
                    break;
                case 5:
                default:
                    fragment = SampleFragment.newInstance(R.layout.fragment_porter_sample);
                    break;
            }

            return fragment;
        }

        @Override
        public int getCount() {
            return 6;
        }

        @Override
        public CharSequence getPageTitle(int position) {
            String result;
            switch (position) {
                case 0:
                    result = "Chat Bubble(S)";
                    break;
                case 1:
                    result = "Circle(S)";
                    break;
                case 2:
                    result = "Rounded(S)";
                    break;
                case 3:
                    result = "Samples";
                    break;
                case 4:
                    result = "Shaders";
                    break;
                case 5:
                default:
                    result = "Porter";
                    break;

            }
            return result;
        }
    }
}




Java Source Code List

com.github.siyamed.shapeimageview.BubbleImageView.java
com.github.siyamed.shapeimageview.CircularImageView.java
com.github.siyamed.shapeimageview.DiamondImageView.java
com.github.siyamed.shapeimageview.HeartImageView.java
com.github.siyamed.shapeimageview.HexagonImageView.java
com.github.siyamed.shapeimageview.OctogonImageView.java
com.github.siyamed.shapeimageview.PentagonImageView.java
com.github.siyamed.shapeimageview.RoundedImageView.java
com.github.siyamed.shapeimageview.ShaderImageView.java
com.github.siyamed.shapeimageview.ShapeImageView.java
com.github.siyamed.shapeimageview.StarImageView.java
com.github.siyamed.shapeimageview.mask.PorterCircularImageView.java
com.github.siyamed.shapeimageview.mask.PorterImageView.java
com.github.siyamed.shapeimageview.mask.PorterShapeImageView.java
com.github.siyamed.shapeimageview.path.SvgUtil.java
com.github.siyamed.shapeimageview.path.parser.CopyInputStream.java
com.github.siyamed.shapeimageview.path.parser.IdHandler.java
com.github.siyamed.shapeimageview.path.parser.IoUtil.java
com.github.siyamed.shapeimageview.path.parser.NumberParse.java
com.github.siyamed.shapeimageview.path.parser.ParseUtil.java
com.github.siyamed.shapeimageview.path.parser.ParserHelper.java
com.github.siyamed.shapeimageview.path.parser.PathInfo.java
com.github.siyamed.shapeimageview.path.parser.PathParser.java
com.github.siyamed.shapeimageview.path.parser.SvgToPath.java
com.github.siyamed.shapeimageview.path.parser.TransformParser.java
com.github.siyamed.shapeimageview.sample.SampleActivity.java
com.github.siyamed.shapeimageview.sample.SampleBubbleFragment.java
com.github.siyamed.shapeimageview.sample.SampleFragment.java
com.github.siyamed.shapeimageview.sample.SampleListFragment.java
com.github.siyamed.shapeimageview.shader.BubbleShader.java
com.github.siyamed.shapeimageview.shader.CircleShader.java
com.github.siyamed.shapeimageview.shader.RoundedShader.java
com.github.siyamed.shapeimageview.shader.ShaderHelper.java
com.github.siyamed.shapeimageview.shader.SvgShader.java