Added comments
This commit is contained in:
		
						commit
						617b75b997
					
				
					 3 changed files with 37 additions and 14 deletions
				
			
		| 
						 | 
				
			
			@ -11,9 +11,25 @@ import android.widget.Toast;
 | 
			
		|||
 | 
			
		||||
import java.util.Calendar;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 *
 | 
			
		||||
 * This class is the java class for the Service Provider's Availabilities menu. This class generates the menu from
 | 
			
		||||
 * the saved Availabilities that the user has set previously or on default set no Availabilities.
 | 
			
		||||
 * The menu gives the option to change availabilities for each day of the week or remove his availability on that
 | 
			
		||||
 * day. User will receive a toast if they set impossible availabilities or they will receive a toast saying
 | 
			
		||||
 * that their availabilities have been saved.
 | 
			
		||||
 *
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
public class ServiceProviderAvailabilities extends AppCompatActivity {
 | 
			
		||||
    private String username;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * This class generates the availabilities from the serviceProvider class fields
 | 
			
		||||
     * on creation of this menu so the user can edit and change it on the menu.
 | 
			
		||||
     *
 | 
			
		||||
     * @param savedInstanceState
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    protected void onCreate(Bundle savedInstanceState) {
 | 
			
		||||
        super.onCreate(savedInstanceState);
 | 
			
		||||
| 
						 | 
				
			
			@ -22,8 +38,6 @@ public class ServiceProviderAvailabilities extends AppCompatActivity {
 | 
			
		|||
        username = bundle.getString("username");
 | 
			
		||||
        DBHelper dbHelper = new DBHelper(this);
 | 
			
		||||
        ServiceProvider user = (ServiceProvider) dbHelper.findUserByUsername(username);
 | 
			
		||||
        //int[][] test = {{12,9,17,50},{0,0,0,0},{7,31,17,9},{12,9,17,50},{0,0,0,0},{7,31,17,9},{4,0,19,30}};
 | 
			
		||||
        //user.setAvailabilities(test);
 | 
			
		||||
        int[][] days  = user.getAvailabilities();
 | 
			
		||||
        String startTime;
 | 
			
		||||
        String endTime;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -7,26 +7,25 @@
 | 
			
		|||
    android:gravity="center_horizontal"
 | 
			
		||||
    android:orientation="vertical"
 | 
			
		||||
    android:paddingBottom="@dimen/activity_vertical_margin"
 | 
			
		||||
    android:paddingLeft="@dimen/activity_horizontal_margin"
 | 
			
		||||
    android:paddingRight="@dimen/activity_horizontal_margin"
 | 
			
		||||
    android:paddingTop="@dimen/activity_vertical_margin"
 | 
			
		||||
    android:paddingLeft="10dp"
 | 
			
		||||
    android:paddingRight="10dp"
 | 
			
		||||
    android:paddingTop="8dp"
 | 
			
		||||
    android:background="@drawable/background"
 | 
			
		||||
    tools:context=".ServiceProviderAvailabilities">
 | 
			
		||||
 | 
			
		||||
    <Button
 | 
			
		||||
        android:id="@+id/button"
 | 
			
		||||
    <ScrollView
 | 
			
		||||
        android:layout_width="match_parent"
 | 
			
		||||
        android:layout_height="wrap_content"
 | 
			
		||||
        android:onClick="onSetTimes"
 | 
			
		||||
        android:text="Button" />
 | 
			
		||||
 | 
			
		||||
        android:layout_height="435dp">
 | 
			
		||||
    <LinearLayout
 | 
			
		||||
        android:layout_width="match_parent"
 | 
			
		||||
        android:layout_height="match_parent"
 | 
			
		||||
        android:orientation="vertical">
 | 
			
		||||
    <TableLayout
 | 
			
		||||
        android:layout_width="match_parent"
 | 
			
		||||
        android:layout_height="match_parent">
 | 
			
		||||
        <TableRow
 | 
			
		||||
            android:layout_width="match_parent"
 | 
			
		||||
            android:layout_height="45dp"
 | 
			
		||||
            android:layout_marginTop="10dp">
 | 
			
		||||
            android:layout_height="45dp">
 | 
			
		||||
 | 
			
		||||
            <TextView
 | 
			
		||||
                android:id="@+id/Day"
 | 
			
		||||
| 
						 | 
				
			
			@ -355,5 +354,16 @@
 | 
			
		|||
        </TableRow>
 | 
			
		||||
 | 
			
		||||
    </TableLayout>
 | 
			
		||||
    </LinearLayout>
 | 
			
		||||
    </ScrollView>
 | 
			
		||||
    <Button
 | 
			
		||||
        android:id="@+id/button"
 | 
			
		||||
        android:layout_width="match_parent"
 | 
			
		||||
        android:layout_height="wrap_content"
 | 
			
		||||
        android:onClick="onSetTimes"
 | 
			
		||||
        android:text="Save"
 | 
			
		||||
        android:theme="@style/AppTheme.Button"
 | 
			
		||||
        android:layout_marginTop="5dp"/>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
</LinearLayout>
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue