Changeset 14661
- Timestamp:
- 04/19/13 13:48:51 (12 years ago)
- 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 8 8 android:layout_width="wrap_content" 9 9 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"> 11 13 </TextView> 12 14 </RelativeLayout> -
issm/trunk-jpl/src/mobile/android/ISSM_APP/src/gov/nasa/jpl/issm/GalleryDescription.java
r14641 r14661 4 4 import java.io.IOException; 5 5 import java.io.InputStreamReader; 6 import java.util.ArrayList; 6 7 7 8 import android.content.Context; … … 10 11 ////////////////////////////////////////////////////////////////// 11 12 { 12 private String[]description;13 private ArrayList<String> description; 13 14 private String[] rawtext; 14 15 15 //---------------------------------------------------------------- 16 16 public GalleryDescription(Context context) 17 17 { 18 description = new String[16];18 description = new ArrayList<String> (); 19 19 InputStreamReader isr = new InputStreamReader(context.getResources().openRawResource(R.raw.text)); 20 20 BufferedReader br = new BufferedReader(isr); … … 25 25 while ((line = br.readLine()) != null) 26 26 { 27 //this if will continue adding if description is too long to the next line 27 28 if(!line.contains(delimiter)) 28 description [index] += line;29 description.add(index, description.get(index)+" "+line); 29 30 else 30 31 { 31 32 rawtext = line.split(delimiter); 33 //slot 0 contains the image number, slot 1 contains the description. 32 34 index = Integer.parseInt(rawtext[0]); 33 description [index] = rawtext[1];35 description.add(index, rawtext[1]); 34 36 } 35 37 } … … 41 43 public String getDescription(int index) 42 44 { 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); 44 50 } 45 51 } -
issm/trunk-jpl/src/mobile/android/ISSM_APP/src/gov/nasa/jpl/issm/GalleryImage.java
r14641 r14661 173 173 drawables = new ArrayList<Drawable>(); 174 174 175 for (int i = 0; i < 1 5; i++)175 for (int i = 0; i < 17; i++) 176 176 { 177 177 drawables.add(getResources().getDrawable(getResources().getIdentifier("image"+i, "drawable", getPackageName()))); … … 186 186 selectedImageView.setImageBitmap(b); 187 187 selectedImageView.setScaleType(ScaleType.FIT_XY); 188 selectedTextView.setText(description.getDescription(selectedImagePosition ));188 selectedTextView.setText(description.getDescription(selectedImagePosition )); 189 189 } 190 190
Note:
See TracChangeset
for help on using the changeset viewer.