Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ----------------------------------------------------------XML FILES--------------------------------------------------------------------
- ----------------------------------------------------------activity_man-----------------------------------------------------------------
- <!-- Login screen-->
- <LinearLayout
- android:orientation="vertical"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="@drawable/screen_background"
- xmlns:android="http://schemas.android.com/apk/res/android">
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_weight="5.8">
- <TextView
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="Welcome to MyChores"
- android:textSize="25sp"
- android:textColor="#c0c0c0"
- android:gravity="center"
- android:layout_marginTop="10sp"
- />
- </LinearLayout>
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_weight="4.3"
- android:orientation="vertical">
- <EditText
- android:id="@+id/logUserId"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:textSize="35sp"
- android:textColor="#878787"
- android:padding="5sp"
- android:gravity="center"
- android:hint="Username"
- android:layout_marginTop="20sp"
- android:background="@drawable/input_text_shape"/>
- <EditText
- android:id="@+id/logPassId"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:textSize="35sp"
- android:textColor="#878787"
- android:padding="5sp"
- android:gravity="center"
- android:inputType="textPassword"
- android:hint="Password"
- android:layout_marginTop="30sp"
- android:background="@drawable/input_text_shape"/>
- </LinearLayout>
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical"
- android:layout_weight="4">
- <Button
- android:id="@+id/loginBtnId"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:text="Log-In"
- android:textSize="20sp"
- android:textColor="#878787"
- android:background="@drawable/btn_shape_round"/>
- <Button
- android:id="@+id/logRegBtnId"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:layout_marginTop="25sp"
- android:padding="10sp"
- android:text="Register"
- android:textSize="20sp"
- android:textColor="#878787"
- android:background="@drawable/btn_smpl_shape"/>
- </LinearLayout>
- </LinearLayout>
- ---------------------------------------------------------------------------------------------------------------------------------------
- ----------------------------------------------------------activity_registration--------------------------------------------------------
- <!-- registration -->
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical"
- android:background="@drawable/screen_background"
- xmlns:android="http://schemas.android.com/apk/res/android">
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical"
- android:layout_weight="7.5">
- <TextView
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="Registration"
- android:textSize="28sp"
- android:textColor="#c0c0c0"
- android:gravity="center"
- android:layout_marginTop="20sp" />
- </LinearLayout>
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical"
- android:layout_weight="5.1">
- <EditText
- android:id="@+id/regUserId"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:textSize="35sp"
- android:textColor="#878787"
- android:padding="5sp"
- android:hint="Username"
- android:gravity="center"
- android:layout_marginTop="15sp"
- android:background="@drawable/input_text_shape"/>
- <EditText
- android:id="@+id/regPassId"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:textSize="35sp"
- android:textColor="#878787"
- android:padding="5sp"
- android:hint="Password"
- android:inputType="textPassword"
- android:gravity="center"
- android:layout_marginTop="20sp"
- android:background="@drawable/input_text_shape"/>
- <EditText
- android:id="@+id/regRePasId"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:textSize="35sp"
- android:textColor="#878787"
- android:padding="5sp"
- android:hint="Re-password"
- android:inputType="textPassword"
- android:gravity="center"
- android:layout_marginTop="20sp"
- android:background="@drawable/input_text_shape"/>
- </LinearLayout>
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical"
- android:layout_weight="6">
- <Button
- android:id="@+id/regBtnId"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:layout_marginTop="10sp"
- android:text="Register"
- android:textSize="26sp"
- android:textColor="#404040"
- android:background="@drawable/btn_shape_round"/>
- </LinearLayout>
- </LinearLayout>
- ---------------------------------------------------------------------------------------------------------------------------------------
- -------------------------------------------------------------activity_usertask---------------------------------------------------------
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical"
- android:background="@drawable/screen_background"
- xmlns:android="http://schemas.android.com/apk/res/android">
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical"
- android:layout_weight="8">
- <TextView
- android:id="@+id/sayHelloId"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:textSize="35sp"
- android:textColor="#c0c0c0"
- android:layout_marginTop="10sp"/>
- </LinearLayout>
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical"
- android:layout_weight="2">
- <ListView
- android:id="@+id/ChoreListId"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
- </ListView>
- </LinearLayout>
- </LinearLayout>
- ---------------------------------------------------------------------------------------------------------------------------------------
- -------------------------------------------------------------END XML-------------------------------------------------------------------
- ==========================================================JAVA CODE====================================================================
- ============================================================MainActivity===============================================================
- package com.example.igor.mychores20;
- import android.app.Activity;
- import android.content.Intent;
- import android.content.SharedPreferences;
- import android.os.Bundle;
- import android.view.View;
- import android.widget.Button;
- import android.widget.CheckBox;
- import android.widget.EditText;
- import android.widget.Toast;
- public class MainActivity extends Activity
- {
- //strign variable that will contain the name of the user that recently logged in
- private String isOnline;//<--contains the value of the logged user
- // username password
- EditText usrNamLog, passWoLog; //<-- will contain users input data
- // LogIn button Register Button
- Button btnLogIn, BtnRegUsr; //<-- will be used to connect variables with btn ids
- //set instance of SharedPrefrence
- SharedPreferences myPref;//<--will use the xml file that contains all the accounts
- SharedPreferences.Editor editor;//<--will be used to edit our SharedPrefrences XML file
- @Override
- protected void onCreate(Bundle savedInstanceState)
- {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
- setPoints();//<-- connect all variables and SP
- LogIn();//<--LogIn Button
- regBtn();//<--Registration Button
- //will move the user into logged in page if logged in the past
- if(chkOnline())
- {
- Intent logIn = new Intent(MainActivity.this, UserTasks.class);
- // logIn.putExtra("isOnline",isOnline);//<--put extra value on this intent
- this.startActivity(logIn);//<--go to the UserTasks page
- }
- }
- //connects local variables with xml id's and sets up the sharedprefrences
- private void setPoints()
- {
- //connect local variables with with XML id's
- //EditTexts
- usrNamLog = (EditText)findViewById(R.id.logUserId);//<--username
- passWoLog = (EditText)findViewById(R.id.logPassId);//<--password
- //Buttons
- btnLogIn = (Button)findViewById(R.id.loginBtnId);//<--LogIn Button
- BtnRegUsr = (Button)findViewById(R.id.logRegBtnId);//<--Register Button
- //SharedPrefrences sets up XML file that contains Users Data
- myPref = getApplicationContext().getSharedPreferences(Utility.MY_ACC,MODE_PRIVATE);
- //set editor up
- editor = myPref.edit();
- }
- //checks if user logged in the past or not
- private boolean chkOnline()
- {
- //insert into variable the the Strign value of isOnline key
- isOnline = myPref.getString(Utility.isUserON,"offline");//<--defualt value of offline to be inserted if key is empty
- return !isOnline.equals("offline");//<--return true if isOnline variable doesnt equal "offline"
- }
- //checks if users input of username & password are valid
- private boolean usrLog()
- {
- String userName = usrNamLog.getText().toString();//<-- contains input of username field
- String passWord = passWoLog.getText().toString();//<-- contains input of password field
- //check if fields are not empty and pop toast of error msg
- if(userName.trim().isEmpty() || passWord.trim().isEmpty())
- {
- Toast.makeText(this,"Error, please make sure all fields are full",Toast.LENGTH_SHORT).show();
- return false;//<-- return false and exit the method
- }
- //check if input data is invalid
- if(!myPref.contains(userName) || !passWord.equals(myPref.getString(userName,passWord)))
- {
- Toast.makeText(this,"Error, wrong username or password",Toast.LENGTH_SHORT).show();
- return false;//<-- return false and exit the method
- }
- //if everything is correct insert key of username into isOnline keys value
- editor.putString(Utility.isUserON,userName).commit();//<--insert usernames key as value into isOnline
- return true;//<-- return true and exit the method
- }
- //LogIn button method checks if usrLog is true or false
- public void LogIn()
- {
- btnLogIn.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- if (usrLog())//<-- if method returns true move to login page
- {
- Intent logIn = new Intent(MainActivity.this, UserTasks.class);
- Toast.makeText(MainActivity.this, "Loggin in", Toast.LENGTH_SHORT).show();
- MainActivity.this.startActivity(logIn);
- }
- }
- });
- }
- //Registration btn that takes the user to Registration page
- public void regBtn()
- {
- BtnRegUsr.setOnClickListener(new View.OnClickListener()
- {
- @Override
- public void onClick(View v)
- {
- Intent register = new Intent(MainActivity.this,Registration.class);
- MainActivity.this.startActivity(register);//<--activate intent and move to registration page
- }
- });
- }
- }
- =======================================================================================================================================
- ============================================================Registration===============================================================
- package com.example.igor.mychores20;
- import android.app.Activity;
- import android.content.SharedPreferences;
- import android.os.Bundle;
- import android.view.View;
- import android.widget.Button;
- import android.widget.EditText;
- import android.widget.Toast;
- /**
- * Created by Igor on 06-Apr-16.
- */
- public class Registration extends Activity
- {
- // username password confirmation
- private EditText userRegIn, passRegIn,passConfIn;
- private Button btnReg;//button instance
- private SharedPreferences myPrefs;//<-- sharedprefrences instance
- private SharedPreferences.Editor editor; //<-- set up sharedprefrences editor instance
- @Override
- protected void onCreate(Bundle savedInstanceState)
- {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_registration);
- setPoints();//<--set valiable points on in the oncreate method
- regMe();//<--btn register method
- }
- //method that sets all casting points and sharedprefrences here and being called by onCreate
- private void setPoints()
- {
- //EditText casting local variables with xml id's
- userRegIn = (EditText)findViewById(R.id.regUserId); //<-- username
- passRegIn = (EditText)findViewById(R.id.regPassId); //<-- paassword
- passConfIn = (EditText)findViewById(R.id.regRePasId); //<-- password confirmation
- //Button
- btnReg = (Button)findViewById(R.id.regBtnId);//<-- button registration
- //SharedPrefrences and its editors setup
- //set the xml file of sharedprefrences to the final static String MY_ACC with mode_private on
- myPrefs = getApplicationContext().getSharedPreferences(Utility.MY_ACC,MODE_PRIVATE);
- //set the editor for myPrefs allowing to edit from the sharedPref xml files
- editor = myPrefs.edit();
- }
- //boolean method that handels user input and checks if all data inputed is valid and returns true or false
- private boolean signMeUp()
- {
- String userName = userRegIn.getText().toString();//<-- put all user input of userRegId into this var
- String passWord = passRegIn.getText().toString();//<--put all pass input of passRegIn into this var
- String confPass = passConfIn.getText().toString();//<--put all passConf input of passConfIn into this var
- //if data is missing in one of the inputs throw toast message and return false
- if(userName.trim().isEmpty() || passWord.trim().isEmpty() || confPass.trim().isEmpty())
- {
- Toast.makeText(this,"Please make sure you filled all the data",Toast.LENGTH_SHORT).show();
- return false;
- }
- //if password and confirm password do not match throw toast and return false
- if(!confPass.equals(passWord))
- {
- Toast.makeText(this,"Error, please make sure passwords match",Toast.LENGTH_SHORT).show();
- return false;
- }
- //if username allready exists as a myPrefs key throw toast msg and return false
- if(myPrefs.contains(userName))
- {
- Toast.makeText(this,"Error, this username allready exists",Toast.LENGTH_SHORT).show();
- return false;
- }
- //if none of the above happened
- editor.putString(userName,passWord).commit(); //<--put data in the xml file of myPref to be used as username and password
- return true;//<-- return true
- }
- //set up button method that will activate registration algorithem method
- public void regMe()
- {
- btnReg.setOnClickListener(new View.OnClickListener()
- {
- @Override
- public void onClick(View v)
- {
- if(signMeUp())//<-- if method returns true pop toast and exit this page
- {
- Toast.makeText(Registration.this,"Registered succesfully",Toast.LENGTH_SHORT).show();
- finish();//<-- finish this activity and return to mainpage
- }
- }
- });
- }
- }
- =======================================================================================================================================
- ============================================================UserTasks==================================================================
- package com.example.igor.mychores20;
- import android.content.SharedPreferences;
- import android.os.Bundle;
- import android.support.v7.app.AppCompatActivity;
- import android.view.Menu;
- import android.view.MenuInflater;
- import android.view.MenuItem;
- import android.widget.ListView;
- import android.widget.TextView;
- import android.widget.Toast;
- /**
- * Created by Igor on 06-Apr-16.
- */
- //TODO Create a chores app that will consist of 3 screens
- //TODO (1 Login Screen, (2 Registration Screen, (3 Online Screen containing the listView of chores
- public class UserTasks extends AppCompatActivity
- {
- //TODO --CREATE page with TextView 'that says hi' to the user and ListView containing users chores
- private TextView sayHiTxt;//<--say hi variable
- protected static ListView choreList;//<--users chores listView
- //SharedPrefrences
- private SharedPreferences myPref;
- private SharedPreferences.Editor editor;
- private Utility myUtility;
- private MyDbManager db;
- @Override
- protected void onCreate(Bundle savedInstanceState)
- {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_usertasks);
- setPoints();//<--set valuable points
- sayHiTxt.setText("Hello " + getUserName());//<--says hello to the user
- db = new MyDbManager(this,getUserName());//<--set db with username table
- if(choreList != null)//<--if chore list is not empty update ListView
- {
- MyAdapter adp = new MyAdapter(this,getUserName());
- choreList.setAdapter(adp);
- }
- }
- //get menut oncreate options
- @Override
- public boolean onCreateOptionsMenu(Menu menu)
- {
- MenuInflater ifnlater = getMenuInflater();//<-- call menu inflater class and equal it to getMenuInflater method
- ifnlater.inflate(R.menu.my_menu, menu);//<-- inflate the wished menu (my_menu)
- return super.onCreateOptionsMenu(menu);
- }
- @Override
- public boolean onOptionsItemSelected(MenuItem item)
- {
- switch (item.getItemId())
- {
- case R.id.addTaskId:
- myUtility.alrtDialog("add new task", "add task", new Utility.AdapterCallback()
- {
- @Override
- public void onCallback(String result)
- {
- if(db.newChore(result))
- {
- Toast.makeText(UserTasks.this, "Chore added", Toast.LENGTH_SHORT).show();
- myUtility.setAdapter();
- }
- else
- Toast.makeText(UserTasks.this,"Error, couldnt add chore",Toast.LENGTH_SHORT).show();
- }
- });
- break;
- case R.id.rmvDoneId:
- db.removDone();
- myUtility.setAdapter();
- break;
- case R.id.logOutId:
- logOut();
- break;
- }
- return super.onOptionsItemSelected(item);
- }
- //set points of local variables and sharedprefrences
- private void setPoints()
- {
- //connect local variables with XML id's
- sayHiTxt = (TextView)findViewById(R.id.sayHelloId);//<--textview
- choreList = (ListView)findViewById(R.id.ChoreListId);//<--listview
- //set sharePrefrences
- myPref = getApplicationContext().getSharedPreferences(Utility.MY_ACC, MODE_PRIVATE);
- editor = myPref.edit();
- myUtility = new Utility(this,getUserName());//<--utility constractor initiation
- }
- private String getUserName()
- {
- String username = myPref.getString("isOnline","offline");
- return username;//<-- return usernames string value
- }
- //logout method used in the menu select button
- private void logOut()
- {
- editor.remove(Utility.isUserON).commit();
- finish();
- }
- }
- =======================================================================================================================================
- =============================================================MyDbManager===============================================================
- package com.example.igor.mychores20;
- import android.content.ContentValues;
- import android.content.Context;
- import android.database.Cursor;
- import android.database.sqlite.SQLiteDatabase;
- import android.database.sqlite.SQLiteOpenHelper;
- import android.database.sqlite.SQLiteStatement;
- import java.util.ArrayList;
- import java.util.List;
- /**
- * Created by Igor on 07-Apr-16.
- */
- //TODO CREATE database recieving data from user input with a table for each user
- //TODO (1 DataBase file. (2 Agile table. (3 allow user write, read and delete from his private table in DB
- public class MyDbManager extends SQLiteOpenHelper
- {
- private static final String DB_NAME = "chores.db";//<--DataBase file name in a final static variable
- private static String table_name;//<-- table name is agile for each user to have its own table
- private SQLiteDatabase db; //<-- create instance of SQLiteDataBase to set Clearance of usage of the db and its editing
- private List<Task> list;
- private Context context;
- public MyDbManager(Context context,String table_name)
- {
- super(context, DB_NAME, null, 1);//<-- recieve context from called class, db file name factory of null and verion 1
- this.context = context;//<--context
- this.table_name = table_name;//<--set the table_name as usernames name
- db = this.getWritableDatabase();//<-- set clearance that allows to write and read from database
- db.execSQL("CREATE TABLE IF NOT EXISTS " + table_name +" (id INTEGER PRIMARY KEY AUTOINCREMENT,task TEXT,status INTEGER)");
- list = new ArrayList<Task>();//<--intiate the array each time this constractor is called
- }
- @Override
- public void onCreate(SQLiteDatabase db)
- {
- //create table with users name and insert in it 3 rows
- //(1 id automaticly inserted by the system (2 task users chore (3 status integer of 0 undone 1 done
- String query = "CREATE TABLE IF NOT EXISTS " + table_name +" (id INTEGER PRIMARY KEY AUTOINCREMENT,task TEXT,status INTEGER)";
- db.execSQL(query);
- }
- //insert chore method
- public boolean newChore(String choreName)
- {
- //insert db insert data command into 'inserChore' String variable
- //insert users chore with defualt status of 0 (undone)
- String insertChore = "INSERT INTO "+table_name+" (task,status) VALUES('"+choreName+"',0)";
- //create SQLite statemnt and compile it with insertChore variable
- SQLiteStatement statement = db.compileStatement(insertChore);
- long res = statement.executeInsert();//<--insert statement execcute in a long variable
- //to check if data got inserted into DB
- return (res!=-1);//<--if res doesnt equal to -1 return true (data was inserted succesfully
- }
- //display in a list of a custom class Task which holds 3 variables for each column
- public List<Task> getChoreList()//<--full display method
- {
- //create Cursor class and intitate it to hold all the data from table name
- Cursor res = db.rawQuery("SELECT * FROM " + table_name, null);
- while(res.moveToNext())//<--as long there is a next row continue runing
- {
- //insert all data from the Database (id, task, status)
- list.add(new Task(res.getInt(0),res.getString(1),res.getInt(2)));//<--add it into list
- }
- return list;//<-- return all the values from the list
- }
- //method that allows to share task with a friend
- //table gets Sring from userInput of the AlertDialog
- //the id, chore and status get their inout from adapter
- public void shareFriend(String table_name,String choreName,int status)
- {
- //set username to recieve choesen taskname and its status
- String shareChore = "INSERT INTO "+table_name+" (task,status) VALUES('"+choreName+"',"+status+")";
- SQLiteStatement statement = db.compileStatement(shareChore);//<--insert taskname into statement and compile
- statement.executeInsert();//<--execute statement and insert it into long variable
- }
- //change chores name using the input variables in the method
- public void choreUpdate(int id, String taskName, int taskStatus)
- {
- ContentValues myContent = new ContentValues();
- myContent.put("id",id);
- myContent.put("task",taskName);
- myContent.put("status",taskStatus);
- db.update(table_name, myContent, "id = ?", new String[]{id + ""});
- }
- //remove chore method
- public void delChore(int id)//recieve position
- {
- //remove the whole row using the id number of the row
- db.execSQL("DELETE FROM " + table_name + " WHERE id ='"+id+"'");//delete task with chosen id
- }
- //remove all done methods
- public void removDone()
- {
- db.execSQL("DELETE FROM " + table_name + " WHERE status = 1");//delete all finished tasks
- }
- //DO NOT TOUCH BEN IEM TIPAGACH!!
- @Override
- public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion)
- {
- }
- }
- =======================================================================================================================================
- ==============================================================Utility==================================================================
- package com.example.igor.mychores20;
- import android.app.AlertDialog;
- import android.content.Context;
- import android.content.DialogInterface;
- import android.text.InputType;
- import android.widget.EditText;
- /**
- * Created by Igor on 07-Apr-16.
- */
- public class Utility
- {
- //setting up sharedprefrences xml file name that will store all usernames and passwords
- public static final String MY_ACC = "accounts";
- public static final String isUserON = "isOnline";
- private Context context;
- private String userName;
- public Utility(Context context,String userName)
- {
- this.context = context;
- this.userName = userName;
- }
- //set adapter method refreshes the adapter
- protected void setAdapter()
- {
- MyAdapter adp = new MyAdapter(context,userName);
- UserTasks.choreList.setAdapter(adp);
- }
- //create interface with void method that requires String
- public interface AdapterCallback //<--set interface to be abel to call method to implant
- {
- void onCallback(String usrInput);//<--returns what user has typed
- //this abstract method will allow us to recieve alrtDialog() String input
- //if the place we wish to implant alrtDialog() method!
- }
- //requires name of the title, name of the positive btn and implantation of the interface class /*AdapterCallback*/
- public void alrtDialog(String setTitle, String setPositiveBtn, final AdapterCallback callback)
- {
- AlertDialog.Builder myDialog = new AlertDialog.Builder(context);//<--create alert dialog builder
- myDialog.setTitle(setTitle);//<--inserts the string for the title
- //create edittext for the user to imput its method
- final EditText myText = new EditText(context);//<--intiate EditText
- myText.setInputType(InputType.TYPE_CLASS_TEXT);//<--declare imput type
- //posetive button
- myDialog.setPositiveButton(setPositiveBtn, new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- ;
- callback.onCallback(myText.getText().toString());
- }
- });
- //negetive button
- myDialog.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- dialog.cancel();
- }
- });
- myDialog.setView(myText);//<-set the view of the alrt dialog
- myDialog.show();
- }
- //TODO Delete method that deltes tasks by their id numbers
- //TODO create graphics and desgin the app
- //TODO profit
- }
- =======================================================================================================================================
- ===============================================================Tasks===================================================================
- package com.example.igor.mychores20;
- /**
- * Created by Igor on 08-Apr-16.
- */
- public class Task
- {
- //create class to store all the data from database in this class
- private int id;
- private String taskName;
- private int status;
- //constractor that recieves input of taskName and status
- public Task(int id,String taskName, int status)
- {
- this.id = id;
- this.taskName = taskName;
- this.status = status;
- }
- //name getter and setter
- public String getTaskName()//<--getter
- {
- return taskName;
- }
- //name getter and setter
- public void setTaskName(String taskName)//<--setter
- {
- this.taskName = taskName;
- }
- public int getStatus()//<--getter
- {
- return status;
- }
- public void setStatus(int status)//<--setter
- {
- this.status = status;
- }
- public int getId() //<--getter
- {
- return id;
- }
- public void setId(int id) //<--setter
- {
- this.id = id;
- }
- }
- =======================================================================================================================================
- ============================================================END========================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement