{"id":20292444,"url":"https://github.com/ladroid/mytaskmanager","last_synced_at":"2026-07-14T20:32:32.662Z","repository":{"id":131482290,"uuid":"141452882","full_name":"ladroid/MyTaskManager","owner":"ladroid","description":"This is a Task Manager","archived":false,"fork":false,"pushed_at":"2018-07-19T16:02:54.000Z","size":153,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-31T03:28:13.842Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ladroid.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2018-07-18T15:18:45.000Z","updated_at":"2018-07-19T16:02:55.000Z","dependencies_parsed_at":"2023-05-23T01:15:46.583Z","dependency_job_id":null,"html_url":"https://github.com/ladroid/MyTaskManager","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ladroid/MyTaskManager","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ladroid%2FMyTaskManager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ladroid%2FMyTaskManager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ladroid%2FMyTaskManager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ladroid%2FMyTaskManager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ladroid","download_url":"https://codeload.github.com/ladroid/MyTaskManager/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ladroid%2FMyTaskManager/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35478682,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-14T02:00:06.603Z","response_time":114,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T15:17:14.154Z","updated_at":"2026-07-14T20:32:32.657Z","avatar_url":"https://github.com/ladroid.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MyTaskManager\nThis is Task Manager\n\nHello everybody. Decided to make own **Task Manager**\n\nAnd what I did?\n\nAt first I chose in Android Studio Basic Activity.\nThe next step is make FloatingActionButton clickable.\n\nLike here \n```java\nfab.setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View view) {\n                ...\n            }\n}\n```\nAfter this I added **AlertDialog** for making todo task. And this is a code.\n```java\nfinal EditText input = new EditText(MainActivity.this);\n\n//Setting Dialog Message, and Dialog Title, also add edittext in alertDialog and show everything\nAlertDialog.Builder alertDialog = new AlertDialog.Builder(MainActivity.this);\nalertDialog.setTitle(\"Add new Task\").setMessage(\"What do you want to do?\").setView(input)\n        .setPositiveButton(\"Add\", new DialogInterface.OnClickListener() {\n    @Override\n    public void onClick(DialogInterface dialogInterface, int i) {\n        String task = String.valueOf(input.getText());\n        Log.d(\"Adding Task\", \"Task to add: \" + task);\n    }\n}).setNegativeButton(\"Cancel\", null).create().show();\n```\n\nAnd the full code\n```java\nFloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);\n        fab.setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View view) {\n                Snackbar.make(view, \"New Task\", Snackbar.LENGTH_LONG)\n                        .setAction(\"Action\", null).show();\n\n                final EditText input = new EditText(MainActivity.this);\n\n                //Setting Dialog Message, and Dialog Title, also add edittext in alertDialog and show everything\n                AlertDialog.Builder alertDialog = new AlertDialog.Builder(MainActivity.this);\n                alertDialog.setTitle(\"Add new Task\").setMessage(\"What do you want to do?\").setView(input)\n                        .setPositiveButton(\"Add\", new DialogInterface.OnClickListener() {\n                    @Override\n                    public void onClick(DialogInterface dialogInterface, int i) {\n                        String task = String.valueOf(input.getText());\n                        Log.d(\"Adding Task\", \"Task to add: \" + task);\n                    }\n                }).setNegativeButton(\"Cancel\", null).create().show();\n\n            }\n        });\n```\n\nI added DataBase for saving tasks. So how I did it? Let's see.\n\nAt first I made constants values for name my db, version and columns. Don't forget to extend **SQLiteOpenHelper** for your class.\n\n```java\npublic static final String DATABASE_NAME = \"Task.db\";\npublic static final int VERSION = 1;\npublic static final String CONTACTS_TABLE_NAME = \"tasks\";\npublic static final String CONTACTS_COLUMN_ID = \"id\";\npublic static final String CONTACTS_COLUMN_INFO = \"info\";\n```\n\nWhen you extended SQLiteOpenHelper you should **override onUpgrade(...), onCreate(...) and add constructor from a class**.\n\nThen in this will looks like this\n\n```java\npublic DBHelper(Context context) {\n            super(context, DATABASE_NAME, null, VERSION);\n}\n\n@Override\npublic void onCreate(SQLiteDatabase sqLiteDatabase) {\n            sqLiteDatabase.execSQL(\"CREATE TABLE \" + CONTACTS_TABLE_NAME + \" ( \" + CONTACTS_COLUMN_ID\n            + \" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, \"\n            + CONTACTS_COLUMN_INFO + \" TEXT NOT NULL);\");\n}\n\n@Override\npublic void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) {\n            sqLiteDatabase.execSQL(\"DROP TABLE IF EXISTS \" + CONTACTS_TABLE_NAME);\n            onCreate(sqLiteDatabase);\n}\n```\n\nAfter this add some methods like insert, update, delete and get everything.\n\nLet's see insert method. This method and all others besides get will be boolean.\n\n```java\nSQLiteDatabase sqLiteDatabase = this.getWritableDatabase();\nContentValues contentValues = new ContentValues();\n\ncontentValues.put(\"info\", info);\nsqLiteDatabase.insert(CONTACTS_TABLE_NAME, null, contentValues);\nreturn true;\n```\n\nWhat does it mean the first line? The first line make our db writable, it means that we can add datas in columns. **ContentValues** I used to put my data in column. And then I insert it(if you have more columns it doesn't matter).\n\nLet's see update\n\n```java\nSQLiteDatabase db = this.getWritableDatabase();\n\nContentValues values = new ContentValues();\nvalues.put(\"info\", CONTACTS_COLUMN_INFO);\n\n// updating row\ndb.update(CONTACTS_TABLE_NAME, values, CONTACTS_COLUMN_ID + \" = ?\",\n    new String[]{String.valueOf(CONTACTS_COLUMN_ID)});\nreturn true;\n```\n\nBy this method I update my db. I did the same things below except update, where I'm looking if I add new task by id.\n\nNow delete\n\n```java\nSQLiteDatabase db = getWritableDatabase();\ndb.execSQL(\"DELETE FROM \" + CONTACTS_TABLE_NAME + \" WHERE \" + CONTACTS_COLUMN_ID + \"=\\\"\" + id + \"\\\";\");\n```\n\nI delete data by id.\n\nAnd the last is getting all\n\n```java\nArrayList\u003cString\u003e array_list = new ArrayList\u003cString\u003e();\n\nSQLiteDatabase db = this.getReadableDatabase();\nCursor res =  db.rawQuery( \"SELECT * FROM \" + CONTACTS_TABLE_NAME, null );\nres.moveToFirst();\n\nwhile(res.isAfterLast() == false){\n            array_list.add(res.getString(res.getColumnIndex(CONTACTS_COLUMN_INFO)));\n            res.moveToNext();\n}\nreturn array_list;\n```\n\nLet's see it in detail. The first part of line I added arraylist value for output all datas from column. The next part of line I did my db readable. Why? Just because I read my db and don't add anything. \n\nThe next is this *Cursor res =  db.rawQuery( \"SELECT * FROM \" + CONTACTS_TABLE_NAME, null );*  make a request for all data from the table. \n\nNext line means that we position the cursor on the first row of the sample. \n\n*while(res.isAfterLast() == false)* - means that if we don't have the last data the we should to add it. And I did this by this line of code *array_list.add(res.getString(res.getColumnIndex(CONTACTS_COLUMN_INFO)));* and then go to the next line by this part of code *res.moveToNext();*.\n\nAnd after I return my arraylist.\n\nI did delete method by swiping. How I did it?\n\n1) Add this in **gradle** \n\n```\nimplementation 'com.baoyz.swipemenulistview:library:1.3.0'\n```\n\n2) Change in xml file from **ListView** to this\n\n```xml\n\u003ccom.baoyz.swipemenulistview.SwipeMenuListView\n        android:id=\"@+id/TODO\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        app:layout_constraintBottom_toBottomOf=\"parent\"\n        app:layout_constraintLeft_toLeftOf=\"parent\"\n        app:layout_constraintRight_toRightOf=\"parent\"\n        app:layout_constraintTop_toTopOf=\"parent\"\n        android:lines=\"10\"\n        android:textSize=\"24dp\"\n        android:maxLines = \"10\"\n        android:scrollbars = \"vertical\"\n        android:scrollbarStyle=\"insideOverlay\"\n        android:fadeScrollbars=\"true\"\n        android:fadingEdge=\"vertical\"/\u003e\n```\n\n3) Add this code\n\n```java\n//swipe menu\nSwipeMenuCreator creator = new SwipeMenuCreator() {\n\n            @Override\n            public void create(SwipeMenu menu) {\n                // create \"open\" item\n                SwipeMenuItem openItem = new SwipeMenuItem(\n                        getApplicationContext());\n                // set item background\n                openItem.setBackground(new ColorDrawable(Color.rgb(0xC9, 0xC9,\n                        0xCE)));\n                // set item width\n                openItem.setWidth(500);\n                // set item title\n                openItem.setTitle(\"Open\");\n                // set item title fontsize\n                openItem.setTitleSize(18);\n                // set item title font color\n                openItem.setTitleColor(Color.WHITE);\n                // add to menu\n                menu.addMenuItem(openItem);\n\n                // create \"delete\" item\n                SwipeMenuItem deleteItem = new SwipeMenuItem(\n                        getApplicationContext());\n                // set item background\n                deleteItem.setBackground(new ColorDrawable(Color.rgb(0xF9,\n                        0x3F, 0x25)));\n                // set item width\n                deleteItem.setWidth(500);\n                // set item title\n                deleteItem.setTitle(\"Delete\");\n                // set item title fontsize\n                deleteItem.setTitleSize(18);\n                // set item title font color\n                deleteItem.setTitleColor(Color.WHITE);\n                // add to menu\n                menu.addMenuItem(deleteItem);\n            }\n};\n```\n\n4) Set menu\n\n```java\n//set menu\ntextView.setMenuCreator(creator);\n```\n\n5) Make a menu for our swipe\n\n```java\n//make swipe menu clickable\ntextView.setOnMenuItemClickListener(new SwipeMenuListView.OnMenuItemClickListener() {\n            @Override\n            public boolean onMenuItemClick(int position, SwipeMenu menu, int index) {\n                switch (index) {\n                    case 0:\n                        ...\n                        break;\n                    case 1:\n                        ...\n                        break;\n                }\n            }\n}\n```\n\n6) The last I add my delete method in **case1:**.\n\n```java\ndbHelper.deleteContact(String.valueOf(position+1));\nstartActivity(new Intent(MainActivity.this, MainActivity.class));\n```\n\nAnd that's it. Soon I will add new features in this project. Thanks.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fladroid%2Fmytaskmanager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fladroid%2Fmytaskmanager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fladroid%2Fmytaskmanager/lists"}