Changeset 14661


Ignore:
Timestamp:
04/19/13 13:48:51 (12 years ago)
Author:
ltnguyen
Message:

Update images for gallery along with better implementation for the gallery description

Location:
issm/trunk-jpl/src/mobile/android/ISSM_APP
Files:
3 added
18 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/mobile/android/ISSM_APP/res/layout/backview.xml

    r14532 r14661  
    88                android:layout_width="wrap_content"
    99                android:id="@+id/back_view"
    10                 android:layout_height="wrap_content">
     10                android:layout_height="wrap_content"
     11                android:typeface="serif"
     12                android:textSize="20sp">
    1113        </TextView>
    1214</RelativeLayout>
  • issm/trunk-jpl/src/mobile/android/ISSM_APP/src/gov/nasa/jpl/issm/GalleryDescription.java

    r14641 r14661  
    44import java.io.IOException;
    55import java.io.InputStreamReader;
     6import java.util.ArrayList;
    67
    78import android.content.Context;
     
    1011//////////////////////////////////////////////////////////////////
    1112{
    12         private String[] description;
     13        private ArrayList<String> description;
    1314        private String[] rawtext;
    14        
    1515//----------------------------------------------------------------
    1616        public GalleryDescription(Context context)
    1717        {
    18                 description = new String[16];
     18                description = new ArrayList<String> ();
    1919                InputStreamReader isr = new InputStreamReader(context.getResources().openRawResource(R.raw.text));
    2020                BufferedReader br = new BufferedReader(isr);
     
    2525                        while ((line = br.readLine()) != null)
    2626                        {
     27                                //this if will continue adding if description is too long to the next line
    2728                                if(!line.contains(delimiter))
    28                                         description[index] += line;
     29                                        description.add(index, description.get(index)+" "+line);
    2930                                else
    3031                                {       
    3132                                        rawtext = line.split(delimiter);
     33                                        //slot 0 contains the image number, slot 1 contains the description.
    3234                                        index = Integer.parseInt(rawtext[0]);
    33                                         description[index] = rawtext[1];
     35                                        description.add(index, rawtext[1]);
    3436                                }
    3537                        }
     
    4143        public String getDescription(int index)
    4244        {
    43                 return description[index];
     45                if(index >= description.size())
     46                {
     47                        return "There is no detailed description for this image yet!";
     48                }
     49                return description.get(index);
    4450        }
    4551}
  • issm/trunk-jpl/src/mobile/android/ISSM_APP/src/gov/nasa/jpl/issm/GalleryImage.java

    r14641 r14661  
    173173                drawables = new ArrayList<Drawable>();
    174174               
    175                 for (int i = 0; i < 15; i++)
     175                for (int i = 0; i < 17; i++)
    176176                {
    177177                        drawables.add(getResources().getDrawable(getResources().getIdentifier("image"+i, "drawable", getPackageName())));
     
    186186                selectedImageView.setImageBitmap(b);
    187187                selectedImageView.setScaleType(ScaleType.FIT_XY);
    188                 selectedTextView.setText(description.getDescription(selectedImagePosition));
     188                selectedTextView.setText(description.getDescription(selectedImagePosition       ));
    189189        }
    190190       
Note: See TracChangeset for help on using the changeset viewer.