]> iEval git - unical.git/commitdiff
Clean up
authorMarius Gavrilescu <marius@ieval.ro>
Sat, 15 Jun 2013 15:08:54 +0000 (18:08 +0300)
committerMarius Gavrilescu <marius@ieval.ro>
Sat, 15 Jun 2013 15:08:54 +0000 (18:08 +0300)
src/ro/ieval/unical/DeleteEventDialog.java
src/ro/ieval/unical/DisplayEventActivity.java
src/ro/ieval/unical/TrivialFragment.java

index ba2f9c4600f07948c5ba6885b6ead96a6adbb5d5..56e71cbdd97bf77cf820ff1a9c95058a8b1d83af 100644 (file)
@@ -10,8 +10,15 @@ import android.os.Bundle;
 
 @SuppressLint("ValidFragment")
 public final class DeleteEventDialog extends DialogFragment {
-       Event e; Activity a;
-       
+       private final Event event;
+       private final Activity activity;
+
+       public DeleteEventDialog(final Event event, final Activity activity) {
+               super();
+               this.event=event;
+               this.activity=activity;
+       }
+
        @Override
        public Dialog onCreateDialog(final Bundle savedInstanceState) {
                final AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
@@ -19,9 +26,8 @@ public final class DeleteEventDialog extends DialogFragment {
                           .setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
                                   @Override
                                   public void onClick(final DialogInterface dialog, final int id) {
-                                          // Nothing happens here yet
-                                          e.delete(getActivity());
-                                          a.finish();
+                                          event.delete(getActivity());
+                                          activity.finish();
                                   }
                           })
                           .setNegativeButton(R.string.no, new DialogInterface.OnClickListener() {
@@ -32,8 +38,4 @@ public final class DeleteEventDialog extends DialogFragment {
                           });
                return builder.create();
        }
-       public DeleteEventDialog(Event e,Activity a) {
-               this.e=e;
-               this.a=a;
-       }
 }
index f5bb14653686068d3f47ec33b3c7439c2ed60a79..bb819b9eb51558facca7f6844b3da8c5fd48b4fe 100644 (file)
@@ -15,7 +15,7 @@ import android.widget.TextView;
 
 public class DisplayEventActivity extends Activity {
        public static final String EXTRA_EVENT = "event";
-       Event e;
+       private Event event;
 
        public static void displayEvent(final Context context, final Event event){
                final Intent i=new Intent(context,DisplayEventActivity.class);
@@ -26,9 +26,9 @@ public class DisplayEventActivity extends Activity {
        @Override
        protected void onCreate(final Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
-               e=getIntent().getParcelableExtra(EXTRA_EVENT);
+               event=getIntent().getParcelableExtra(EXTRA_EVENT);
                setContentView(R.layout.event_view);
-               setTitle(e.title);
+               setTitle(event.title);
 
                final TextView startDay= (TextView) findViewById(R.id.startday);
                final TextView endDay= (TextView) findViewById(R.id.endday);
@@ -38,8 +38,8 @@ public class DisplayEventActivity extends Activity {
                final TextView endTime= (TextView) findViewById(R.id.endtime);
                final TextView description= (TextView) findViewById(R.id.event_view_description);
 
-               final Date start=new Date(e.dtstart);
-               final Date end=new Date(e.dtend);
+               final Date start=new Date(event.dtstart);
+               final Date end=new Date(event.dtend);
                final SimpleDateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy", Locale.UK);
                final SimpleDateFormat timeFormat = new SimpleDateFormat("HH:mm:ss", Locale.UK);
                final SimpleDateFormat dayOfWeekFormat = new SimpleDateFormat("EEEEEEE", Locale.UK);
@@ -52,7 +52,7 @@ public class DisplayEventActivity extends Activity {
                startDate.setText(dateFormat.format(start));
                startTime.setText(timeFormat.format(start));
                endTime.setText(timeFormat.format(end));
-               description.setText(e.description);
+               description.setText(event.description);
        }
 
        @Override
@@ -71,7 +71,7 @@ public class DisplayEventActivity extends Activity {
                                startActivity(i);
                                return true;
                        case R.id.deleteevent:
-                               final DeleteEventDialog d=new DeleteEventDialog(e,this);
+                               final DeleteEventDialog d=new DeleteEventDialog(event,this);
                                d.show(getFragmentManager(), "Delete");
                                return true;
                        case R.id.eventlist:
index 23086ab0a43d3e45680f072dd885c8115c0d282e..4a1c0b2b38a17f39b160c424e011eb9a50d2374f 100644 (file)
@@ -13,7 +13,7 @@ import android.widget.Switch;
 
 public final class TrivialFragment extends Fragment {
        private static class OnItemSelectedListener implements android.widget.AdapterView.OnItemSelectedListener{
-               final View repeatCount;
+               private final View repeatCount;
                public OnItemSelectedListener(final View repeatCount) {
                        this.repeatCount=repeatCount;
                }
This page took 0.029496 seconds and 4 git commands to generate.