kiah2008 / android-page-curl

Automatically exported from code.google.com/p/android-page-curl
0 stars 0 forks source link

Adding more images #12

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I seem unable to add any more images with the app just crashing on my attempt, 
any help would be great

mPages = new ArrayList<Bitmap>();
        mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.front));
        mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.page0b1));
        mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.page1b1));
        mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.page2b1));
        mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.page3b1));
        mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.page4b1));
        mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.page5b1));
        mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.page6b1));
        mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.page7b1));
        mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.page8b1));
        mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.page9b1));
        mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.page10b1));
        mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.page11b1));
        mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.page12b1));
        mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.page13b1));
        mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.page14b1));
        mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.page15b1));

        // Create some sample images
        mForeground = mPages.get(0);
         m0 = mPages.get(1);
         m1 = mPages.get(2);
         m3 = mPages.get(3);
         m4 = mPages.get(4);
         m5 = mPages.get(5);
         m6 = mPages.get(6);
         m7 = mPages.get(7);
         m8 = mPages.get(8);
         m9 = mPages.get(9);
         m10 = mPages.get(10);
         m11 = mPages.get(11);
         m12 = mPages.get(1);
         m13 = mPages.get(13);
         m14 = mPages.get(14);
         m15 = mPages.get(15);
         m16 = mPages.get(16);

and then added

@Deprecated
    private void SwapViews() {
        Bitmap temp = mForeground;
        mForeground = m0;
        m0 = m1;
        m1 = m2;
        m2 = m3;
        m3 = m4;
        m4 = m5;
        m5 = m6;
        m6 = m7;
        m7 = m8;
        m8 = m9;
        m9 = m10;
        m10 = m11;
        m11 = m12;
        m12 = m13;
        m13 = m14;
        m14 = m15;
        m15 = m16;
        m6 = temp;
    }

Original issue reported on code.google.com by kieranwe...@gmail.com on 10 May 2012 at 9:10

GoogleCodeExporter commented 8 years ago
you should not load many images, instead you should stream them in and only 
handle 2 images.

Original comment by B.Thax....@gmail.com on 7 Jun 2012 at 10:11

GoogleCodeExporter commented 8 years ago
        // Create pages
        mPages = new ArrayList<Bitmap>();

        mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.splash));
        mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.a1));
        mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.a2));
        mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.a3));
        mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.a4));
        mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.a5));
        mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.a6));
        mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.a7));
        mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.a8));
        mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.a9));
        mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.a10));
        mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.a11));
        mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.a12));
        mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.a13));
        mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.a14));
        mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.a15));
        mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.a16));
        mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.a17));

        mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.a18));
//      mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.a19));
//      mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.a20));
//      mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.a21));
//      mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.a22));
//      mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.a23));
//      mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.a24));
//      mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.a25));
//      mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.a26));
//      mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.end));

i hav also same problem, isn't run. if used only 18 images its run properly bt 
more than it's not work

Original comment by aashish....@gmail.com on 26 Dec 2013 at 1:42