|
@@ -94,7 +94,6 @@ |
94 |
94 |
|
|
95 |
95 |
|
new Thread(new Runnable() { |
96 |
96 |
|
public void run() { |
97 |
|
- |
|
98 |
97 |
|
final ImageButton image = new ImageButton(c); |
99 |
98 |
|
getActivity().runOnUiThread(new Runnable() { |
100 |
99 |
|
@Override |
|
@@ -173,7 +172,7 @@ |
173 |
172 |
|
final JSONObject jdata = jArray.getJSONObject(i); |
174 |
173 |
|
Log.e("errore i", jdata.toString()); |
175 |
174 |
|
|
176 |
|
- |
final Bitmap bitm = Utils.getBitmapFromURL(jdata.getString("user_avatar")); |
|
175 |
+ |
// final Bitmap bitm = Utils.getBitmapFromURL(jdata.getString("user_avatar")); |
177 |
176 |
|
|
178 |
177 |
|
if(getActivity()!=null) |
179 |
178 |
|
getActivity().runOnUiThread(new Runnable() { |
|
@@ -184,7 +183,7 @@ |
184 |
183 |
|
Log.e("errore", "1111"); |
185 |
184 |
|
final View child = li.inflate(R.layout.commento_layout, null); |
186 |
185 |
|
|
187 |
|
- |
((ImageView) child.findViewById(R.id.user_image)).setImageBitmap(bitm); |
|
186 |
+ |
// ((ImageView) child.findViewById(R.id.user_image)).setImageBitmap(bitm); |
188 |
187 |
|
|
189 |
188 |
|
((TextView) child.findViewById(R.id.nameText)).setText(jdata.getString("username")); |
190 |
189 |
|
((TextView) child.findViewById(R.id.DescText)).setText(jdata.getString("descrizione")); |
|
@@ -194,67 +193,67 @@ |
194 |
193 |
|
|
195 |
194 |
|
final JSONArray jArray1 = jdata.getJSONArray("imgs"); |
196 |
195 |
|
Log.e("errore", "1111imggggg"); |
197 |
|
- |
for (int i = 0; i < jArray1.length(); i++) { |
198 |
|
- |
|
199 |
|
- |
final String filename = (String) jArray1.get(i); |
200 |
|
- |
|
201 |
|
- |
new Thread(new Runnable() { |
202 |
|
- |
public void run() { |
203 |
|
- |
|
204 |
|
- |
final ImageButton image = new ImageButton(c); |
205 |
|
- |
if (getActivity() != null) { |
206 |
|
- |
getActivity().runOnUiThread(new Runnable() { |
207 |
|
- |
@Override |
208 |
|
- |
public void run() { |
209 |
|
- |
|
210 |
|
- |
image.setScaleType(ImageView.ScaleType.FIT_CENTER); |
211 |
|
- |
image.setLayoutParams(new LinearLayout.LayoutParams((int) convertDpToPixel(80), (int) convertDpToPixel(80))); |
212 |
|
- |
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams((int) convertDpToPixel(80), (int) convertDpToPixel(80)); |
213 |
|
- |
|
214 |
|
- |
|
215 |
|
- |
image.setBackgroundColor(getResources().getColor(R.color.btn_background)); |
216 |
|
- |
((LinearLayout) child.findViewById(R.id.image)).addView(image); |
217 |
|
- |
Animation aAnimation = (Animation) AnimationUtils.loadAnimation(c, R.anim.zoom); |
218 |
|
- |
|
219 |
|
- |
image.startAnimation(aAnimation); |
220 |
|
- |
if (haveScrolled == false) { |
221 |
|
- |
ObjectAnimator objectAnimator = ObjectAnimator.ofInt(((ScrollView) getActivity().findViewById(R.id.scrollView)), "scrollY", 0, ((ScrollView) getActivity().findViewById(R.id.scrollView)).getBottom()).setDuration(500); |
222 |
|
- |
objectAnimator.start(); |
223 |
|
- |
// ((ScrollView)getActivity().findViewById(R.id.scrollView)).fullScroll(ScrollView.FOCUS_DOWN); |
224 |
|
- |
haveScrolled = true; |
225 |
|
- |
} |
226 |
|
- |
} |
227 |
|
- |
}); |
228 |
|
- |
} |
229 |
|
- |
|
230 |
|
- |
Log.e("ciaooooo", "http://svm19842.vps.tagadab.it:8084" + filename); |
231 |
|
- |
final Bitmap imgweb = Utils.getBitmapFromURL("http://svm19842.vps.tagadab.it:8084" + filename); |
232 |
|
- |
if (imgweb != null) { |
233 |
|
- |
if (getActivity() != null) { |
234 |
|
- |
getActivity().runOnUiThread(new Runnable() { |
235 |
|
- |
@Override |
236 |
|
- |
public void run() { |
237 |
|
- |
image.clearAnimation(); |
238 |
|
- |
|
239 |
|
- |
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams((int) (convertDpToPixel(80) * imgweb.getWidth() / imgweb.getHeight()), (int) convertDpToPixel(80)); |
240 |
|
- |
params.setMargins(6, 3, 0, 3); |
241 |
|
- |
image.setLayoutParams(params); |
242 |
|
- |
image.setImageBitmap(imgweb); |
243 |
|
- |
|
244 |
|
- |
image.setOnClickListener(new View.OnClickListener() { |
245 |
|
- |
@Override |
246 |
|
- |
public void onClick(View view) { |
247 |
|
- |
|
248 |
|
- |
startActivity(new Intent(Intent.ACTION_VIEW, getImageUri(c, imgweb))); |
249 |
|
- |
} |
250 |
|
- |
}); |
251 |
|
- |
} |
252 |
|
- |
}); |
253 |
|
- |
} |
254 |
|
- |
} |
255 |
|
- |
} |
256 |
|
- |
}).start(); |
257 |
|
- |
} |
|
196 |
+ |
// for (int i = 0; i < jArray1.length(); i++) { |
|
197 |
+ |
// |
|
198 |
+ |
// final String filename = (String) jArray1.get(i); |
|
199 |
+ |
// |
|
200 |
+ |
// new Thread(new Runnable() { |
|
201 |
+ |
// public void run() { |
|
202 |
+ |
// |
|
203 |
+ |
// final ImageButton image = new ImageButton(c); |
|
204 |
+ |
// if (getActivity() != null) { |
|
205 |
+ |
// getActivity().runOnUiThread(new Runnable() { |
|
206 |
+ |
// @Override |
|
207 |
+ |
// public void run() { |
|
208 |
+ |
// |
|
209 |
+ |
// image.setScaleType(ImageView.ScaleType.FIT_CENTER); |
|
210 |
+ |
// image.setLayoutParams(new LinearLayout.LayoutParams((int) convertDpToPixel(80), (int) convertDpToPixel(80))); |
|
211 |
+ |
// LinearLayout.LayoutParams params = new LinearLayout.LayoutParams((int) convertDpToPixel(80), (int) convertDpToPixel(80)); |
|
212 |
+ |
// |
|
213 |
+ |
// |
|
214 |
+ |
// image.setBackgroundColor(getResources().getColor(R.color.btn_background)); |
|
215 |
+ |
// ((LinearLayout) child.findViewById(R.id.image)).addView(image); |
|
216 |
+ |
// Animation aAnimation = (Animation) AnimationUtils.loadAnimation(c, R.anim.zoom); |
|
217 |
+ |
// |
|
218 |
+ |
// image.startAnimation(aAnimation); |
|
219 |
+ |
// if (haveScrolled == false) { |
|
220 |
+ |
// ObjectAnimator objectAnimator = ObjectAnimator.ofInt(((ScrollView) getActivity().findViewById(R.id.scrollView)), "scrollY", 0, ((ScrollView) getActivity().findViewById(R.id.scrollView)).getBottom()).setDuration(500); |
|
221 |
+ |
// objectAnimator.start(); |
|
222 |
+ |
// // ((ScrollView)getActivity().findViewById(R.id.scrollView)).fullScroll(ScrollView.FOCUS_DOWN); |
|
223 |
+ |
// haveScrolled = true; |
|
224 |
+ |
// } |
|
225 |
+ |
// } |
|
226 |
+ |
// }); |
|
227 |
+ |
// } |
|
228 |
+ |
// |
|
229 |
+ |
// Log.e("ciaooooo", "http://svm19842.vps.tagadab.it:8084" + filename); |
|
230 |
+ |
// final Bitmap imgweb = Utils.getBitmapFromURL("http://svm19842.vps.tagadab.it:8084" + filename); |
|
231 |
+ |
// if (imgweb != null) { |
|
232 |
+ |
// if (getActivity() != null) { |
|
233 |
+ |
// getActivity().runOnUiThread(new Runnable() { |
|
234 |
+ |
// @Override |
|
235 |
+ |
// public void run() { |
|
236 |
+ |
// image.clearAnimation(); |
|
237 |
+ |
// |
|
238 |
+ |
// LinearLayout.LayoutParams params = new LinearLayout.LayoutParams((int) (convertDpToPixel(80) * imgweb.getWidth() / imgweb.getHeight()), (int) convertDpToPixel(80)); |
|
239 |
+ |
// params.setMargins(6, 3, 0, 3); |
|
240 |
+ |
// image.setLayoutParams(params); |
|
241 |
+ |
// image.setImageBitmap(imgweb); |
|
242 |
+ |
// |
|
243 |
+ |
// image.setOnClickListener(new View.OnClickListener() { |
|
244 |
+ |
// @Override |
|
245 |
+ |
// public void onClick(View view) { |
|
246 |
+ |
// |
|
247 |
+ |
// startActivity(new Intent(Intent.ACTION_VIEW, getImageUri(c, imgweb))); |
|
248 |
+ |
// } |
|
249 |
+ |
// }); |
|
250 |
+ |
// } |
|
251 |
+ |
// }); |
|
252 |
+ |
// } |
|
253 |
+ |
// } |
|
254 |
+ |
// } |
|
255 |
+ |
// }).start(); |
|
256 |
+ |
// } |
258 |
257 |
|
} catch (JSONException e) { |
259 |
258 |
|
Log.e("errore", "1111" + e.getMessage()); |
260 |
259 |
|
} |