project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/SettingsFragment.java
changeset 7586 33924ff4af50
parent 7584 7831c84cc644
child 10017 de822cd3df3a
equal deleted inserted replaced
7584:7831c84cc644 7586:33924ff4af50
   189 	private final OnItemSelectedListener themeSelectedListener = new OnItemSelectedListener() {
   189 	private final OnItemSelectedListener themeSelectedListener = new OnItemSelectedListener() {
   190 		public void onItemSelected(AdapterView<?> adapter, View v, int position, long arg3) {
   190 		public void onItemSelected(AdapterView<?> adapter, View v, int position, long arg3) {
   191 			stateManager.changeMapTheme(themes.get(position));
   191 			stateManager.changeMapTheme(themes.get(position));
   192 			String theme = themes.get(position);
   192 			String theme = themes.get(position);
   193 			try {
   193 			try {
   194 				File iconFile = new File(FileUtils.getDataPathFile(getActivity()), "Themes/" + theme + "/icon@2X.png");
   194 				File iconFile = FileUtils.getDataPathFile(getActivity(), "Themes", theme, "icon@2X.png");
   195 				Drawable themeIconDrawable = Drawable.createFromPath(iconFile.getAbsolutePath());
   195 				Drawable themeIconDrawable = Drawable.createFromPath(iconFile.getAbsolutePath());
   196 				themeIcon.setImageDrawable(themeIconDrawable);
   196 				themeIcon.setImageDrawable(themeIconDrawable);
   197 			} catch (FileNotFoundException e) {
   197 			} catch (FileNotFoundException e) {
   198 				Log.e("SettingsFragment", "Unable to find preview for theme "+theme, e);
   198 				Log.e("SettingsFragment", "Unable to find preview for theme "+theme, e);
   199 			}
   199 			}