Nextrek
Diff Revisions
629
vs
633
for /Android/SmartCharging/SmartCharging/app/src/main/java/it/fedeloper/smartcharging/Controller/FullInfoFragment.java
|
@@ -36,6 +36,7 @@ |
36 |
36 |
|
Bundle b; |
37 |
37 |
|
boolean haveScrolled = false; |
38 |
38 |
|
LayoutInflater li; |
|
39 |
+ |
private LinearLayout mainLayout; |
39 |
40 |
|
|
40 |
41 |
|
public FullInfoFragment(){} |
41 |
42 |
|
|
|
@@ -73,6 +74,7 @@ |
73 |
74 |
|
((RatingBar) v.findViewById(R.id.ratingBar2)).setRating(b.getFloat("stelle"));*/ |
74 |
75 |
|
idlocale = b.getInt("idlocale"); |
75 |
76 |
|
|
|
77 |
+ |
mainLayout = (LinearLayout) container.findViewById(R.id.main_layout); |
76 |
78 |
|
|
77 |
79 |
|
new Thread(new Runnable() { |
78 |
80 |
|
public void run() { |
|
@@ -155,10 +157,18 @@ |
155 |
157 |
|
obj.put("length", "10"); |
156 |
158 |
|
|
157 |
159 |
|
final JSONObject resp = HttpClient.SendHttpPostAsync(EndPoint.MAIN_END_POINT + "/get_commenti.php", obj); |
|
160 |
+ |
if(resp.getString("count").equals("0")){ |
|
161 |
+ |
getActivity().runOnUiThread(new Runnable() { |
|
162 |
+ |
@Override |
|
163 |
+ |
public void run() { |
|
164 |
+ |
TextView noCommentTextView = (TextView) v.findViewById(R.id.no_comment); |
|
165 |
+ |
noCommentTextView.setVisibility(View.VISIBLE); |
|
166 |
+ |
} |
|
167 |
+ |
}); |
|
168 |
+ |
} |
158 |
169 |
|
|
159 |
|
- |
Log.e("errore resp", resp.toString()); |
160 |
170 |
|
final JSONArray jArray = resp.getJSONArray("comments"); |
161 |
|
- |
Log.e("errore resp", jArray.toString()); |
|
171 |
+ |
|
162 |
172 |
|
for (int i = 0; i < jArray.length(); i++) { |
163 |
173 |
|
final JSONObject jdata = jArray.getJSONObject(i); |
164 |
174 |
|
Log.e("errore i", jdata.toString()); |