// Path: app/src/main/java/net/sourceforge/servestream/activity/SetAlarmActivity.java
// public class SetAlarmActivity extends ActionBarActivity {
// 	
// 	@Override
// 	public void onCreate(Bundle savedInstanceState) {
//         setTheme(UserPreferences.getTheme());
// 		super.onCreate(savedInstanceState);
// 		
// 		ActionBar actionBar = getSupportActionBar();
// 		actionBar.setDisplayHomeAsUpEnabled(true);
// 		
// 		if (savedInstanceState == null) {
// 			FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
// 			transaction.add(android.R.id.content, new SetAlarmFragment());
// 			transaction.commit();
// 		}
// 	}
// 
//     @Override
//     public boolean onOptionsItemSelected(MenuItem item) {
//         switch (item.getItemId()) {
//     		case android.R.id.home:
//     			finish();
//     			return true;
//             default:
//                 break;
//         }
//         return super.onOptionsItemSelected(item);
//     }
//     
//     @Override
//     public void onBackPressed() {
//     	SetAlarmFragment fragment = (SetAlarmFragment) getSupportFragmentManager().findFragmentById(android.R.id.content);
//     	fragment.onBackPressed();
//     }
// }


import android.app.AlertDialog;
import android.support.design.widget.FloatingActionButton;
import android.support.v4.content.CursorLoader;
import android.support.v4.content.Loader;
import android.support.v4.app.LoaderManager;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.database.Cursor;
import android.graphics.Typeface;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.AdapterView.AdapterContextMenuInfo;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.CheckBox;
import android.widget.CursorAdapter;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import java.util.Calendar;
import net.sourceforge.servestream.R;
import net.sourceforge.servestream.activity.SetAlarmActivity;
import net.sourceforge.servestream.alarm.Alarm;
import net.sourceforge.servestream.alarm.Alarms;
import net.sourceforge.servestream.alarm.DigitalClock;
import net.sourceforge.servestream.alarm.ToastMaster;
        }
        switch (item.getItemId()) {
            case R.id.delete_alarm:
                // Confirm that the alarm will be deleted.
                new AlertDialog.Builder(getActivity())
                        .setTitle(getString(R.string.delete_alarm))
                        .setMessage(getString(R.string.alarm_delete_confirmation_msg))
                        .setPositiveButton(android.R.string.ok,
                                new DialogInterface.OnClickListener() {
                                    public void onClick(DialogInterface d,
                                            int w) {
                                        Alarms.deleteAlarm(getActivity(), id);
                                    }
                                })
                        .setNegativeButton(android.R.string.cancel, null)
                        .show();
                return true;

            case R.id.enable_alarm:
                final Cursor c = (Cursor) mAlarmsList.getAdapter()
                        .getItem(info.position);
                final Alarm alarm = new Alarm(c);
                Alarms.enableAlarm(getActivity(), alarm.id, !alarm.enabled);
                if (!alarm.enabled) {
                	popAlarmSetToast(getActivity(), alarm.hour, alarm.minutes,
                            alarm.daysOfWeek);
                }
                return true;

            case R.id.edit_alarm:
// Path: app/src/main/java/net/sourceforge/servestream/activity/SetAlarmActivity.java
// public class SetAlarmActivity extends ActionBarActivity {
// 	
// 	@Override
// 	public void onCreate(Bundle savedInstanceState) {
//         setTheme(UserPreferences.getTheme());
// 		super.onCreate(savedInstanceState);
// 		
// 		ActionBar actionBar = getSupportActionBar();
// 		actionBar.setDisplayHomeAsUpEnabled(true);
// 		
// 		if (savedInstanceState == null) {
// 			FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
// 			transaction.add(android.R.id.content, new SetAlarmFragment());
// 			transaction.commit();
// 		}
// 	}
// 
//     @Override
//     public boolean onOptionsItemSelected(MenuItem item) {
//         switch (item.getItemId()) {
//     		case android.R.id.home:
//     			finish();
//     			return true;
//             default:
//                 break;
//         }
//         return super.onOptionsItemSelected(item);
//     }
//     
//     @Override
//     public void onBackPressed() {
//     	SetAlarmFragment fragment = (SetAlarmFragment) getSupportFragmentManager().findFragmentById(android.R.id.content);
//     	fragment.onBackPressed();
//     }
// }


// Path: app/src/main/java/net/sourceforge/servestream/fragment/AlarmClockFragment.java
import android.app.AlertDialog;
import android.support.design.widget.FloatingActionButton;
import android.support.v4.content.CursorLoader;
import android.support.v4.content.Loader;
import android.support.v4.app.LoaderManager;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.database.Cursor;
import android.graphics.Typeface;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.AdapterView.AdapterContextMenuInfo;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.CheckBox;
import android.widget.CursorAdapter;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import java.util.Calendar;
import net.sourceforge.servestream.R;
import net.sourceforge.servestream.activity.SetAlarmActivity;
import net.sourceforge.servestream.alarm.Alarm;
import net.sourceforge.servestream.alarm.Alarms;
import net.sourceforge.servestream.alarm.DigitalClock;
import net.sourceforge.servestream.alarm.ToastMaster;

        }
        switch (item.getItemId()) {
            case R.id.delete_alarm:
                // Confirm that the alarm will be deleted.
                new AlertDialog.Builder(getActivity())
                        .setTitle(getString(R.string.delete_alarm))
                        .setMessage(getString(R.string.alarm_delete_confirmation_msg))
                        .setPositiveButton(android.R.string.ok,
                                new DialogInterface.OnClickListener() {
                                    public void onClick(DialogInterface d,
                                            int w) {
                                        Alarms.deleteAlarm(getActivity(), id);
                                    }
                                })
                        .setNegativeButton(android.R.string.cancel, null)
                        .show();
                return true;

            case R.id.enable_alarm:
                final Cursor c = (Cursor) mAlarmsList.getAdapter()
                        .getItem(info.position);
                final Alarm alarm = new Alarm(c);
                Alarms.enableAlarm(getActivity(), alarm.id, !alarm.enabled);
                if (!alarm.enabled) {
                	popAlarmSetToast(getActivity(), alarm.hour, alarm.minutes,
                            alarm.daysOfWeek);
                }
                return true;

            case R.id.edit_alarm:
                Intent intent = new Intent(getActivity(), SetAlarmActivity.class);