Skip to content

Commit

Permalink
Merge pull request #71 from ciopper90/master
Browse files Browse the repository at this point in the history
V1.0.3
  • Loading branch information
luca-dex committed Oct 15, 2014
2 parents 57afc74 + 00d8917 commit 69c2950
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 57 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/bin
/gen
Binary file modified apk/GaiaAndroidV1.0.3.apk
Binary file not shown.
2 changes: 1 addition & 1 deletion res/values/string.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<string name="app_version">1.0.3</string>
<string name="menu_settings">Settings</string>
<string name="caricamento">Caricamento in corso</string>
<string name="menu_comunicazioni">Ultime 20 Comunicazioni:</string>
<string name="menu_comunicazioni">Ultime Comunicazioni:</string>

<string name="posta_mittente_gaia">Notifica Gaia</string>
<string name="posta_destinatario_supporto">Supporto Gaia</string>
Expand Down
22 changes: 11 additions & 11 deletions src/it/gaiacri/mobile/ElencoAttivita.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
mViewPager.setAdapter(mSectionsPagerAdapter);
mViewPager.setCurrentItem(giorni/2);
return v;
}


}

/**
* A {@link FragmentPagerAdapter} that returns a fragment corresponding to one of the primary
Expand Down Expand Up @@ -119,11 +119,11 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
this.args=args;
lv=new ListView(getActivity());
//download turni e visualizzazione
ArrayAdapter<String> arrayAdapter =new ArrayAdapter<String>(context, R.layout.riga_attivita, R.id.textViewList,new String[]{"Caricamento.."});
lv.setAdapter(arrayAdapter);


richiestaAttivita();
if(context != null){
ArrayAdapter<String> arrayAdapter =new ArrayAdapter<String>(context, R.layout.riga_attivita, R.id.textViewList,new String[]{"Caricamento.."});
lv.setAdapter(arrayAdapter);
richiestaAttivita();
}
return lv;
}

Expand All @@ -150,7 +150,7 @@ public RichiestaAttivita(ListView lv,HashMap<String, String> data) {
@Override
protected void onPostExecute(String str) {
//Log.d("Log","Ciao");

if(ErrorJson.Controllo(str,getActivity(),risposta)==0){
try{
JSONObject js=null;
Expand Down Expand Up @@ -218,7 +218,7 @@ public View getView(int position, View convertView, ViewGroup parent) {
((TextView)row.findViewById(R.id.textViewList)).setTextColor(Color.parseColor(a.get(position).getColor()));
((TextView)row.findViewById(R.id.textViewListData)).setTextColor(Color.DKGRAY);
((TextView)row.findViewById(R.id.textViewListUrl)).setTextColor(Color.DKGRAY);

}
return row;
}
Expand Down Expand Up @@ -257,7 +257,7 @@ public void onClick(DialogInterface dialog, int id) {
alert.show();
}
}

public void richiestaAttivita(){
HashMap<String, String> data1 = new HashMap<String, String>();
c.add(Calendar.DAY_OF_MONTH, args.getInt(ARG_SECTION_NUMBER)-giorni/2-1);
Expand Down
92 changes: 47 additions & 45 deletions src/it/gaiacri/mobile/PostaIngresso.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public void onClick(DialogInterface dialog, int id) {
richiestaNotifiche();
return v;
}

class RichiestaNotifiche extends Richiesta {
public RichiestaNotifiche(HashMap<String, String> data) {
super(data,PostaIngresso.this.getActivity().getApplicationContext());
Expand All @@ -94,57 +94,59 @@ public RichiestaNotifiche(HashMap<String, String> data) {
public String metodo() { return "posta_cerca"; }

protected void onPostExecute(String ris) {
if(ErrorJson.Controllo(ris,PostaIngresso.this.getActivity(),risposta)==0){
Log.d("Json",risposta.toString());

if(posta==null)
posta= new ArrayList<Posta>();

try {
// prin
//String TAG="Risposta: ";
//att_title=risposta.getString("nome");
//att_luogo=risposta.getString("luogo");
//int info_totale=risposta.getInt("totale");
JSONArray res=risposta.getJSONArray("risultati");
mitt=new ArrayList<String>();

//recupera anche mittente da mostrare e salvare
for(int i=0;i<res.length();i++){
JSONObject obj=res.getJSONObject(i);
String posta_id=obj.getString("id");
String posta_corpo=obj.getString("corpo");
String posta_timestamp=obj.getString("timestamp");
JSONObject mittente=obj.optJSONObject("mittente");
String posta_mittente="";
if(!(mittente == null)){
posta_mittente=obj.getJSONObject("mittente").getString("id");
if(!mitt.contains(posta_mittente))
mitt.add(posta_mittente);
if(PostaIngresso.this != null && PostaIngresso.this.getActivity()!=null){
if(ErrorJson.Controllo(ris,PostaIngresso.this.getActivity(),risposta)==0){
Log.d("Json",risposta.toString());

if(posta==null)
posta= new ArrayList<Posta>();

try {
// prin
//String TAG="Risposta: ";
//att_title=risposta.getString("nome");
//att_luogo=risposta.getString("luogo");
//int info_totale=risposta.getInt("totale");
JSONArray res=risposta.getJSONArray("risultati");
mitt=new ArrayList<String>();

//recupera anche mittente da mostrare e salvare
for(int i=0;i<res.length();i++){
JSONObject obj=res.getJSONObject(i);
String posta_id=obj.getString("id");
String posta_corpo=obj.getString("corpo");
String posta_timestamp=obj.getString("timestamp");
JSONObject mittente=obj.optJSONObject("mittente");
String posta_mittente="";
if(!(mittente == null)){
posta_mittente=obj.getJSONObject("mittente").getString("id");
if(!mitt.contains(posta_mittente))
mitt.add(posta_mittente);
}
String posta_oggetto=obj.getString("oggetto");
posta.add(new Posta(posta_id,posta_oggetto,posta_corpo,posta_mittente,posta_timestamp));//Log.d("ciao", );
}
String posta_oggetto=obj.getString("oggetto");
posta.add(new Posta(posta_id,posta_oggetto,posta_corpo,posta_mittente,posta_timestamp));//Log.d("ciao", );
}


if(mitt.size()== 0){
fixMittente();
aggiornalist();
}else{
richiestaMittenti();
}
if(mitt.size()== 0){
fixMittente();
aggiornalist();
}else{
richiestaMittenti();
}


//String att_referente=risposta.getString("referente");
//String att_referentenum=risposta.getString("referentenum");
//String att_referenteemail=risposta.getString("referenteemail");
//String att_referente=risposta.getString("referente");
//String att_referentenum=risposta.getString("referentenum");
//String att_referenteemail=risposta.getString("referenteemail");

} catch (JSONException e) {
Log.e("ERROR" ,e.getMessage());
//e.printStackTrace();
} catch (JSONException e) {
Log.e("ERROR" ,e.getMessage());
//e.printStackTrace();
}
//da gestire la risposta
//in base a come viene ritornata
}
//da gestire la risposta
//in base a come viene ritornata
}

}
Expand Down

0 comments on commit 69c2950

Please sign in to comment.