├── .gitignore ├── .idea ├── .gitignore ├── .name ├── compiler.xml ├── deploymentTargetDropDown.xml ├── gradle.xml ├── jarRepositories.xml ├── markdown-navigator-enh.xml ├── markdown-navigator.xml ├── misc.xml └── vcs.xml ├── Assets └── preview.gif ├── LICENSE ├── README.md ├── app ├── .gitignore ├── .idea │ ├── .gitignore │ ├── gradle.xml │ ├── misc.xml │ ├── modules.xml │ └── vcs.xml ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── sem6_project │ │ └── mylib │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── ic_launcher-playstore.png │ ├── java │ │ └── com │ │ │ └── sem6_project │ │ │ └── mylib │ │ │ ├── Activity │ │ │ ├── AboutLibraryActivity.java │ │ │ ├── CategoriesActivity.java │ │ │ ├── CategoryBookActivity.java │ │ │ ├── CategoryBookDetailActivity.java │ │ │ ├── DashboardActivity.java │ │ │ ├── MainActivity.java │ │ │ ├── MyAccountActivity.java │ │ │ ├── SearchActivity.java │ │ │ └── SplashScreenActivity.java │ │ │ ├── Adapter │ │ │ ├── CategoryAdapter.java │ │ │ ├── CategoryBookDetailAdapter.java │ │ │ ├── IssueBookAdapter.java │ │ │ └── SearchBookAdapter.java │ │ │ ├── DeveloperActivity.java │ │ │ ├── appcontroller │ │ │ └── AppController.java │ │ │ └── bean │ │ │ ├── Book.java │ │ │ ├── Category.java │ │ │ └── IssueBook.java │ └── res │ │ ├── drawable-v24 │ │ ├── ic_launcher_foreground.xml │ │ ├── pic1.jpg │ │ ├── pic2.jpg │ │ └── pic3.jpg │ │ ├── drawable │ │ ├── background_gradient.xml │ │ ├── book_bg.xml │ │ ├── dashboard_bg.xml │ │ ├── ic_aboutlibrary.xml │ │ ├── ic_account.xml │ │ ├── ic_baseline_arrow_back_24.xml │ │ ├── ic_baseline_call_24.xml │ │ ├── ic_baseline_email_24.xml │ │ ├── ic_book.xml │ │ ├── ic_books_stack_of_three.xml │ │ ├── ic_calendar.xml │ │ ├── ic_category.xml │ │ ├── ic_developer.xml │ │ ├── ic_due_date.xml │ │ ├── ic_issue_date.xml │ │ ├── ic_launcher_background.xml │ │ ├── ic_launcher_foreground.xml │ │ ├── ic_left_arrow.xml │ │ ├── ic_lock.xml │ │ ├── ic_login.xml │ │ ├── ic_logout.xml │ │ ├── ic_open_book.xml │ │ ├── ic_pen_tool.xml │ │ ├── ic_person.xml │ │ ├── ic_search.xml │ │ ├── ic_search_24.xml │ │ ├── ic_timetable.xml │ │ └── login_background_text.xml │ │ ├── font │ │ └── sf_pro.ttf │ │ ├── layout │ │ ├── abs_dashboard.xml │ │ ├── abs_layout.xml │ │ ├── activity_about_library.xml │ │ ├── activity_categories.xml │ │ ├── activity_category_book.xml │ │ ├── activity_category_book_detail.xml │ │ ├── activity_dashboard.xml │ │ ├── activity_developer.xml │ │ ├── activity_main.xml │ │ ├── activity_my_account.xml │ │ ├── activity_search.xml │ │ ├── activity_splash_screen.xml │ │ ├── view_issued_book.xml │ │ ├── view_row_category.xml │ │ └── view_row_search_book.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_foreground.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_foreground.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_foreground.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_foreground.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_foreground.png │ │ └── ic_launcher_round.png │ │ ├── values-night-v23 │ │ └── themes.xml │ │ ├── values-night │ │ └── themes.xml │ │ ├── values-v23 │ │ └── themes.xml │ │ ├── values │ │ ├── colors.xml │ │ ├── ic_launcher_background.xml │ │ ├── strings.xml │ │ ├── styles.xml │ │ └── themes.xml │ │ └── xml │ │ └── network_security_config.xml │ └── test │ └── java │ └── com │ └── sem6_project │ └── mylib │ └── ExampleUnitTest.java ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | .DS_Store 11 | /build 12 | /captures 13 | .externalNativeBuild 14 | .cxx 15 | local.properties 16 | -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | -------------------------------------------------------------------------------- /.idea/.name: -------------------------------------------------------------------------------- 1 | MyLib -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/deploymentTargetDropDown.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 19 | 20 | -------------------------------------------------------------------------------- /.idea/jarRepositories.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 14 | 15 | 19 | 20 | 24 | 25 | -------------------------------------------------------------------------------- /.idea/markdown-navigator-enh.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/markdown-navigator.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 19 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Assets/preview.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devarshukani/MyLib-Android/150a385f58adca2e29ca5caf7261ac36813538a5/Assets/preview.gif -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Devarsh Ukani 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MyLib - Library Management System 2 | 3 | This repository is Android Application of MyLib Project.
4 | You can Find Back-end [Admin Panel Website](https://github.com/devarshukani/MyLib-AdminPanel) Code here 5 | 6 | MyLib is Library Management System with Android Application to User side and Admin Panel Website for Library Management team. 7 | 8 | ## Features 9 | - Login 10 | - User Account 11 | - Show Issued Book 12 | - Search Books 13 | - Category List 14 | - Book Details & Availability 15 | 16 | ## Tools and Language Used 17 | - Android Studio 18 | - Java, XML & JSON 19 | 20 | ## Application Preview 21 | ![app preview](Assets/preview.gif) 22 | 23 | ## Contributing 24 | Pull requests are welcome.
25 | For major changes, please open an issue first to discuss what you would like to change. 26 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /app/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | -------------------------------------------------------------------------------- /app/.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 12 | 13 | -------------------------------------------------------------------------------- /app/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | -------------------------------------------------------------------------------- /app/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'com.android.application' 3 | 4 | } 5 | 6 | android { 7 | compileSdkVersion 30 8 | buildToolsVersion "30.0.3" 9 | 10 | defaultConfig { 11 | applicationId "com.sem6_project.mylib" 12 | minSdkVersion 22 13 | targetSdkVersion 30 14 | versionCode 1 15 | versionName "1.0" 16 | 17 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 18 | } 19 | 20 | buildTypes { 21 | release { 22 | minifyEnabled false 23 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 24 | } 25 | } 26 | compileOptions { 27 | sourceCompatibility JavaVersion.VERSION_1_8 28 | targetCompatibility JavaVersion.VERSION_1_8 29 | } 30 | } 31 | 32 | dependencies { 33 | 34 | implementation 'androidx.appcompat:appcompat:1.2.0' 35 | implementation 'com.google.android.material:material:1.2.1' 36 | implementation 'androidx.constraintlayout:constraintlayout:2.0.4' 37 | testImplementation 'junit:junit:4.+' 38 | androidTestImplementation 'androidx.test.ext:junit:1.1.2' 39 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' 40 | 41 | implementation 'com.google.android.material:material:1.0.0' 42 | 43 | implementation 'com.android.volley:volley:1.1.1' 44 | } -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /app/src/androidTest/java/com/sem6_project/mylib/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.sem6_project.mylib; 2 | 3 | import android.content.Context; 4 | 5 | import androidx.test.platform.app.InstrumentationRegistry; 6 | import androidx.test.ext.junit.runners.AndroidJUnit4; 7 | 8 | import org.junit.Test; 9 | import org.junit.runner.RunWith; 10 | 11 | import static org.junit.Assert.*; 12 | 13 | /** 14 | * Instrumented test, which will execute on an Android device. 15 | * 16 | * @see Testing documentation 17 | */ 18 | @RunWith(AndroidJUnit4.class) 19 | public class ExampleInstrumentedTest { 20 | @Test 21 | public void useAppContext() { 22 | // Context of the app under test. 23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); 24 | assertEquals("com.sem6_project.mylib", appContext.getPackageName()); 25 | } 26 | } -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/ic_launcher-playstore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devarshukani/MyLib-Android/150a385f58adca2e29ca5caf7261ac36813538a5/app/src/main/ic_launcher-playstore.png -------------------------------------------------------------------------------- /app/src/main/java/com/sem6_project/mylib/Activity/AboutLibraryActivity.java: -------------------------------------------------------------------------------- 1 | package com.sem6_project.mylib.Activity; 2 | 3 | import androidx.appcompat.app.ActionBar; 4 | import androidx.appcompat.app.AppCompatActivity; 5 | 6 | import android.os.Build; 7 | import android.os.Bundle; 8 | import android.text.Html; 9 | import android.view.View; 10 | import android.widget.ImageView; 11 | import android.widget.TextView; 12 | import android.widget.ViewFlipper; 13 | 14 | import com.sem6_project.mylib.R; 15 | 16 | import org.w3c.dom.Text; 17 | 18 | import static android.text.Layout.JUSTIFICATION_MODE_INTER_WORD; 19 | 20 | public class AboutLibraryActivity extends AppCompatActivity { 21 | 22 | ViewFlipper v_flipper; 23 | 24 | @Override 25 | protected void onCreate(Bundle savedInstanceState) { 26 | super.onCreate(savedInstanceState); 27 | setContentView(R.layout.activity_about_library); 28 | getSupportActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM); 29 | getSupportActionBar().setCustomView(R.layout.abs_layout); 30 | TextView tvTitle = findViewById(R.id.tvTitle); 31 | tvTitle.setText("About Library"); 32 | 33 | ImageView iv_backarrow = findViewById(R.id.iv_backarrow); 34 | iv_backarrow.setOnClickListener(new View.OnClickListener() { 35 | @Override 36 | public void onClick(View v) { 37 | finish(); 38 | } 39 | }); 40 | TextView tv_about = findViewById(R.id.tv_about); 41 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { 42 | tv_about.setJustificationMode(JUSTIFICATION_MODE_INTER_WORD); 43 | } 44 | 45 | v_flipper =findViewById(R.id.v_flipper); 46 | 47 | int images[] = {R.drawable.pic1,R.drawable.pic2,R.drawable.pic3}; 48 | 49 | for(int i:images) 50 | { 51 | flipperImage(i); 52 | } 53 | } 54 | 55 | public void flipperImage(int image ) 56 | { 57 | ImageView imageView = new ImageView(this); 58 | 59 | imageView.setBackgroundResource(image); 60 | 61 | v_flipper.addView(imageView); 62 | v_flipper.setFlipInterval(3000); 63 | v_flipper.setAutoStart(true); 64 | 65 | 66 | v_flipper.setInAnimation(this,android.R.anim.slide_in_left); 67 | 68 | } 69 | 70 | } -------------------------------------------------------------------------------- /app/src/main/java/com/sem6_project/mylib/Activity/CategoriesActivity.java: -------------------------------------------------------------------------------- 1 | package com.sem6_project.mylib.Activity; 2 | 3 | import androidx.appcompat.app.AppCompatActivity; 4 | import androidx.recyclerview.widget.DefaultItemAnimator; 5 | import androidx.recyclerview.widget.GridLayoutManager; 6 | import androidx.recyclerview.widget.LinearLayoutManager; 7 | import androidx.recyclerview.widget.RecyclerView; 8 | 9 | import android.annotation.SuppressLint; 10 | import android.app.ActionBar; 11 | import android.os.Bundle; 12 | import android.text.Html; 13 | import android.util.Log; 14 | import android.view.View; 15 | import android.widget.Adapter; 16 | import android.widget.ImageView; 17 | import android.widget.ProgressBar; 18 | import android.widget.TextView; 19 | import android.widget.Toast; 20 | 21 | import com.android.volley.Request; 22 | import com.android.volley.RequestQueue; 23 | import com.android.volley.Response; 24 | import com.android.volley.VolleyError; 25 | import com.android.volley.VolleyLog; 26 | import com.android.volley.toolbox.JsonArrayRequest; 27 | import com.android.volley.toolbox.Volley; 28 | import com.sem6_project.mylib.Adapter.CategoryAdapter; 29 | import com.sem6_project.mylib.R; 30 | import com.sem6_project.mylib.appcontroller.AppController; 31 | import com.sem6_project.mylib.bean.Category; 32 | 33 | import org.json.JSONArray; 34 | import org.json.JSONException; 35 | import org.json.JSONObject; 36 | 37 | import java.util.ArrayList; 38 | import java.util.List; 39 | 40 | import static com.sem6_project.mylib.Activity.MainActivity.ip; 41 | 42 | public class CategoriesActivity extends AppCompatActivity { 43 | 44 | RecyclerView rv_CategoryList; 45 | ArrayList cat; 46 | 47 | static String JSON_URL = ip + "mylib/json/category.php"; 48 | 49 | @SuppressLint("WrongConstant") 50 | @Override 51 | protected void onCreate(Bundle savedInstanceState) { 52 | super.onCreate(savedInstanceState); 53 | setContentView(R.layout.activity_categories); 54 | getSupportActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM); 55 | getSupportActionBar().setCustomView(R.layout.abs_layout); 56 | TextView tvTitle = findViewById(R.id.tvTitle); 57 | tvTitle.setText("Categories"); 58 | 59 | ImageView iv_backarrow = findViewById(R.id.iv_backarrow); 60 | iv_backarrow.setOnClickListener(new View.OnClickListener() { 61 | @Override 62 | public void onClick(View v) { 63 | finish(); 64 | } 65 | }); 66 | 67 | 68 | rv_CategoryList = (RecyclerView) findViewById(R.id.rv_CategoryList); 69 | cat = new ArrayList<>(); 70 | 71 | //rv_CategoryList.setLayoutManager(new GridLayoutManager(this,2)); 72 | 73 | extractCategory(); 74 | 75 | 76 | } 77 | 78 | public void extractCategory() { 79 | 80 | final ProgressBar progressBar = (ProgressBar) findViewById(R.id.progressBar); 81 | progressBar.setVisibility(View.VISIBLE); 82 | 83 | JsonArrayRequest req = new JsonArrayRequest(JSON_URL, new Response.Listener() { 84 | 85 | @Override 86 | public void onResponse(JSONArray response) { 87 | // Log.d(TAG, response.toString()); 88 | progressBar.setVisibility(View.INVISIBLE); 89 | try { 90 | // Parsing json array response 91 | // loop through each json object 92 | for (int i = 0; i < response.length(); i++) { 93 | 94 | JSONObject categoryArray = (JSONObject) response.get(i); 95 | 96 | Category categorydata = new Category(categoryArray.getString("CategoryID"), categoryArray.getString("CategoryName"), categoryArray.getString("Remark")); 97 | 98 | cat.add(categorydata); 99 | } 100 | CategoryAdapter adapter = new CategoryAdapter(cat, getApplicationContext()); 101 | rv_CategoryList.setHasFixedSize(true); 102 | rv_CategoryList.setLayoutManager(new LinearLayoutManager(getApplicationContext())); 103 | rv_CategoryList.setAdapter(adapter); 104 | }catch (JSONException e) { 105 | e.printStackTrace(); 106 | Toast.makeText(getApplicationContext(), "Error: " + e.getMessage(), Toast.LENGTH_LONG).show(); 107 | } 108 | } 109 | }, new Response.ErrorListener() { 110 | @Override 111 | public void onErrorResponse(VolleyError error) { 112 | VolleyLog.d("Error Avi", "Error: " + error.getMessage()); 113 | Toast.makeText(getApplicationContext(), error.getMessage(), Toast.LENGTH_LONG).show(); 114 | } 115 | }); 116 | 117 | AppController.getInstance().addToRequestQueue(req); 118 | 119 | } 120 | } -------------------------------------------------------------------------------- /app/src/main/java/com/sem6_project/mylib/Activity/CategoryBookActivity.java: -------------------------------------------------------------------------------- 1 | package com.sem6_project.mylib.Activity; 2 | 3 | import androidx.appcompat.app.ActionBar; 4 | import androidx.appcompat.app.AppCompatActivity; 5 | import androidx.recyclerview.widget.LinearLayoutManager; 6 | import androidx.recyclerview.widget.RecyclerView; 7 | 8 | import android.content.Intent; 9 | import android.os.Bundle; 10 | import android.text.Html; 11 | import android.view.View; 12 | import android.widget.ImageView; 13 | import android.widget.ProgressBar; 14 | import android.widget.TextView; 15 | import android.widget.Toast; 16 | 17 | import com.android.volley.Response; 18 | import com.android.volley.VolleyError; 19 | import com.android.volley.VolleyLog; 20 | import com.android.volley.toolbox.JsonArrayRequest; 21 | import com.sem6_project.mylib.Adapter.SearchBookAdapter; 22 | import com.sem6_project.mylib.R; 23 | import com.sem6_project.mylib.appcontroller.AppController; 24 | import com.sem6_project.mylib.bean.Book; 25 | 26 | import org.json.JSONArray; 27 | import org.json.JSONException; 28 | import org.json.JSONObject; 29 | 30 | import java.util.ArrayList; 31 | 32 | import static com.sem6_project.mylib.Activity.MainActivity.ip; 33 | 34 | public class CategoryBookActivity extends AppCompatActivity { 35 | 36 | RecyclerView rv_CategoryList; 37 | ArrayList bookbean; 38 | String id =""; 39 | 40 | String json = ip + "mylib/json/search_book.php?id="; 41 | static String JSON_URL; 42 | 43 | @Override 44 | protected void onCreate(Bundle savedInstanceState) { 45 | super.onCreate(savedInstanceState); 46 | setContentView(R.layout.activity_category_book); 47 | getSupportActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM); 48 | getSupportActionBar().setCustomView(R.layout.abs_layout); 49 | TextView tvTitle = findViewById(R.id.tvTitle); 50 | tvTitle.setText("Books"); 51 | 52 | ImageView iv_backarrow = findViewById(R.id.iv_backarrow); 53 | iv_backarrow.setOnClickListener(new View.OnClickListener() { 54 | @Override 55 | public void onClick(View v) { 56 | finish(); 57 | } 58 | }); 59 | 60 | id = getIntent().getStringExtra("categoryid"); 61 | 62 | JSON_URL = json + id; 63 | 64 | rv_CategoryList = (RecyclerView) findViewById(R.id.rv_categorybooklist); 65 | bookbean = new ArrayList<>(); 66 | 67 | extractbook(); 68 | 69 | } 70 | public void extractbook() { 71 | 72 | final ProgressBar progressBar = (ProgressBar) findViewById(R.id.pb_categorybook); 73 | progressBar.setVisibility(View.VISIBLE); 74 | 75 | JsonArrayRequest req = new JsonArrayRequest(JSON_URL, new Response.Listener() { 76 | 77 | @Override 78 | public void onResponse(JSONArray response) { 79 | // Log.d(TAG, response.toString()); 80 | progressBar.setVisibility(View.INVISIBLE); 81 | try { 82 | // Parsing json array response 83 | // loop through each json object 84 | for (int i = 0; i < response.length(); i++) { 85 | 86 | JSONObject bookArray = (JSONObject) response.get(i); 87 | 88 | Book bookdata = new Book(bookArray.getString("BookID"), bookArray.getString("BookName"), bookArray.getString("AuthorName"), bookArray.getString("PublicationName"), bookArray.getString("CategoryName"), bookArray.getString("BookPages"), bookArray.getString("BookPrice"), bookArray.getString("BookQuantity"), bookArray.getString("PurchaseDate"), bookArray.getString("RackNumber"), bookArray.getString("Remark")); 89 | 90 | bookbean.add(bookdata); 91 | } 92 | SearchBookAdapter adapter = new SearchBookAdapter(bookbean, getApplicationContext()); 93 | rv_CategoryList.setHasFixedSize(true); 94 | rv_CategoryList.setLayoutManager(new LinearLayoutManager(getApplicationContext())); 95 | rv_CategoryList.setAdapter(adapter); 96 | }catch (JSONException e) { 97 | e.printStackTrace(); 98 | Toast.makeText(getApplicationContext(), "Error: " + e.getMessage(), Toast.LENGTH_LONG).show(); 99 | } 100 | } 101 | }, new Response.ErrorListener() { 102 | @Override 103 | public void onErrorResponse(VolleyError error) { 104 | VolleyLog.d("Error Avi", "Error: " + error.getMessage()); 105 | Toast.makeText(getApplicationContext(), error.getMessage(), Toast.LENGTH_SHORT).show(); 106 | } 107 | }); 108 | 109 | AppController.getInstance().addToRequestQueue(req); 110 | 111 | 112 | } 113 | } -------------------------------------------------------------------------------- /app/src/main/java/com/sem6_project/mylib/Activity/CategoryBookDetailActivity.java: -------------------------------------------------------------------------------- 1 | package com.sem6_project.mylib.Activity; 2 | 3 | import androidx.appcompat.app.ActionBar; 4 | import androidx.appcompat.app.AppCompatActivity; 5 | import androidx.recyclerview.widget.LinearLayoutManager; 6 | import androidx.recyclerview.widget.RecyclerView; 7 | 8 | import android.os.Bundle; 9 | import android.view.View; 10 | import android.widget.ImageView; 11 | import android.widget.ProgressBar; 12 | import android.widget.TextView; 13 | import android.widget.Toast; 14 | 15 | import com.android.volley.Response; 16 | import com.android.volley.VolleyError; 17 | import com.android.volley.VolleyLog; 18 | import com.android.volley.toolbox.JsonArrayRequest; 19 | import com.sem6_project.mylib.Adapter.SearchBookAdapter; 20 | import com.sem6_project.mylib.R; 21 | import com.sem6_project.mylib.appcontroller.AppController; 22 | import com.sem6_project.mylib.bean.Book; 23 | 24 | import org.json.JSONArray; 25 | import org.json.JSONException; 26 | import org.json.JSONObject; 27 | 28 | import java.util.ArrayList; 29 | 30 | import static com.sem6_project.mylib.Activity.MainActivity.ip; 31 | 32 | public class CategoryBookDetailActivity extends AppCompatActivity { 33 | 34 | TextView tv_book_name, tv_book_category, tv_book_author, tv_book_publication, tv_book_pages, tv_book_quantity, tv_book_racknumber; 35 | ArrayList bookbean; 36 | String id = ""; 37 | 38 | String json = ip + "mylib/json/final_book.php?id="; 39 | static String JSON_URL; 40 | 41 | @Override 42 | protected void onCreate(Bundle savedInstanceState) { 43 | super.onCreate(savedInstanceState); 44 | setContentView(R.layout.activity_category_book_detail); 45 | getSupportActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM); 46 | getSupportActionBar().setCustomView(R.layout.abs_layout); 47 | TextView tvTitle = findViewById(R.id.tvTitle); 48 | tvTitle.setText("Book"); 49 | 50 | ImageView iv_backarrow = findViewById(R.id.iv_backarrow); 51 | iv_backarrow.setOnClickListener(new View.OnClickListener() { 52 | @Override 53 | public void onClick(View v) { 54 | finish(); 55 | } 56 | }); 57 | 58 | initialize(); 59 | 60 | id = getIntent().getStringExtra("bookid"); 61 | 62 | JSON_URL = json + id; 63 | 64 | bookbean = new ArrayList<>(); 65 | 66 | extractbook(); 67 | 68 | } 69 | 70 | public void initialize() { 71 | tv_book_name = (TextView) findViewById(R.id.tv_book_name); 72 | tv_book_category = (TextView) findViewById(R.id.tv_book_category); 73 | tv_book_author = (TextView) findViewById(R.id.tv_book_author); 74 | tv_book_publication = (TextView) findViewById(R.id.tv_book_publication); 75 | tv_book_pages = (TextView) findViewById(R.id.tv_book_pages); 76 | tv_book_quantity = (TextView) findViewById(R.id.tv_book_quantity); 77 | tv_book_racknumber = (TextView) findViewById(R.id.tv_book_racknumber); 78 | } 79 | 80 | public void extractbook() { 81 | 82 | final ProgressBar progressBar = (ProgressBar) findViewById(R.id.pb_book); 83 | progressBar.setVisibility(View.VISIBLE); 84 | 85 | JsonArrayRequest req = new JsonArrayRequest(JSON_URL, new Response.Listener() { 86 | 87 | @Override 88 | public void onResponse(JSONArray response) { 89 | // Log.d(TAG, response.toString()); 90 | progressBar.setVisibility(View.GONE); 91 | try { 92 | JSONObject bookArray = (JSONObject) response.get(0); 93 | tv_book_name.setText(bookArray.getString("BookName")); 94 | tv_book_author.setText(bookArray.getString("AuthorName")); 95 | tv_book_category.setText(bookArray.getString("CategoryName")); 96 | tv_book_pages.setText(bookArray.getString("BookPages")); 97 | tv_book_publication.setText(bookArray.getString("PublicationName")); 98 | tv_book_quantity.setText(bookArray.getString("BookQuantity")); 99 | tv_book_racknumber.setText(bookArray.getString("RackNumber")); 100 | 101 | } catch (JSONException e) { 102 | e.printStackTrace(); 103 | Toast.makeText(getApplicationContext(), "Error: " + e.getMessage(), Toast.LENGTH_LONG).show(); 104 | } 105 | } 106 | }, new Response.ErrorListener() { 107 | @Override 108 | public void onErrorResponse(VolleyError error) { 109 | VolleyLog.d("Error Avi", "Error: " + error.getMessage()); 110 | Toast.makeText(getApplicationContext(), error.getMessage(), Toast.LENGTH_SHORT).show(); 111 | } 112 | }); 113 | 114 | AppController.getInstance().addToRequestQueue(req); 115 | 116 | 117 | } 118 | } 119 | 120 | -------------------------------------------------------------------------------- /app/src/main/java/com/sem6_project/mylib/Activity/DashboardActivity.java: -------------------------------------------------------------------------------- 1 | package com.sem6_project.mylib.Activity; 2 | 3 | import androidx.appcompat.app.ActionBar; 4 | import androidx.appcompat.app.AppCompatActivity; 5 | 6 | import android.content.Intent; 7 | import android.os.Bundle; 8 | import android.text.Html; 9 | import android.view.View; 10 | import android.widget.Button; 11 | import android.widget.ImageView; 12 | import android.widget.TextView; 13 | 14 | import com.sem6_project.mylib.DeveloperActivity; 15 | import com.sem6_project.mylib.R; 16 | 17 | public class DashboardActivity extends AppCompatActivity { 18 | 19 | ImageView iv_account; 20 | Button btn_search; 21 | Button btn_categories; 22 | Button btn_about; 23 | Button btn_developer; 24 | 25 | 26 | 27 | 28 | @Override 29 | protected void onCreate(Bundle savedInstanceState) { 30 | super.onCreate(savedInstanceState); 31 | setContentView(R.layout.activity_dashboard); 32 | getSupportActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM); 33 | getSupportActionBar().setCustomView(R.layout.abs_dashboard); 34 | 35 | iv_account = findViewById(R.id.iv_account); 36 | btn_search = findViewById(R.id.btn_search); 37 | btn_categories = findViewById(R.id.btn_categories); 38 | btn_about = findViewById(R.id.btn_about); 39 | btn_developer = findViewById(R.id.btn_developer); 40 | 41 | iv_account.setOnClickListener(new View.OnClickListener() { 42 | @Override 43 | public void onClick(View v) { 44 | Intent in = new Intent(getApplicationContext(),MyAccountActivity.class); 45 | startActivity(in); 46 | } 47 | }); 48 | 49 | btn_categories.setOnClickListener(new View.OnClickListener() { 50 | @Override 51 | public void onClick(View v) { 52 | Intent in = new Intent(getApplicationContext(), CategoriesActivity.class); 53 | startActivity(in); 54 | } 55 | }); 56 | 57 | btn_search.setOnClickListener(new View.OnClickListener() { 58 | @Override 59 | public void onClick(View v) { 60 | Intent in = new Intent(getApplicationContext(),SearchActivity.class); 61 | startActivity(in); 62 | } 63 | }); 64 | 65 | btn_about.setOnClickListener(new View.OnClickListener() { 66 | @Override 67 | public void onClick(View v) { 68 | Intent in = new Intent(getApplicationContext(),AboutLibraryActivity.class); 69 | startActivity(in); 70 | } 71 | }); 72 | 73 | btn_developer.setOnClickListener(new View.OnClickListener() { 74 | @Override 75 | public void onClick(View v) { 76 | Intent in = new Intent(getApplicationContext(), DeveloperActivity.class); 77 | startActivity(in); 78 | } 79 | }); 80 | 81 | } 82 | } -------------------------------------------------------------------------------- /app/src/main/java/com/sem6_project/mylib/Activity/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.sem6_project.mylib.Activity; 2 | 3 | import androidx.appcompat.app.AppCompatActivity; 4 | 5 | import android.content.Intent; 6 | import android.content.SharedPreferences; 7 | import android.os.Bundle; 8 | import android.view.View; 9 | import android.widget.Button; 10 | import android.widget.EditText; 11 | import android.widget.Toast; 12 | 13 | import com.android.volley.Response; 14 | import com.android.volley.VolleyError; 15 | import com.android.volley.VolleyLog; 16 | import com.android.volley.toolbox.JsonArrayRequest; 17 | import com.sem6_project.mylib.R; 18 | import com.sem6_project.mylib.appcontroller.AppController; 19 | 20 | import org.json.JSONArray; 21 | import org.json.JSONException; 22 | import org.json.JSONObject; 23 | // pull test 24 | public class MainActivity extends AppCompatActivity { 25 | 26 | public final static String ip = "https://projectmylib.000webhostapp.com/"; 27 | //public final static String ip = "http://192.168.137.133/"; 28 | Button btn_login; 29 | EditText et_id, et_pass; 30 | String json1 = ip + "mylib/json/user.php?id="; 31 | String json2 = "&pas="; 32 | static String JSON_URL; 33 | public static String var; 34 | boolean keeplogin; 35 | 36 | @Override 37 | protected void onCreate(Bundle savedInstanceState) { 38 | super.onCreate(savedInstanceState); 39 | setContentView(R.layout.activity_main); 40 | getSupportActionBar().hide(); 41 | 42 | btn_login = findViewById(R.id.btn_login); 43 | 44 | 45 | et_id = findViewById(R.id.main_id); 46 | et_pass = findViewById(R.id.main_password); 47 | //afdjasdf 48 | 49 | System.out.println(var); 50 | 51 | 52 | SharedPreferences sharedPreferences = getSharedPreferences("MyPrefs", MODE_PRIVATE); 53 | boolean value = sharedPreferences.getBoolean("keeplogin",false); 54 | 55 | 56 | if(value) 57 | { 58 | Intent in = new Intent(getApplicationContext(),DashboardActivity.class); 59 | startActivity(in); 60 | finish(); 61 | } 62 | 63 | 64 | btn_login.setOnClickListener(new View.OnClickListener() { 65 | @Override 66 | public void onClick(View v) { 67 | 68 | var = et_id.getText().toString(); 69 | 70 | SharedPreferences sharedPref = getSharedPreferences("variable",MODE_PRIVATE); 71 | SharedPreferences.Editor editor = sharedPref.edit(); 72 | String userid = var; 73 | editor.putString("userid",userid); 74 | editor.apply(); 75 | 76 | JSON_URL = json1 + et_id.getText().toString() + json2 + et_pass.getText().toString() ; 77 | 78 | System.out.println(JSON_URL); 79 | 80 | extractCategory(); 81 | } 82 | }); 83 | 84 | } 85 | 86 | public void extractCategory() { 87 | 88 | 89 | JsonArrayRequest req = new JsonArrayRequest(JSON_URL, new Response.Listener() { 90 | 91 | @Override 92 | public void onResponse(JSONArray response) { 93 | try { 94 | JSONObject userLoginArray = (JSONObject) response.get(0); 95 | 96 | // 97 | if (Integer.parseInt(userLoginArray.getString("value")) == 1){ 98 | 99 | SharedPreferences sharedPreferences = getSharedPreferences("MyPrefs",MODE_PRIVATE); 100 | SharedPreferences.Editor editor = sharedPreferences.edit(); 101 | keeplogin = true; 102 | editor.putBoolean("keeplogin",keeplogin); 103 | editor.apply(); 104 | 105 | 106 | String id = et_id.getText().toString(); 107 | Intent in = new Intent(getApplicationContext(),DashboardActivity.class); 108 | startActivity(in); 109 | finish(); 110 | } 111 | else { 112 | Toast.makeText(getApplicationContext(), "Username or Password is incorrect", Toast.LENGTH_SHORT).show(); 113 | } 114 | 115 | 116 | }catch (JSONException e) { 117 | e.printStackTrace(); 118 | Toast.makeText(getApplicationContext(), "Error: " + e.getMessage(), Toast.LENGTH_LONG).show(); 119 | } 120 | } 121 | }, new Response.ErrorListener() { 122 | @Override 123 | public void onErrorResponse(VolleyError error) { 124 | VolleyLog.d("Error Avi", "Error: " + error.getMessage()); 125 | Toast.makeText(getApplicationContext(), error.getMessage(), Toast.LENGTH_LONG).show(); 126 | } 127 | }); 128 | 129 | AppController.getInstance().addToRequestQueue(req); 130 | 131 | } 132 | } -------------------------------------------------------------------------------- /app/src/main/java/com/sem6_project/mylib/Activity/MyAccountActivity.java: -------------------------------------------------------------------------------- 1 | package com.sem6_project.mylib.Activity; 2 | 3 | import androidx.appcompat.app.ActionBar; 4 | import androidx.appcompat.app.AppCompatActivity; 5 | import androidx.recyclerview.widget.LinearLayoutManager; 6 | import androidx.recyclerview.widget.RecyclerView; 7 | 8 | import android.content.Intent; 9 | import android.content.SharedPreferences; 10 | import android.os.Bundle; 11 | import android.text.Html; 12 | import android.view.View; 13 | import android.widget.Button; 14 | import android.widget.ImageView; 15 | import android.widget.ProgressBar; 16 | import android.widget.TextView; 17 | import android.widget.Toast; 18 | 19 | import com.android.volley.Response; 20 | import com.android.volley.VolleyError; 21 | import com.android.volley.VolleyLog; 22 | import com.android.volley.toolbox.JsonArrayRequest; 23 | import com.sem6_project.mylib.Adapter.IssueBookAdapter; 24 | import com.sem6_project.mylib.Adapter.SearchBookAdapter; 25 | import com.sem6_project.mylib.R; 26 | import com.sem6_project.mylib.appcontroller.AppController; 27 | import com.sem6_project.mylib.bean.Book; 28 | import com.sem6_project.mylib.bean.IssueBook; 29 | 30 | import org.json.JSONArray; 31 | import org.json.JSONException; 32 | import org.json.JSONObject; 33 | 34 | import java.util.ArrayList; 35 | 36 | import static com.sem6_project.mylib.Activity.MainActivity.ip; 37 | import static com.sem6_project.mylib.Activity.MainActivity.var; 38 | 39 | public class MyAccountActivity extends AppCompatActivity { 40 | 41 | RecyclerView rv_issuedbooks; 42 | ArrayList bookbean; 43 | IssueBook bookdata; 44 | Button btn_logout; 45 | TextView tv_username, tv_image_character, tv_address, tv_contact, tv_dues, tv_issuedbooks; 46 | String JSON_URL = ip + "mylib/json/user_detail.php?id="; 47 | String JSON_URL2 = ip + "mylib/json/issue_book.php?id="; 48 | IssueBookAdapter adapter; 49 | 50 | ProgressBar progressBar; 51 | 52 | @Override 53 | protected void onCreate(Bundle savedInstanceState) { 54 | super.onCreate(savedInstanceState); 55 | setContentView(R.layout.activity_my_account); 56 | getSupportActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM); 57 | getSupportActionBar().setCustomView(R.layout.abs_layout); 58 | TextView tvTitle = findViewById(R.id.tvTitle); 59 | tvTitle.setText("My Account"); 60 | progressBar = (ProgressBar) findViewById(R.id.pb_myaccount); 61 | progressBar.setVisibility(View.VISIBLE); 62 | 63 | ImageView iv_backarrow = findViewById(R.id.iv_backarrow); 64 | iv_backarrow.setOnClickListener(new View.OnClickListener() { 65 | @Override 66 | public void onClick(View v) { 67 | finish(); 68 | } 69 | }); 70 | 71 | SharedPreferences sharedPreferences = getSharedPreferences("variable", MODE_PRIVATE); 72 | var = sharedPreferences.getString("userid",""); 73 | 74 | 75 | JSON_URL = JSON_URL + "\"" + var + "\""; 76 | 77 | JSON_URL2 = JSON_URL2 + "\"" + var + "\""; 78 | 79 | System.out.println(JSON_URL2); 80 | bookbean = new ArrayList<>(); 81 | 82 | initialize(); 83 | 84 | accountInfo(); 85 | 86 | tv_username.setText(var); 87 | 88 | image_character_get(); 89 | 90 | if (Integer.parseInt(tv_issuedbooks.getText().toString()) > 0){ 91 | issuebook(); 92 | } 93 | btn_logout.setOnClickListener(new View.OnClickListener() { 94 | @Override 95 | public void onClick(View v) { 96 | 97 | SharedPreferences sharedPreferences = getSharedPreferences("MyPrefs",MODE_PRIVATE); 98 | SharedPreferences.Editor editor = sharedPreferences.edit(); 99 | boolean keeplogin = false; 100 | editor.putBoolean("keeplogin",keeplogin); 101 | editor.apply(); 102 | 103 | finishAffinity(); 104 | Intent in = new Intent(getApplicationContext(),MainActivity.class); 105 | startActivity(in); 106 | } 107 | }); 108 | } 109 | 110 | void image_character_get() { 111 | String s; 112 | s = (String) tv_username.getText(); 113 | s = String.valueOf(s.charAt(0)).toUpperCase(); 114 | tv_image_character.setText(s); 115 | } 116 | 117 | void initialize(){ 118 | btn_logout = findViewById(R.id.btn_logout); 119 | tv_image_character = findViewById(R.id.tv_image_character); 120 | tv_username = findViewById(R.id.tv_username); 121 | tv_address = findViewById(R.id.tv_address); 122 | tv_contact = findViewById(R.id.tv_contact); 123 | tv_dues = findViewById(R.id.tv_dues); 124 | tv_issuedbooks = findViewById(R.id.tv_issuedbooks); 125 | rv_issuedbooks = findViewById(R.id.rv_issuedbooks); 126 | } 127 | 128 | public void accountInfo() { 129 | 130 | JsonArrayRequest req = new JsonArrayRequest(JSON_URL, new Response.Listener() { 131 | 132 | @Override 133 | public void onResponse(JSONArray response) { 134 | // Log.d(TAG, response.toString()); 135 | progressBar.setVisibility(View.GONE); 136 | try { 137 | JSONObject bookArray = (JSONObject) response.get(0); 138 | tv_contact.setText(bookArray.getString("UserContactNumber")); 139 | tv_address.setText(bookArray.getString("UserAddress")); 140 | tv_issuedbooks.setText(bookArray.getString("NumberOfIssuedBooks")); 141 | tv_dues.setText(bookArray.getString("PendingDues")); 142 | 143 | 144 | 145 | }catch (JSONException e) { 146 | e.printStackTrace(); 147 | Toast.makeText(getApplicationContext(), "Error: " + e.getMessage(), Toast.LENGTH_LONG).show(); 148 | } 149 | } 150 | }, new Response.ErrorListener() { 151 | @Override 152 | public void onErrorResponse(VolleyError error) { 153 | VolleyLog.d("Error Avi", "Error: " + error.getMessage()); 154 | Toast.makeText(getApplicationContext(), error.getMessage(), Toast.LENGTH_SHORT).show(); 155 | } 156 | }); 157 | 158 | AppController.getInstance().addToRequestQueue(req); 159 | } 160 | 161 | public void issuebook(){ 162 | final ProgressBar progressBar = (ProgressBar) findViewById(R.id.pb_myaccount); 163 | progressBar.setVisibility(View.VISIBLE); 164 | 165 | JsonArrayRequest req = new JsonArrayRequest(JSON_URL2, new Response.Listener() { 166 | 167 | @Override 168 | public void onResponse(JSONArray response) { 169 | // Log.d(TAG, response.toString()); 170 | progressBar.setVisibility(View.GONE); 171 | try { 172 | // Parsing json array response 173 | // loop through each json object 174 | JSONObject bookArray = (JSONObject) response.get(0); 175 | if (Integer.parseInt(bookArray.getString("ans").toString()) == 1){ 176 | for (int i = 0; i < response.length(); i++) { 177 | 178 | JSONObject bookArray2 = (JSONObject) response.get(i); 179 | 180 | bookdata = new IssueBook(bookArray2.getString("UserID"), bookArray2.getString("IssueBookID"), bookArray2.getString("BookID"), bookArray2.getString("IssueBookDate"), bookArray2.getString("DueDate"), bookArray2.getString("BookName")); 181 | 182 | bookbean.add(bookdata); 183 | 184 | } 185 | IssueBookAdapter adapter1 = new IssueBookAdapter(bookbean, getApplicationContext()); 186 | rv_issuedbooks.setHasFixedSize(true); 187 | rv_issuedbooks.setLayoutManager(new LinearLayoutManager(getApplicationContext())); 188 | rv_issuedbooks.setAdapter(adapter1); 189 | } 190 | 191 | }catch (JSONException e) { 192 | e.printStackTrace(); 193 | Toast.makeText(getApplicationContext(), "Error: " + e.getMessage(), Toast.LENGTH_LONG).show(); 194 | } 195 | } 196 | }, new Response.ErrorListener() { 197 | @Override 198 | public void onErrorResponse(VolleyError error) { 199 | VolleyLog.d("Error Avi", "Error: " + error.getMessage()); 200 | Toast.makeText(getApplicationContext(), error.getMessage(), Toast.LENGTH_SHORT).show(); 201 | } 202 | }); 203 | 204 | 205 | AppController.getInstance().addToRequestQueue(req); 206 | } 207 | } -------------------------------------------------------------------------------- /app/src/main/java/com/sem6_project/mylib/Activity/SearchActivity.java: -------------------------------------------------------------------------------- 1 | package com.sem6_project.mylib.Activity; 2 | 3 | import androidx.appcompat.app.ActionBar; 4 | import androidx.appcompat.app.AppCompatActivity; 5 | import androidx.recyclerview.widget.LinearLayoutManager; 6 | import androidx.recyclerview.widget.RecyclerView; 7 | 8 | import android.os.Bundle; 9 | import android.text.Editable; 10 | import android.text.Html; 11 | import android.text.TextWatcher; 12 | import android.view.View; 13 | import android.widget.EditText; 14 | import android.widget.ImageView; 15 | import android.widget.ProgressBar; 16 | import android.widget.TextView; 17 | import android.widget.Toast; 18 | 19 | import com.android.volley.Response; 20 | import com.android.volley.VolleyError; 21 | import com.android.volley.VolleyLog; 22 | import com.android.volley.toolbox.JsonArrayRequest; 23 | import com.sem6_project.mylib.Adapter.CategoryAdapter; 24 | import com.sem6_project.mylib.Adapter.SearchBookAdapter; 25 | import com.sem6_project.mylib.R; 26 | import com.sem6_project.mylib.appcontroller.AppController; 27 | import com.sem6_project.mylib.bean.Book; 28 | import com.sem6_project.mylib.bean.Category; 29 | 30 | import org.json.JSONArray; 31 | import org.json.JSONException; 32 | import org.json.JSONObject; 33 | 34 | import java.util.ArrayList; 35 | 36 | import static com.sem6_project.mylib.Activity.MainActivity.ip; 37 | 38 | public class SearchActivity extends AppCompatActivity { 39 | 40 | RecyclerView rv_CategoryList; 41 | ArrayList bookbean; 42 | ArrayList tempuserlist; 43 | EditText et_search; 44 | Book bookdata; 45 | SearchBookAdapter adapter; 46 | 47 | private static String JSON_URL = ip + "mylib/json/book.php"; 48 | 49 | @Override 50 | protected void onCreate(Bundle savedInstanceState) { 51 | super.onCreate(savedInstanceState); 52 | setContentView(R.layout.activity_search); 53 | getSupportActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM); 54 | getSupportActionBar().setCustomView(R.layout.abs_layout); 55 | TextView tvTitle = findViewById(R.id.tvTitle); 56 | tvTitle.setText("Search"); 57 | 58 | ImageView iv_backarrow = findViewById(R.id.iv_backarrow); 59 | iv_backarrow.setOnClickListener(new View.OnClickListener() { 60 | @Override 61 | public void onClick(View v) { 62 | finish(); 63 | } 64 | }); 65 | 66 | et_search = (EditText) findViewById(R.id.et_search); 67 | rv_CategoryList = (RecyclerView) findViewById(R.id.search_rc_book); 68 | bookbean = new ArrayList<>(); 69 | tempuserlist = new ArrayList<>(); 70 | 71 | extractbook(); 72 | 73 | et_search.addTextChangedListener(new TextWatcher() { 74 | @Override 75 | public void beforeTextChanged(CharSequence s, int start, int count, int after) { 76 | } 77 | 78 | @Override 79 | public void onTextChanged(CharSequence s, int start, int before, int count) { 80 | 81 | 82 | tempuserlist.addAll(bookbean); 83 | 84 | 85 | tempuserlist.clear(); 86 | 87 | 88 | for(int i=0 ; i < bookbean.size(); i++) { 89 | 90 | if(bookbean.get(i).getBookName().toLowerCase().contains(s.toString().toLowerCase())) 91 | { 92 | tempuserlist.add(bookbean.get(i)); 93 | } 94 | else if(bookbean.get(i).getAuthorName().toLowerCase().contains(s.toString().toLowerCase())) 95 | { 96 | tempuserlist.add(bookbean.get(i)); 97 | } 98 | else if(bookbean.get(i).getCategoryName().toLowerCase().contains(s.toString().toLowerCase())) 99 | { 100 | tempuserlist.add(bookbean.get(i)); 101 | } 102 | 103 | } 104 | if(s.toString().length() == 0) 105 | { 106 | tempuserlist.removeAll(bookbean); 107 | } 108 | adapter.notifyDataSetChanged(); 109 | } 110 | 111 | @Override 112 | public void afterTextChanged(Editable s) { 113 | } 114 | }); 115 | } 116 | 117 | public void extractbook() { 118 | 119 | final ProgressBar progressBar = (ProgressBar) findViewById(R.id.search_progressBar); 120 | progressBar.setVisibility(View.VISIBLE); 121 | 122 | JsonArrayRequest req = new JsonArrayRequest(JSON_URL, new Response.Listener() { 123 | 124 | @Override 125 | public void onResponse(JSONArray response) { 126 | // Log.d(TAG, response.toString()); 127 | progressBar.setVisibility(View.INVISIBLE); 128 | try { 129 | // Parsing json array response 130 | // loop through each json object 131 | for (int i = 0; i < response.length(); i++) { 132 | 133 | JSONObject bookArray = (JSONObject) response.get(i); 134 | 135 | bookdata = new Book(bookArray.getString("BookID"), bookArray.getString("BookName"), bookArray.getString("AuthorName"), bookArray.getString("PublicationName"), bookArray.getString("CategoryName"), bookArray.getString("BookPages"), bookArray.getString("BookPrice"), bookArray.getString("BookQuantity"), bookArray.getString("PurchaseDate"), bookArray.getString("RackNumber"), bookArray.getString("Remark")); 136 | 137 | bookbean.add(bookdata); 138 | 139 | } 140 | tempuserlist.addAll(bookbean); 141 | adapter = new SearchBookAdapter(tempuserlist, getApplicationContext()); 142 | rv_CategoryList.setHasFixedSize(true); 143 | rv_CategoryList.setLayoutManager(new LinearLayoutManager(getApplicationContext())); 144 | rv_CategoryList.setAdapter(adapter); 145 | }catch (JSONException e) { 146 | e.printStackTrace(); 147 | Toast.makeText(getApplicationContext(), "Error: " + e.getMessage(), Toast.LENGTH_LONG).show(); 148 | } 149 | } 150 | }, new Response.ErrorListener() { 151 | @Override 152 | public void onErrorResponse(VolleyError error) { 153 | VolleyLog.d("Error Avi", "Error: " + error.getMessage()); 154 | Toast.makeText(getApplicationContext(), error.getMessage(), Toast.LENGTH_SHORT).show(); 155 | } 156 | }); 157 | 158 | 159 | AppController.getInstance().addToRequestQueue(req); 160 | 161 | 162 | } 163 | } -------------------------------------------------------------------------------- /app/src/main/java/com/sem6_project/mylib/Activity/SplashScreenActivity.java: -------------------------------------------------------------------------------- 1 | package com.sem6_project.mylib.Activity; 2 | 3 | import androidx.appcompat.app.AppCompatActivity; 4 | 5 | import android.content.Intent; 6 | import android.os.Bundle; 7 | import android.os.Handler; 8 | 9 | import com.sem6_project.mylib.R; 10 | 11 | public class SplashScreenActivity extends AppCompatActivity { 12 | 13 | 14 | @Override 15 | protected void onCreate(Bundle savedInstanceState) { 16 | super.onCreate(savedInstanceState); 17 | setContentView(R.layout.activity_splash_screen); 18 | getSupportActionBar().hide(); 19 | 20 | int secondsDelayed = 1; 21 | new Handler().postDelayed(new Runnable() { 22 | public void run() { 23 | startActivity(new Intent(getApplicationContext(),MainActivity.class)); 24 | finish(); 25 | } 26 | }, secondsDelayed * 1500); 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /app/src/main/java/com/sem6_project/mylib/Adapter/CategoryAdapter.java: -------------------------------------------------------------------------------- 1 | package com.sem6_project.mylib.Adapter; 2 | 3 | import android.content.Context; 4 | import android.content.Intent; 5 | import android.view.LayoutInflater; 6 | import android.view.View; 7 | import android.view.ViewGroup; 8 | import android.widget.LinearLayout; 9 | import android.widget.TextView; 10 | import android.widget.Toast; 11 | 12 | import androidx.annotation.NonNull; 13 | import androidx.recyclerview.widget.RecyclerView; 14 | 15 | import com.sem6_project.mylib.Activity.CategoryBookActivity; 16 | import com.sem6_project.mylib.Activity.MyAccountActivity; 17 | import com.sem6_project.mylib.R; 18 | import com.sem6_project.mylib.bean.Category; 19 | 20 | import java.lang.reflect.Array; 21 | import java.util.ArrayList; 22 | import java.util.List; 23 | 24 | public class CategoryAdapter extends RecyclerView.Adapter { 25 | 26 | public String categoryid; 27 | private ArrayList listdata; 28 | Context context; 29 | 30 | public CategoryAdapter(ArrayList listdata, Context context){ 31 | this.listdata = listdata; 32 | this.context = context; 33 | } 34 | 35 | @NonNull 36 | @Override 37 | public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { 38 | LayoutInflater layoutInflater = LayoutInflater.from(parent.getContext()); 39 | View listitem = layoutInflater.inflate(R.layout.view_row_category, parent, false); 40 | ViewHolder viewHolder = new ViewHolder(listitem); 41 | return viewHolder; 42 | } 43 | 44 | @Override 45 | public void onBindViewHolder(@NonNull ViewHolder holder, int position) { 46 | final Category myListData = listdata.get(position); 47 | holder.tv_CategoryID.setText(listdata.get(position).getCategoryID()); 48 | holder.tv_CategoryName.setText(listdata.get(position).getCategory_Name()); 49 | 50 | holder.relativeLayout.setOnClickListener(new View.OnClickListener() { 51 | @Override 52 | public void onClick(View v) { 53 | 54 | categoryid = listdata.get(position).getCategoryID(); 55 | Intent in = new Intent(context.getApplicationContext(), CategoryBookActivity.class); 56 | in.putExtra("categoryid",categoryid); 57 | in.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 58 | context.startActivity(in); 59 | 60 | // Toast.makeText(v.getContext(),"Click on item:"+ myListData.getCategoryID(), Toast.LENGTH_LONG).show(); 61 | } 62 | }); 63 | } 64 | 65 | @Override 66 | public int getItemCount() { 67 | return listdata.size(); 68 | } 69 | 70 | public class ViewHolder extends RecyclerView.ViewHolder { 71 | public TextView tv_CategoryName, tv_CategoryID; 72 | public LinearLayout relativeLayout; 73 | public ViewHolder(@NonNull View itemView) { 74 | super(itemView); 75 | this.tv_CategoryID = (TextView) itemView.findViewById(R.id.tv_CategoryID); 76 | this.tv_CategoryName = (TextView) itemView.findViewById(R.id.tv_CategoryName); 77 | relativeLayout = (LinearLayout) itemView.findViewById(R.id.linear); 78 | } 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /app/src/main/java/com/sem6_project/mylib/Adapter/CategoryBookDetailAdapter.java: -------------------------------------------------------------------------------- 1 | package com.sem6_project.mylib.Adapter; 2 | 3 | import android.content.Intent; 4 | import android.view.LayoutInflater; 5 | import android.view.View; 6 | import android.view.ViewGroup; 7 | import android.widget.LinearLayout; 8 | import android.widget.TextView; 9 | 10 | import androidx.annotation.NonNull; 11 | import androidx.recyclerview.widget.RecyclerView; 12 | 13 | import com.sem6_project.mylib.Activity.CategoryBookActivity; 14 | import com.sem6_project.mylib.R; 15 | import com.sem6_project.mylib.bean.Book; 16 | import com.sem6_project.mylib.bean.Category; 17 | 18 | import java.util.ArrayList; 19 | 20 | public class CategoryBookDetailAdapter extends RecyclerView.Adapter { 21 | 22 | public String categoryid; 23 | private ArrayList listdata; 24 | 25 | public CategoryBookDetailAdapter(ArrayList listdata){ 26 | this.listdata = listdata; 27 | } 28 | 29 | @NonNull 30 | @Override 31 | public CategoryBookDetailAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { 32 | LayoutInflater layoutInflater = LayoutInflater.from(parent.getContext()); 33 | View listitem = layoutInflater.inflate(R.layout.activity_category_book, parent, false); 34 | CategoryBookDetailAdapter.ViewHolder viewHolder = new CategoryBookDetailAdapter.ViewHolder(listitem); 35 | return viewHolder; 36 | } 37 | 38 | @Override 39 | public void onBindViewHolder(@NonNull ViewHolder holder, int position) { 40 | 41 | holder.tv_book_name.setText(listdata.get(position).getBookName()); 42 | holder.tv_book_category.setText(listdata.get(position).getCategoryName()); 43 | holder.tv_book_author.setText(listdata.get(position).getAuthorName()); 44 | holder.tv_book_publication.setText(listdata.get(position).getPublicationName()); 45 | holder.tv_book_pages.setText(listdata.get(position).getBookPages()); 46 | holder.tv_book_quantity.setText(listdata.get(position).getBookQuantity()); 47 | holder.tv_book_racknumber.setText(listdata.get(position).getRackNumber()); 48 | 49 | 50 | } 51 | 52 | @Override 53 | public int getItemCount() { 54 | return listdata.size(); 55 | } 56 | 57 | public class ViewHolder extends RecyclerView.ViewHolder { 58 | public TextView tv_book_name, tv_book_category, tv_book_author, tv_book_publication, tv_book_pages, tv_book_quantity, tv_book_racknumber; 59 | public ViewHolder(@NonNull View itemView) { 60 | super(itemView); 61 | this.tv_book_name = (TextView) itemView.findViewById(R.id.tv_book_name); 62 | this.tv_book_category = (TextView) itemView.findViewById(R.id.tv_book_category); 63 | this.tv_book_author = (TextView) itemView.findViewById(R.id.tv_book_author); 64 | this.tv_book_publication = (TextView) itemView.findViewById(R.id.tv_book_publication); 65 | this.tv_book_pages = (TextView) itemView.findViewById(R.id.tv_book_pages); 66 | this.tv_book_quantity = (TextView) itemView.findViewById(R.id.tv_book_quantity); 67 | this.tv_book_racknumber = (TextView) itemView.findViewById(R.id.tv_book_racknumber); 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /app/src/main/java/com/sem6_project/mylib/Adapter/IssueBookAdapter.java: -------------------------------------------------------------------------------- 1 | package com.sem6_project.mylib.Adapter; 2 | 3 | import android.content.Context; 4 | import android.view.LayoutInflater; 5 | import android.view.View; 6 | import android.view.ViewGroup; 7 | import android.widget.TextView; 8 | 9 | import androidx.annotation.NonNull; 10 | import androidx.recyclerview.widget.RecyclerView; 11 | 12 | import com.sem6_project.mylib.R; 13 | import com.sem6_project.mylib.bean.Category; 14 | import com.sem6_project.mylib.bean.IssueBook; 15 | 16 | import java.util.ArrayList; 17 | 18 | public class IssueBookAdapter extends RecyclerView.Adapter{ 19 | 20 | private ArrayList listdata; 21 | Context context; 22 | 23 | public IssueBookAdapter(ArrayList listdata, Context context){ 24 | this.listdata = listdata; 25 | this.context = context; 26 | } 27 | 28 | @NonNull 29 | @Override 30 | public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { 31 | LayoutInflater layoutInflater = LayoutInflater.from(parent.getContext()); 32 | View listitem = layoutInflater.inflate(R.layout.view_issued_book, parent, false); 33 | IssueBookAdapter.ViewHolder viewHolder = new IssueBookAdapter.ViewHolder(listitem); 34 | return viewHolder; 35 | } 36 | 37 | @Override 38 | public void onBindViewHolder(@NonNull ViewHolder holder, int position) { 39 | holder.tv_issued_bookname.setText(listdata.get(position).getBookName()); 40 | holder.tv_issued_date.setText(listdata.get(position).getIssueBookDate()); 41 | holder.tv_due_date.setText(listdata.get(position).getDueDate()); 42 | } 43 | 44 | @Override 45 | public int getItemCount() { 46 | return listdata.size(); 47 | } 48 | 49 | public class ViewHolder extends RecyclerView.ViewHolder { 50 | TextView tv_issued_bookname, tv_issued_date, tv_due_date; 51 | public ViewHolder(@NonNull View v) { 52 | super(v); 53 | tv_due_date = v.findViewById(R.id.tv_due_date); 54 | tv_issued_bookname = v.findViewById(R.id.tv_issued_bookname); 55 | tv_issued_date = v.findViewById(R.id.tv_issued_date); 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /app/src/main/java/com/sem6_project/mylib/Adapter/SearchBookAdapter.java: -------------------------------------------------------------------------------- 1 | package com.sem6_project.mylib.Adapter; 2 | 3 | import android.content.Context; 4 | import android.content.Intent; 5 | import android.graphics.Color; 6 | import android.view.LayoutInflater; 7 | import android.view.View; 8 | import android.view.ViewGroup; 9 | import android.widget.LinearLayout; 10 | import android.widget.TextView; 11 | import android.widget.Toast; 12 | 13 | import androidx.annotation.NonNull; 14 | import androidx.recyclerview.widget.RecyclerView; 15 | 16 | import com.sem6_project.mylib.Activity.CategoryBookActivity; 17 | import com.sem6_project.mylib.Activity.CategoryBookDetailActivity; 18 | import com.sem6_project.mylib.R; 19 | import com.sem6_project.mylib.bean.Book; 20 | import com.sem6_project.mylib.bean.Category; 21 | 22 | import java.util.ArrayList; 23 | 24 | public class SearchBookAdapter extends RecyclerView.Adapter { 25 | 26 | private ArrayList listdata; 27 | public String bookid; 28 | Context context; 29 | // banne search and category book ma kaam laagse 30 | 31 | public SearchBookAdapter(ArrayList listdata, Context context){ 32 | this.listdata = listdata; 33 | this.context = context; 34 | } 35 | 36 | @NonNull 37 | @Override 38 | public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { 39 | LayoutInflater layoutInflater = LayoutInflater.from(parent.getContext()); 40 | View listitem = layoutInflater.inflate(R.layout.view_row_search_book, parent, false); 41 | SearchBookAdapter.ViewHolder viewHolder = new SearchBookAdapter.ViewHolder(listitem); 42 | return viewHolder; 43 | } 44 | 45 | @Override 46 | public void onBindViewHolder(@NonNull ViewHolder holder, int position) { 47 | final Book myListData = listdata.get(position); 48 | holder.tv_search_bookid.setText(listdata.get(position).getBookID()); 49 | holder.tv_search_bookname.setText(listdata.get(position).getBookName()); 50 | holder.tv_search_authorname.setText(listdata.get(position).getAuthorName()); 51 | holder.tv_search_categoryname.setText(listdata.get(position).getCategoryName()); 52 | holder.relativeLayout.setOnClickListener(new View.OnClickListener() { 53 | @Override 54 | public void onClick(View v) { 55 | // Toast.makeText(v.getContext(),"Click on item:"+ myListData.getBookID(), Toast.LENGTH_LONG).show(); 56 | bookid = listdata.get(position).getBookID(); 57 | Intent in = new Intent(context.getApplicationContext(), CategoryBookDetailActivity.class); 58 | in.putExtra("bookid",bookid); 59 | in.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 60 | context.startActivity(in); 61 | 62 | } 63 | }); 64 | if(Integer.parseInt(listdata.get(position).getBookQuantity()) > 0 ){ 65 | holder.tv_available.setText("Available"); 66 | holder.tv_available.setTextColor(Color.parseColor("#388E3C")); 67 | } 68 | else if(Integer.parseInt(listdata.get(position).getBookQuantity()) <= 0 ){ 69 | holder.tv_available.setText("Not Available"); 70 | holder.tv_available.setTextColor(Color.parseColor("#C62828")); 71 | } 72 | } 73 | 74 | @Override 75 | public int getItemCount() { 76 | return listdata.size(); 77 | } 78 | 79 | public class ViewHolder extends RecyclerView.ViewHolder { 80 | 81 | public TextView tv_search_bookname, tv_search_categoryname, tv_search_authorname, tv_search_bookid; 82 | public LinearLayout relativeLayout; 83 | public TextView tv_available; 84 | 85 | public ViewHolder(@NonNull View itemView) { 86 | super(itemView); 87 | this.tv_search_bookid = (TextView) itemView.findViewById(R.id.tv_search_bookid); 88 | this.tv_search_bookname = (TextView) itemView.findViewById(R.id.tv_search_bookname); 89 | this.tv_search_authorname = (TextView) itemView.findViewById(R.id.tv_search_authorname); 90 | this.tv_search_categoryname = (TextView) itemView.findViewById(R.id.tv_search_categoryname); 91 | this.relativeLayout = (LinearLayout) itemView.findViewById(R.id.search_book_linear); 92 | tv_available = itemView.findViewById(R.id.tv_available); 93 | } 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /app/src/main/java/com/sem6_project/mylib/DeveloperActivity.java: -------------------------------------------------------------------------------- 1 | package com.sem6_project.mylib; 2 | 3 | import androidx.appcompat.app.ActionBar; 4 | import androidx.appcompat.app.AppCompatActivity; 5 | 6 | import android.content.Intent; 7 | import android.net.Uri; 8 | import android.os.Bundle; 9 | import android.view.View; 10 | import android.widget.ImageView; 11 | import android.widget.TextView; 12 | 13 | public class DeveloperActivity extends AppCompatActivity { 14 | 15 | TextView tv_number_1 , tv_number_2 , tv_number_3 , tv_mail_1 , tv_mail_2 , tv_mail_3; 16 | 17 | 18 | @Override 19 | protected void onCreate(Bundle savedInstanceState) { 20 | super.onCreate(savedInstanceState); 21 | setContentView(R.layout.activity_developer); 22 | getSupportActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM); 23 | getSupportActionBar().setCustomView(R.layout.abs_layout); 24 | TextView tvTitle = findViewById(R.id.tvTitle); 25 | tvTitle.setText("Developer"); 26 | 27 | ImageView iv_backarrow = findViewById(R.id.iv_backarrow); 28 | iv_backarrow.setOnClickListener(new View.OnClickListener() { 29 | @Override 30 | public void onClick(View v) { 31 | finish(); 32 | } 33 | }); 34 | 35 | 36 | tv_number_1 = findViewById(R.id.tv_number_1); 37 | tv_number_2 = findViewById(R.id.tv_number_2); 38 | tv_number_3 = findViewById(R.id.tv_number_3); 39 | tv_mail_1 = findViewById(R.id.tv_mail_1); 40 | tv_mail_2 = findViewById(R.id.tv_mail_2); 41 | tv_mail_3 = findViewById(R.id.tv_mail_3); 42 | 43 | tv_number_1.setOnClickListener(new View.OnClickListener() { 44 | @Override 45 | public void onClick(View v) { 46 | Intent intent = new Intent(Intent.ACTION_DIAL); 47 | intent.setData(Uri.parse("tel:7990638761")); 48 | startActivity(intent); 49 | } 50 | }); 51 | 52 | tv_number_2.setOnClickListener(new View.OnClickListener() { 53 | @Override 54 | public void onClick(View v) { 55 | Intent intent = new Intent(Intent.ACTION_DIAL); 56 | intent.setData(Uri.parse("tel:7041220538")); 57 | startActivity(intent); 58 | } 59 | }); 60 | 61 | tv_number_3.setOnClickListener(new View.OnClickListener() { 62 | @Override 63 | public void onClick(View v) { 64 | Intent intent = new Intent(Intent.ACTION_DIAL); 65 | intent.setData(Uri.parse("tel:9104559910")); 66 | startActivity(intent); 67 | } 68 | }); 69 | 70 | tv_mail_1.setOnClickListener(new View.OnClickListener() { 71 | @Override 72 | public void onClick(View v) { 73 | Intent emailIntent = new Intent(Intent.ACTION_SEND); 74 | emailIntent.setData(Uri.parse("mailto:186620307056@darshan.ac.in")); 75 | emailIntent.setType("text/plain"); 76 | startActivity(emailIntent); 77 | } 78 | }); 79 | 80 | tv_mail_2.setOnClickListener(new View.OnClickListener() { 81 | @Override 82 | public void onClick(View v) { 83 | Intent emailIntent = new Intent(Intent.ACTION_SEND); 84 | emailIntent.setData(Uri.parse("mailto:186620307001@darshan.ac.in")); 85 | emailIntent.setType("text/plain"); 86 | startActivity(emailIntent); 87 | } 88 | }); 89 | 90 | tv_mail_3.setOnClickListener(new View.OnClickListener() { 91 | @Override 92 | public void onClick(View v) { 93 | Intent emailIntent = new Intent(Intent.ACTION_SEND); 94 | emailIntent.setData(Uri.parse("mailto:186620307055@darshan.ac.in")); 95 | emailIntent.setType("text/plain"); 96 | startActivity(emailIntent); 97 | } 98 | }); 99 | 100 | } 101 | } -------------------------------------------------------------------------------- /app/src/main/java/com/sem6_project/mylib/appcontroller/AppController.java: -------------------------------------------------------------------------------- 1 | package com.sem6_project.mylib.appcontroller; 2 | 3 | import android.app.Application; 4 | import android.text.TextUtils; 5 | 6 | import com.android.volley.Request; 7 | import com.android.volley.RequestQueue; 8 | import com.android.volley.toolbox.Volley; 9 | 10 | public class AppController extends Application { 11 | 12 | public static final String TAG = AppController.class.getSimpleName(); 13 | 14 | private RequestQueue mRequestQueue; 15 | 16 | private static AppController mInstance; 17 | 18 | @Override 19 | public void onCreate() { 20 | super.onCreate(); 21 | mInstance = this; 22 | } 23 | 24 | public static synchronized AppController getInstance() { 25 | return mInstance; 26 | } 27 | 28 | public RequestQueue getRequestQueue() { 29 | if (mRequestQueue == null) { 30 | mRequestQueue = Volley.newRequestQueue(getApplicationContext()); 31 | } 32 | 33 | return mRequestQueue; 34 | } 35 | 36 | public void addToRequestQueue(Request req, String tag) { 37 | req.setTag(TextUtils.isEmpty(tag) ? TAG : tag); 38 | getRequestQueue().add(req); 39 | } 40 | 41 | public void addToRequestQueue(Request req) { 42 | req.setTag(TAG); 43 | getRequestQueue().add(req); 44 | } 45 | 46 | public void cancelPendingRequests(Object tag) { 47 | if (mRequestQueue != null) { 48 | mRequestQueue.cancelAll(tag); 49 | } 50 | } 51 | } -------------------------------------------------------------------------------- /app/src/main/java/com/sem6_project/mylib/bean/Book.java: -------------------------------------------------------------------------------- 1 | package com.sem6_project.mylib.bean; 2 | 3 | public class Book { 4 | String BookID, BookName, AuthorName, PublicationName, CategoryName, BookPages, BookPrice, BookQuantity, PurchaseDate, RackNumber, Remark; 5 | 6 | public Book(String BookID, String BookName, String AuthorName, String PublicationName, String CategoryName, String BookPages,String BookPrice,String BookQuantity,String PurchaseDate,String RackNumber,String Remark){ 7 | this.BookID = BookID; 8 | this.BookName = BookName; 9 | this.AuthorName = AuthorName; 10 | this.PublicationName = PublicationName; 11 | this.CategoryName = CategoryName; 12 | this.BookPages = BookPages; 13 | this.BookPrice = BookPrice; 14 | this.BookQuantity = BookQuantity; 15 | this.PurchaseDate = PurchaseDate; 16 | this.RackNumber = RackNumber; 17 | this.Remark = Remark; 18 | } 19 | 20 | public String getBookID() { 21 | return BookID; 22 | } 23 | 24 | public void setBookID(String bookID) { 25 | BookID = bookID; 26 | } 27 | 28 | public String getBookName() { 29 | return BookName; 30 | } 31 | 32 | public void setBookName(String bookName) { 33 | BookName = bookName; 34 | } 35 | 36 | public String getAuthorName() { 37 | return AuthorName; 38 | } 39 | 40 | public void setAuthorName(String authorName) { 41 | AuthorName = authorName; 42 | } 43 | 44 | public String getPublicationName() { 45 | return PublicationName; 46 | } 47 | 48 | public void setPublicationName(String publicationName) { 49 | PublicationName = publicationName; 50 | } 51 | 52 | public String getCategoryName() { 53 | return CategoryName; 54 | } 55 | 56 | public void setCategoryName(String categoryName) { 57 | CategoryName = categoryName; 58 | } 59 | 60 | public String getBookPages() { 61 | return BookPages; 62 | } 63 | 64 | public void setBookPages(String bookPages) { 65 | BookPages = bookPages; 66 | } 67 | 68 | public String getBookPrice() { 69 | return BookPrice; 70 | } 71 | 72 | public void setBookPrice(String bookPrice) { 73 | BookPrice = bookPrice; 74 | } 75 | 76 | public String getBookQuantity() { 77 | return BookQuantity; 78 | } 79 | 80 | public void setBookQuantity(String bookQuantity) { 81 | BookQuantity = bookQuantity; 82 | } 83 | 84 | public String getPurchaseDate() { 85 | return PurchaseDate; 86 | } 87 | 88 | public void setPurchaseDate(String purchaseDate) { 89 | PurchaseDate = purchaseDate; 90 | } 91 | 92 | public String getRackNumber() { 93 | return RackNumber; 94 | } 95 | 96 | public void setRackNumber(String rackNumber) { 97 | RackNumber = rackNumber; 98 | } 99 | 100 | public String getRemark() { 101 | return Remark; 102 | } 103 | 104 | public void setRemark(String remark) { 105 | Remark = remark; 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /app/src/main/java/com/sem6_project/mylib/bean/Category.java: -------------------------------------------------------------------------------- 1 | package com.sem6_project.mylib.bean; 2 | 3 | public class Category { 4 | String CategoryID; 5 | String Category_Name, Remark; 6 | 7 | public Category(String CategoryID, String Category_Name, String Remark) { 8 | this.Category_Name = Category_Name; 9 | this.CategoryID = CategoryID; 10 | this.Remark = Remark; 11 | } 12 | 13 | public String getCategoryID() { 14 | return CategoryID; 15 | } 16 | 17 | public void setCategoryID(String categoryID) { 18 | CategoryID = categoryID; 19 | } 20 | 21 | public String getCategory_Name() { 22 | return Category_Name; 23 | } 24 | 25 | public void setCategory_Name(String category_Name) { 26 | Category_Name = category_Name; 27 | } 28 | 29 | public String getRemark() { 30 | return Remark; 31 | } 32 | 33 | public void setRemark(String remark) { 34 | Remark = remark; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /app/src/main/java/com/sem6_project/mylib/bean/IssueBook.java: -------------------------------------------------------------------------------- 1 | package com.sem6_project.mylib.bean; 2 | 3 | public class IssueBook { 4 | String UserID, IssueBookID, BookID, IssueBookDate, DueDate, BookName; 5 | 6 | public IssueBook(String UserID, String IssueBookID, String BookID, String IssueBookDate, String DueDate, String BookName){ 7 | this.UserID = UserID; 8 | this.BookID = BookID; 9 | this.IssueBookID = IssueBookID; 10 | this.DueDate = DueDate; 11 | this.IssueBookDate = IssueBookDate; 12 | this.BookName = BookName; 13 | } 14 | 15 | public String getUserID() { 16 | return UserID; 17 | } 18 | 19 | public void setUserID(String userID) { 20 | UserID = userID; 21 | } 22 | 23 | public String getIssueBookID() { 24 | return IssueBookID; 25 | } 26 | 27 | public void setIssueBookID(String issueBookID) { 28 | IssueBookID = issueBookID; 29 | } 30 | 31 | public String getBookID() { 32 | return BookID; 33 | } 34 | 35 | public void setBookID(String bookID) { 36 | BookID = bookID; 37 | } 38 | 39 | public String getIssueBookDate() { 40 | return IssueBookDate; 41 | } 42 | 43 | public void setIssueBookDate(String issueBookDate) { 44 | IssueBookDate = issueBookDate; 45 | } 46 | 47 | public String getDueDate() { 48 | return DueDate; 49 | } 50 | 51 | public void setDueDate(String dueDate) { 52 | DueDate = dueDate; 53 | } 54 | 55 | public String getBookName() { 56 | return BookName; 57 | } 58 | 59 | public void setBookName(String bookName) { 60 | BookName = bookName; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 15 | 18 | 21 | 22 | 23 | 24 | 30 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/pic1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devarshukani/MyLib-Android/150a385f58adca2e29ca5caf7261ac36813538a5/app/src/main/res/drawable-v24/pic1.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/pic2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devarshukani/MyLib-Android/150a385f58adca2e29ca5caf7261ac36813538a5/app/src/main/res/drawable-v24/pic2.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/pic3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devarshukani/MyLib-Android/150a385f58adca2e29ca5caf7261ac36813538a5/app/src/main/res/drawable-v24/pic3.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable/background_gradient.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/book_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/dashboard_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_aboutlibrary.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 15 | 18 | 21 | 24 | 27 | 30 | 33 | 36 | 37 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_account.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 15 | 18 | 21 | 24 | 27 | 30 | 33 | 36 | 39 | 42 | 43 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_baseline_arrow_back_24.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_baseline_call_24.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_baseline_email_24.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_book.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_books_stack_of_three.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_calendar.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 15 | 18 | 21 | 24 | 27 | 30 | 33 | 36 | 39 | 42 | 45 | 48 | 51 | 52 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_category.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_developer.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 15 | 18 | 21 | 22 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_due_date.xml: -------------------------------------------------------------------------------- 1 | 6 | 10 | 14 | 18 | 22 | 26 | 30 | 34 | 38 | 42 | 46 | 47 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_issue_date.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | 15 | 20 | 25 | 30 | 35 | 40 | 45 | 50 | 55 | 60 | 65 | 70 | 75 | 80 | 85 | 90 | 95 | 100 | 105 | 110 | 115 | 120 | 125 | 130 | 135 | 140 | 145 | 150 | 155 | 160 | 165 | 170 | 171 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 6 | 10 | 13 | 16 | 19 | 22 | 25 | 28 | 31 | 34 | 37 | 40 | 43 | 46 | 49 | 52 | 55 | 58 | 61 | 64 | 67 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_left_arrow.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_lock.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_login.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_logout.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_open_book.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 15 | 18 | 21 | 24 | 27 | 30 | 33 | 36 | 39 | 42 | 45 | 48 | 51 | 54 | 57 | 60 | 63 | 66 | 67 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_pen_tool.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_person.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_search.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_search_24.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_timetable.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 15 | 18 | 21 | 24 | 27 | 30 | 33 | 34 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/login_background_text.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/font/sf_pro.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devarshukani/MyLib-Android/150a385f58adca2e29ca5caf7261ac36813538a5/app/src/main/res/font/sf_pro.ttf -------------------------------------------------------------------------------- /app/src/main/res/layout/abs_dashboard.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 13 | 14 | 26 | 27 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/res/layout/abs_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 13 | 14 | 20 | 21 | 22 | 34 | 35 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_about_library.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | // daudcaidcja 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 29 | 30 | 31 | 34 | 35 | 36 | 40 | 41 | 42 | 52 | 53 | 64 | 73 | // :) 74 | 75 | 76 | 77 | 87 | 88 | 99 | 103 | 104 | 108 | 109 | 119 | 120 | 129 | 130 | 131 | 132 | 136 | 137 | 147 | 148 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_categories.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 18 | 19 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_category_book.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 18 | 19 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_dashboard.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 13 | 14 | 19 | 20 | 143 | 144 | 145 | 146 | 147 | 148 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_search.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | // search edit text 13 | 21 | 22 | 26 | 27 | 28 | 29 | 45 | 46 | 47 | 48 | 53 | 60 | 61 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_splash_screen.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 23 | 24 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /app/src/main/res/layout/view_issued_book.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 12 | 13 | 14 | 21 | 22 | 28 | 29 | 34 | 35 | 39 | 40 | 41 | 42 | 43 | 51 | 52 | 53 | 54 | 59 | 60 | 65 | 66 | 72 | 73 | 74 | 75 | 76 | 85 | 86 | 91 | 92 | 99 | 100 | 101 | 102 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | -------------------------------------------------------------------------------- /app/src/main/res/layout/view_row_category.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 14 | 15 | 16 | 17 | 26 | 27 | 36 | 37 | 38 | 39 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /app/src/main/res/layout/view_row_search_book.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 14 | 15 | 16 | 23 | 24 | 30 | 31 | 36 | 37 | 41 | 42 | 43 | 44 | 45 | 53 | 54 | 55 | 56 | 61 | 62 | 67 | 68 | 73 | 74 | 75 | 76 | 77 | 86 | 87 | 96 | 97 | 98 | 99 | 100 | 105 | 106 | 111 | 112 | 118 | 119 | 120 | 121 | 130 | 131 | 132 | 133 | 134 | 135 | 140 | 141 | 142 | 143 | 144 | 145 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devarshukani/MyLib-Android/150a385f58adca2e29ca5caf7261ac36813538a5/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devarshukani/MyLib-Android/150a385f58adca2e29ca5caf7261ac36813538a5/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devarshukani/MyLib-Android/150a385f58adca2e29ca5caf7261ac36813538a5/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devarshukani/MyLib-Android/150a385f58adca2e29ca5caf7261ac36813538a5/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devarshukani/MyLib-Android/150a385f58adca2e29ca5caf7261ac36813538a5/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devarshukani/MyLib-Android/150a385f58adca2e29ca5caf7261ac36813538a5/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devarshukani/MyLib-Android/150a385f58adca2e29ca5caf7261ac36813538a5/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devarshukani/MyLib-Android/150a385f58adca2e29ca5caf7261ac36813538a5/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devarshukani/MyLib-Android/150a385f58adca2e29ca5caf7261ac36813538a5/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devarshukani/MyLib-Android/150a385f58adca2e29ca5caf7261ac36813538a5/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devarshukani/MyLib-Android/150a385f58adca2e29ca5caf7261ac36813538a5/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devarshukani/MyLib-Android/150a385f58adca2e29ca5caf7261ac36813538a5/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devarshukani/MyLib-Android/150a385f58adca2e29ca5caf7261ac36813538a5/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devarshukani/MyLib-Android/150a385f58adca2e29ca5caf7261ac36813538a5/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devarshukani/MyLib-Android/150a385f58adca2e29ca5caf7261ac36813538a5/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/values-night-v23/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/values-night/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/values-v23/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | -------------------------------------------------------------------------------- /app/src/main/res/values/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FFFFFF 4 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | MyLib 3 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/values/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/xml/network_security_config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/test/java/com/sem6_project/mylib/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.sem6_project.mylib; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | buildscript { 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | dependencies { 8 | classpath "com.android.tools.build:gradle:4.1.1" 9 | 10 | // NOTE: Do not place your application dependencies here; they belong 11 | // in the individual module build.gradle files 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | google() 18 | jcenter() 19 | } 20 | } 21 | 22 | task clean(type: Delete) { 23 | delete rootProject.buildDir 24 | } -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | # AndroidX package structure to make it clearer which packages are bundled with the 15 | # Android operating system, and which are packaged with your app"s APK 16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 17 | android.useAndroidX=true 18 | # Automatically convert third-party libraries to use AndroidX 19 | android.enableJetifier=true -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devarshukani/MyLib-Android/150a385f58adca2e29ca5caf7261ac36813538a5/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Dec 30 15:12:29 IST 2020 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip 7 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Attempt to set APP_HOME 10 | # Resolve links: $0 may be a link 11 | PRG="$0" 12 | # Need this for relative symlinks. 13 | while [ -h "$PRG" ] ; do 14 | ls=`ls -ld "$PRG"` 15 | link=`expr "$ls" : '.*-> \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS="" 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn () { 37 | echo "$*" 38 | } 39 | 40 | die () { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Escape application args 158 | save () { 159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 160 | echo " " 161 | } 162 | APP_ARGS=$(save "$@") 163 | 164 | # Collect all arguments for the java command, following the shell quoting and substitution rules 165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 166 | 167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong 168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then 169 | cd "$(dirname "$0")" 170 | fi 171 | 172 | exec "$JAVACMD" "$@" 173 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | rootProject.name = "MyLib" --------------------------------------------------------------------------------