├── FoodOrderAPP.iml
├── README.md
├── app
├── .gitignore
├── app.iml
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── cs442
│ │ └── yliu308
│ │ └── foodorderapp
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── cs442
│ │ │ └── yliu308
│ │ │ └── foodorderapp
│ │ │ ├── DetailActivity.java
│ │ │ ├── Item.java
│ │ │ ├── ItemAdapter.java
│ │ │ ├── MenuActivity.java
│ │ │ ├── MenuCartFragment.java
│ │ │ └── MenuListFragment.java
│ └── res
│ │ ├── drawable
│ │ ├── barbecue.png
│ │ ├── default_white.png
│ │ ├── fries.png
│ │ ├── lamb_soup.png
│ │ ├── malatang.png
│ │ ├── noodles.png
│ │ ├── pho.png
│ │ ├── pizza.png
│ │ ├── spicy_fish.png
│ │ ├── spicy_soup.png
│ │ └── taco.png
│ │ ├── layout
│ │ ├── activity_detail.xml
│ │ ├── activity_menu.xml
│ │ ├── button.xml
│ │ ├── fragment_menu_cart.xml
│ │ ├── fragment_menu_item.xml
│ │ └── fragment_menu_list.xml
│ │ ├── mipmap-hdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-mdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ └── values
│ │ ├── colors.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── test
│ └── java
│ └── com
│ └── cs442
│ └── yliu308
│ └── foodorderapp
│ └── ExampleUnitTest.java
├── build.gradle
├── build
├── android-profile
│ ├── profile-2017-09-24-06-48-34-880.rawproto
│ ├── profile-2017-09-24-06-48-47-845.rawproto
│ ├── profile-2017-09-24-06-49-13-368.rawproto
│ ├── profile-2017-09-24-06-49-54-061.rawproto
│ ├── profile-2017-09-24-06-59-36-251.rawproto
│ ├── profile-2017-09-24-07-02-28-425.rawproto
│ ├── profile-2017-09-24-07-03-07-243.rawproto
│ ├── profile-2017-09-24-07-03-39-413.rawproto
│ ├── profile-2017-09-24-07-04-03-062.rawproto
│ ├── profile-2017-09-24-07-04-43-206.rawproto
│ ├── profile-2017-09-24-18-42-20-690.rawproto
│ ├── profile-2017-09-24-18-54-37-620.rawproto
│ ├── profile-2017-09-24-18-55-33-747.rawproto
│ ├── profile-2017-09-24-18-55-52-230.rawproto
│ ├── profile-2017-09-24-18-59-30-514.rawproto
│ ├── profile-2017-09-24-19-06-29-868.rawproto
│ ├── profile-2017-09-24-19-08-06-174.rawproto
│ ├── profile-2017-09-24-19-17-46-955.rawproto
│ ├── profile-2017-09-24-19-18-08-040.rawproto
│ ├── profile-2017-09-24-19-18-27-453.rawproto
│ ├── profile-2017-09-24-19-19-18-740.rawproto
│ ├── profile-2017-09-24-19-23-06-650.rawproto
│ ├── profile-2017-09-24-19-26-35-672.rawproto
│ ├── profile-2017-09-24-19-29-28-925.rawproto
│ ├── profile-2017-09-24-19-45-02-320.rawproto
│ └── profile-2017-09-24-19-45-26-157.rawproto
├── generated
│ └── mockable-android-26.jar
└── intermediates
│ └── dex-cache
│ └── cache.xml
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── local.properties
└── settings.gradle
/FoodOrderAPP.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Android-Library-Management-System
2 | This is a library management system based on Android platform. All features implemented for two users, normal user and admin.
3 |
4 | General Description/ Feature
5 | 1. Two roles implemented in this app, user and admin.
6 | 2. Admin can add new books to the library (such as: book id, book name, book author, book category, book status(0:book unavailable, 1:book available), book sector(indicate the sector where this book located) and choose book cover for this book).
7 | 3. Admin can view all the books currently available in the library and manage books, edit book information and delete book.
8 | 4. Admin can manage user. Admin can view all the users currently in the library system, its id, password and type, also delete users in the system.
9 | 5. Admin will handle book return. Admin can use the return book button in main screen to initialize the camera and scan barcode to return this book back to library.
10 | 6. User can view all books in the library, click the book item to enter the detail page of this book.
11 | 7. User can rate this book by star rating bar and leave comment, also, user can issue this book by himself by clicking borrow button on detail page to initialize phone camera, scan book barcode and issue the book.
12 | 8. User can search the book he wants by typing in book id and click search button, the search result will show below.
13 | 9. First, under manage account function. User can view all the book he currently borrowed, book name, due date for return and pending current pending fine.
14 | 10. Second, under manage account function. User can change its account password by authenticate old password and twice-input of new password. If the old password does not match from database or two new password does not match, password change will fail.
15 |
16 | User Guide
17 |
18 | Prerequisite
19 | 1. When first enter the app, click into admin login page and click “create” below to create new admin account to proceed the following operations. Type in initial id and password, set user type as “admin”.
20 | 2. Second, you need to add books into database first to use and test the function. Book id should be the number of barcode.
21 |
22 | User
23 | 1. User can login with a given account, with initial id and password, and will required to change password the first time login.
24 | 2. In user main screen, there are three buttons, “Book list”, “Search” and “Manage account”. Under “Manage account activity”, there are two functions, “My book” and “Change password”.
25 | 3. In book list activity, user can view all the books currently in the library with its id, name, author and category. User can click the book he/she interested in and view the detail information about this book.
26 | 4. In the detail screen, user can rate this book using star rating bar and leave a comment below and submit.
27 | 5. User can borrow this book by clicking “Borrow” button on the detail page of the book, this’ll initiate the camera on the phone, user will have to scan the book barcode and click “Borrow”. By doing this, user have been issued the book successfully.
28 | 6. The book id is the number of barcode, use barcode number to generate barcode online and then use scan function.
29 | 7. In the Search function, user can search for a book by its id or name. The search result will show as a listview below, and user can click the search result and enter the screen of detail of the book and do the same operations as described in 4 and 5.
30 | 8. First, under manage account function. User can view all the books he/she borrowed, including book name, due date and pending fine of this book.
31 | 9. Second, under manage account function. User can change its own password, and will be required to enter old password, if old password is not matched from database or reentered new password does not match the new password, password changing will not success.
32 |
33 | Admin
34 | 1. Use admin account to login the admin main screen.
35 | 2. In admin main screen, there are four buttons, “Add book”, “Manage book”, “Manage user” and “Return book”.
36 | 3. Click “Add book” to add new books into bookDB.db database, book table. You need to add book ID(which will be the number of barcode), book name, book author, book category, book status(which marks if the book is available in the library or not, 0 marks unavailable, 1 marks available), book sector(in which location the book is, number from 1-9), and select a picture from gallery as book cover. Click “Submit” to save book information.
37 | 4. After adding book into table. In manage book screen, admin can see all books currently in the library, modify and delete basic information, book name, book author and book category.
38 | 5. In manage user screen, admin can add and delete user, both type user and admin, into user table. Normal user cannot create account, admin will create user account and assign account to individual user, user will have to change its password the first time he/she login.
39 | 6. In return book activity, admin will use camera to scan book barcode and choose “Return” after scan result shows, then the book will be returned.
40 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/app.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | generateDebugSources
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 26
5 | buildToolsVersion "26.0.1"
6 |
7 | aaptOptions {
8 | cruncherEnabled = false
9 | useNewCruncher = false
10 | }
11 |
12 | defaultConfig {
13 | applicationId "com.cs442.yliu308.foodorderapp"
14 | minSdkVersion 26
15 | targetSdkVersion 26
16 | versionCode 1
17 | versionName "1.0"
18 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
19 | }
20 | buildTypes {
21 | release {
22 | minifyEnabled false
23 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
24 | }
25 | }
26 | }
27 |
28 | dependencies {
29 | compile fileTree(dir: 'libs', include: ['*.jar'])
30 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
31 | exclude group: 'com.android.support', module: 'support-annotations'
32 | })
33 | compile 'com.android.support:appcompat-v7:26.+'
34 | compile 'com.android.support.constraint:constraint-layout:1.0.2'
35 | testCompile 'junit:junit:4.12'
36 | }
37 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /Users/liuyi/Library/Android/sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
19 | # Uncomment this to preserve the line number information for
20 | # debugging stack traces.
21 | #-keepattributes SourceFile,LineNumberTable
22 |
23 | # If you keep the line number information, uncomment this to
24 | # hide the original source file name.
25 | #-renamesourcefileattribute SourceFile
26 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/cs442/yliu308/foodorderapp/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.cs442.yliu308.foodorderapp;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumentation test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.cs442.yliu308.foodorderapp", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/app/src/main/java/com/cs442/yliu308/foodorderapp/DetailActivity.java:
--------------------------------------------------------------------------------
1 | package com.cs442.yliu308.foodorderapp;
2 |
3 | import android.app.Activity;
4 | import android.content.Intent;
5 | import android.content.SharedPreferences;
6 | import android.os.Bundle;
7 | import android.view.View;
8 | import android.view.View.OnClickListener;
9 | import android.widget.Button;
10 | import android.widget.EditText;
11 | import android.widget.ImageView;
12 | import android.widget.TextView;
13 | import android.widget.Toast;
14 |
15 | import java.util.Arrays;
16 | import java.util.List;
17 |
18 | public class DetailActivity extends Activity {
19 | public static int[] imgArr = { //pic src
20 | R.drawable.barbecue,
21 | R.drawable.fries,
22 | R.drawable.lamb_soup,
23 | R.drawable.malatang,
24 | R.drawable.noodles,
25 | R.drawable.pho,
26 | R.drawable.pizza,
27 | R.drawable.spicy_fish,
28 | R.drawable.spicy_soup,
29 | R.drawable.taco
30 | };
31 |
32 | private SharedPreferences sp;
33 |
34 | private Intent intent;
35 | private OnClickListener clickHandler;
36 |
37 | private TextView mItemName;
38 | private ImageView mItemImg;
39 | private TextView mItemDescription;
40 | private EditText mItemOrdNum;
41 | private Button btnDetaiOrder;
42 | private Button btnDetailReset;
43 |
44 | private Item item;
45 |
46 | @Override
47 | protected void onCreate(Bundle savedInstanceState) {
48 | super.onCreate(savedInstanceState);
49 | setContentView(R.layout.activity_detail);
50 |
51 | intent = getIntent();
52 |
53 | intiDisplay();
54 |
55 | mItemName.setText(item.strItemName);
56 | mItemImg.setImageResource(R.drawable.barbecue);//item.iItemImgId);
57 | mItemImg.setImageResource(intent.getIntExtra("iItemImgId", R.drawable.default_white));
58 |
59 | btnDetaiOrder.setOnClickListener(clickHandler);
60 | btnDetailReset.setOnClickListener(clickHandler);
61 |
62 | mItemOrdNum.setText("1");
63 | }
64 |
65 | private void intiDisplay(){
66 | item = new Item(intent.getIntExtra("iItemSeqNum", 0),
67 | intent.getStringExtra("strItemName"),
68 | intent.getDoubleExtra("dItemPrice", 0),
69 | intent.getIntExtra("iItemOrdNumber", 0),
70 | intent.getIntExtra("iItemImgId", R.drawable.default_white));
71 |
72 | mItemName = (TextView)findViewById(R.id.detail_item_name);
73 | mItemImg = (ImageView)findViewById(R.id.detail_item_img);
74 | mItemDescription = (TextView)findViewById(R.id.detail_item_description);
75 | mItemOrdNum = (EditText)findViewById(R.id.detail_item_ord_number);
76 | btnDetaiOrder = (Button)findViewById(R.id.detail_order);
77 | btnDetailReset = (Button)findViewById(R.id.detail_reset);
78 |
79 | clickHandler = new OnClickListener() {
80 | @Override
81 | public void onClick(View view) {
82 | switch (view.getId()){
83 | case R.id.detail_reset:
84 | {
85 | resetOrderListDetail();
86 | onBackPressed();
87 | }
88 | break;
89 | case R.id.detail_order:
90 | {
91 | if(orderThisItemDetail(item, Integer.parseInt(mItemOrdNum.getText().toString()))) {
92 | onBackPressed();
93 | }
94 | }
95 | break;
96 | default:
97 | break;
98 | }
99 | }
100 | };
101 | }
102 |
103 | public void resetMenuList(){
104 | MenuListFragment.itemList.clear();
105 | for(int i = 0; i < 10; i++){
106 | Item item = new Item(i + 1,"Food #" + Integer.toString(i + 1), 10.0 * (i + 1), 0, imgArr[i]);
107 | MenuListFragment.itemList.add(item);
108 | }
109 | saveToSharedPreference("itemList",MenuListFragment.itemList);
110 | }
111 |
112 | public void saveToSharedPreference(String key, List- list){
113 | int[] itemNum = new int[list.size()];
114 | for(int i = 0; i < list.size(); i++){
115 | itemNum[i] = list.get(i).iItemOrdNum;
116 | }
117 | StringBuffer sb = new StringBuffer();
118 | for(int i : itemNum){
119 | sb.append(i);
120 | sb.append('-');
121 | }
122 | sp = this.getSharedPreferences("sharedPreference", MODE_PRIVATE);
123 | sp.edit().putString(key,sb.toString()).commit();
124 | }
125 |
126 | private void resetOrderListDetail(){
127 | //reset pane 1
128 | resetMenuList();
129 | //reset pane 2
130 | MenuCartFragment.itemOrderedList.clear();
131 | }
132 |
133 | private boolean orderThisItemDetail(Item item, int iItemNum){
134 | //
135 | if(iItemNum > 10000){
136 | Toast.makeText(this,"The number should be no more than 10000",Toast.LENGTH_SHORT).show();
137 | return false;
138 | }
139 | //update pane 1
140 | for(Item tmpItem : MenuListFragment.itemList){
141 | if(item.strItemName.equals(tmpItem.strItemName)){
142 | int index = MenuListFragment.itemList.indexOf(tmpItem);
143 | MenuListFragment.itemList.remove(tmpItem);
144 | if(tmpItem.iItemOrdNum + iItemNum > 10000){
145 | Toast.makeText(this,"The number should be no more than 10000",Toast.LENGTH_SHORT).show();
146 | return false;
147 | }
148 | tmpItem.setItemOrdNum(tmpItem.iItemOrdNum + iItemNum);
149 | MenuListFragment.itemList.add(index,tmpItem);
150 |
151 | saveToSharedPreference("itemList",MenuListFragment.itemList);
152 | break;
153 | }
154 | }
155 | //update pane 2
156 | for(Item tmpItem : MenuCartFragment.itemOrderedList){
157 | if(item.strItemName.equals(tmpItem.strItemName)){
158 | MenuCartFragment.itemOrderedList.remove(tmpItem);
159 | if(tmpItem.iItemOrdNum + iItemNum > 10000){
160 | Toast.makeText(this,"The number should be no more than 10000",Toast.LENGTH_SHORT).show();
161 | return false;
162 | }
163 | tmpItem.setItemOrdNum(tmpItem.iItemOrdNum + iItemNum);
164 | MenuCartFragment.itemOrderedList.add(0,tmpItem);
165 | return true;
166 | }
167 | }
168 | item.setItemOrdNum(iItemNum);
169 | MenuCartFragment.itemOrderedList.add(0,item);
170 | return true;
171 | }
172 | }
173 |
--------------------------------------------------------------------------------
/app/src/main/java/com/cs442/yliu308/foodorderapp/Item.java:
--------------------------------------------------------------------------------
1 | package com.cs442.yliu308.foodorderapp;
2 |
3 | /**
4 | * Created by liuyi on 9/23/17.
5 | */
6 |
7 | public class Item {
8 | public int iItemSeqNum;
9 | public String strItemName;
10 | public double dItemPrice;
11 | public int iItemOrdNum;
12 | public int iItemImgId;
13 |
14 | public Item(int iItemSeqNum, String strItemName, double dItemPrice, int iItemOrdNum, int iItemImgId){
15 | this.iItemSeqNum = iItemSeqNum;
16 | this.strItemName = strItemName;
17 | this.dItemPrice = dItemPrice;
18 | this.iItemOrdNum = iItemOrdNum;
19 | this.iItemImgId = iItemImgId;
20 | }
21 |
22 | public void setItemOrdNum(int iItemOrdNum){
23 | this.iItemOrdNum = iItemOrdNum;
24 | }
25 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/cs442/yliu308/foodorderapp/ItemAdapter.java:
--------------------------------------------------------------------------------
1 | package com.cs442.yliu308.foodorderapp;
2 |
3 | import android.content.Context;
4 | import android.content.SharedPreferences;
5 | import android.graphics.Color;
6 | import android.view.LayoutInflater;
7 | import android.view.View;
8 | import android.view.ViewGroup;
9 | import android.widget.ArrayAdapter;
10 | import android.widget.TextView;
11 |
12 | import java.util.List;
13 |
14 | /**
15 | * Created by liuyi on 9/24/17.
16 | */
17 |
18 | public class ItemAdapter extends ArrayAdapter
- {
19 | private int resource;
20 | private boolean bIsMenuList;
21 |
22 | public ItemAdapter(Context context, int resource, List
- objects, boolean bIsMenuList) {
23 | super(context, resource, objects);
24 | // TODO Auto-generated constructor stub
25 | this.resource = resource;//resource为listView的每个子项的布局id
26 | this.bIsMenuList = bIsMenuList;
27 | }
28 |
29 | @Override
30 | public View getView(int position, View view, ViewGroup parent) {
31 | // TODO Auto-generated method stub
32 |
33 | final Item item = getItem(position);
34 | ViewHolder viewHolder;
35 | if(view == null){
36 | view = LayoutInflater.from(getContext()).inflate(resource, null);
37 | viewHolder = new ViewHolder();
38 | viewHolder.itemSeqNum = (TextView) view.findViewById(R.id.item_seq_number);
39 | viewHolder.itemName =(TextView) view.findViewById(R.id.item_name);
40 | viewHolder.itemPrice =(TextView) view.findViewById(R.id.item_price);
41 | viewHolder.itemOrdNum = (TextView) view.findViewById(R.id.item_ord_number);
42 | view.setTag(viewHolder);
43 | }else {
44 | viewHolder = (ViewHolder) view.getTag();
45 | }
46 | viewHolder.itemSeqNum.setText(Integer.toString(item.iItemSeqNum));
47 | viewHolder.itemName.setText(item.strItemName);
48 | viewHolder.itemPrice.setText(Double.toString(item.dItemPrice));
49 | viewHolder.itemOrdNum.setText(Integer.toString(item.iItemOrdNum));
50 |
51 | if(bIsMenuList){
52 | if(0 != item.iItemOrdNum){
53 | viewHolder.itemOrdNum.setBackgroundColor(Color.parseColor("#FF99FF"));
54 | }
55 | else{
56 | viewHolder.itemOrdNum.setBackgroundColor(Color.parseColor("#FFFFFF"));
57 | }
58 | }
59 |
60 | return view;
61 |
62 | }
63 | class ViewHolder{
64 | TextView itemSeqNum;
65 | TextView itemName;
66 | TextView itemPrice;
67 | TextView itemOrdNum;
68 | }
69 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/cs442/yliu308/foodorderapp/MenuActivity.java:
--------------------------------------------------------------------------------
1 | package com.cs442.yliu308.foodorderapp;
2 |
3 | import android.app.Fragment;
4 | import android.app.FragmentManager;
5 | import android.app.FragmentTransaction;
6 | import android.support.v4.app.FragmentActivity;
7 | import android.support.v7.app.AppCompatActivity;
8 | import android.os.Bundle;
9 | import android.view.Window;
10 |
11 | public class MenuActivity extends FragmentActivity {
12 |
13 | @Override
14 | protected void onCreate(Bundle savedInstanceState) {
15 | super.onCreate(savedInstanceState);
16 | requestWindowFeature(Window.FEATURE_NO_TITLE);
17 | setContentView(R.layout.activity_menu);
18 |
19 | FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction();
20 | fragmentTransaction.add(R.id.id_fragment_list, new MenuListFragment());
21 | fragmentTransaction.commit();
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/app/src/main/java/com/cs442/yliu308/foodorderapp/MenuCartFragment.java:
--------------------------------------------------------------------------------
1 | package com.cs442.yliu308.foodorderapp;
2 |
3 | import android.app.Fragment;
4 | import android.app.FragmentTransaction;
5 | import android.content.SharedPreferences;
6 | import android.view.View;
7 | import android.view.View.OnClickListener;
8 | import android.os.Bundle;
9 | import android.view.LayoutInflater;
10 | import android.view.ViewGroup;
11 | import android.widget.Button;
12 | import android.widget.ListView;
13 | import android.widget.TextView;
14 | import android.widget.Toast;
15 |
16 | import java.util.ArrayList;
17 | import java.util.List;
18 |
19 | import static android.content.Context.MODE_PRIVATE;
20 |
21 | /**
22 | * Created by liuyi on 9/23/17.
23 | */
24 |
25 | public class MenuCartFragment extends Fragment{
26 | SharedPreferences sp;
27 |
28 | private int iTotalValue;
29 | private OnClickListener clickHandler;
30 |
31 | private ItemAdapter mCartAdapter = null;
32 | public static List
- itemOrderedList;
33 | private TextView cartTotalPrice;
34 | private ListView cartListView;
35 | private Button btnCartOrder;
36 | private Button btnCartReset;
37 |
38 |
39 | @Override
40 | public View onCreateView(LayoutInflater inflater, ViewGroup container,
41 | Bundle savedInstanceState) {
42 | sp = this.getActivity().getSharedPreferences("sharedPreference", MODE_PRIVATE);
43 |
44 | initOrderedList();
45 | View v = inflater.inflate(R.layout.fragment_menu_cart,null);
46 |
47 | cartTotalPrice = (TextView) v.findViewById(R.id.cart_total_price);
48 | cartTotalPrice.setText(Integer.toString(iTotalValue));
49 |
50 | cartListView = (ListView) v.findViewById(R.id.cart_list);
51 | mCartAdapter = new ItemAdapter(getActivity(), R.layout.fragment_menu_item, itemOrderedList, false);
52 | cartListView.setAdapter(mCartAdapter);
53 |
54 | intiDisplay(v);
55 | btnCartOrder.setOnClickListener(clickHandler);
56 | btnCartReset.setOnClickListener(clickHandler);
57 |
58 | return v;
59 | }
60 |
61 | public void initOrderedList(){
62 | itemOrderedList = new ArrayList
- ();
63 |
64 | int[] tmpArray = parseFromSharePreference(sp);
65 | if(null != tmpArray) {
66 | for (int i = 0; i < 10; i++) {
67 | if(0 != tmpArray[i]){
68 | Item item = new Item(i + 1, "Item #" + Integer.toString(i + 1), 10.0 * (i + 1), tmpArray[i], DetailActivity.imgArr[i]);
69 | itemOrderedList.add(item);
70 | }
71 | }
72 | }
73 | //for(Item item : MenuListFragment.itemList){
74 | // if(0 != item.iItemOrdNum){
75 | // itemOrderedList.add(item);
76 | // }
77 | //}
78 | getTotalValue();
79 | }
80 |
81 | public void getTotalValue(){
82 | iTotalValue = 0;
83 | for(Item item : itemOrderedList){
84 | iTotalValue += item.iItemOrdNum * item.dItemPrice;
85 | }
86 | }
87 |
88 | private void intiDisplay(View v){
89 | btnCartOrder = (Button)v.findViewById(R.id.cart_order);
90 | btnCartReset = (Button)v.findViewById(R.id.cart_reset);
91 |
92 | clickHandler = new OnClickListener() {
93 | @Override
94 | public void onClick(View view) {
95 | switch (view.getId()){
96 | case R.id.cart_reset:
97 | {
98 | resetOrderListCart();
99 | }
100 | break;
101 | case R.id.cart_order:
102 | {
103 | orderThisItemCart();
104 | }
105 | break;
106 | default:
107 | break;
108 | }
109 | }
110 | };
111 | }
112 |
113 | private void resetOrderListCart(){
114 | MenuListFragment.itemList.clear();
115 | for (int i = 0; i < 10; i++) {
116 | Item item = new Item(i + 1, "Item #" + Integer.toString(i + 1), 10.0 * (i + 1), 0, DetailActivity.imgArr[i]);
117 | MenuListFragment.itemList.add(item);
118 | }
119 | saveToSharedPreference("itemList",MenuListFragment.itemList);
120 |
121 |
122 | FragmentTransaction fragmentTransaction = getActivity().getFragmentManager().beginTransaction();
123 | fragmentTransaction.replace(R.id.id_fragment_list, new MenuListFragment());
124 | fragmentTransaction.commit();
125 |
126 | itemOrderedList.clear();
127 | mCartAdapter.notifyDataSetChanged();
128 | getTotalValue();
129 | cartTotalPrice.setText(Integer.toString(iTotalValue));
130 | }
131 |
132 | public void saveToSharedPreference(String key,List
- list){
133 | int[] itemNum = new int[list.size()];
134 | for(int i = 0; i < list.size(); i++){
135 | itemNum[i] = list.get(i).iItemOrdNum;
136 | }
137 |
138 | StringBuffer sb = new StringBuffer();
139 | for(int i : itemNum){
140 | sb.append(i);
141 | sb.append('-');
142 | }
143 |
144 | //sp = this.getActivity().getSharedPreferences("sharedPreference", MODE_PRIVATE);
145 | sp.edit().putString(key,sb.toString()).commit();
146 | }
147 |
148 | public int[] parseFromSharePreference(SharedPreferences sp){
149 | String strTmp = sp.getString("itemList", null);
150 | if(null == strTmp)return null;
151 |
152 | String[] tmpStrArray = strTmp.split("-");
153 |
154 | int[] array = new int[tmpStrArray.length];
155 | for(int i = 0; i < array.length; i++){
156 | array[i] = Integer.parseInt(tmpStrArray[i]);
157 | }
158 | return array;
159 | }
160 |
161 | private void resetToInit(){
162 | resetOrderListCart();
163 | }
164 |
165 | private void orderThisItemCart(){
166 | Toast.makeText(getActivity(),
167 | "Your order has been placed, total price is $" + Integer.toString(iTotalValue),
168 | Toast.LENGTH_SHORT).show();
169 | resetToInit();
170 | }
171 |
172 | @Override
173 | public void onResume(){
174 | super.onResume();
175 | mCartAdapter.notifyDataSetChanged();
176 |
177 | getTotalValue();
178 | cartTotalPrice.setText(Integer.toString(iTotalValue));
179 | }
180 |
181 | }
182 |
--------------------------------------------------------------------------------
/app/src/main/java/com/cs442/yliu308/foodorderapp/MenuListFragment.java:
--------------------------------------------------------------------------------
1 | package com.cs442.yliu308.foodorderapp;
2 |
3 | /**
4 | * Created by liuyi on 9/23/17.
5 | */
6 |
7 | import java.io.Serializable;
8 | import java.util.ArrayList;
9 | import java.util.Arrays;
10 | import java.util.List;
11 |
12 | import android.app.FragmentManager;
13 | import android.content.Intent;
14 | import android.app.Fragment;
15 | //import android.support.v4.app.Fragment;//不知为什么要加这个?
16 | import android.content.SharedPreferences;
17 | import android.content.SharedPreferences.Editor;
18 | import android.os.Bundle;
19 | import android.view.LayoutInflater;
20 | import android.view.View;
21 | import android.view.ViewGroup;
22 | import android.widget.AdapterView;
23 | import android.widget.AdapterView.OnItemClickListener;
24 | import android.widget.ListView;
25 |
26 | import static android.content.Context.MODE_PRIVATE;
27 |
28 | public class MenuListFragment extends Fragment {
29 | private SharedPreferences sp;
30 |
31 | private ItemAdapter mListMenuAdapter = null;
32 | public static List
- itemList;
33 | private ListView menuListView;
34 |
35 |
36 | @Override
37 | public void onCreate(Bundle savedInstanceState) {
38 | super.onCreate(savedInstanceState);
39 | }
40 |
41 | @Override
42 | public View onCreateView(LayoutInflater inflater, ViewGroup container,
43 | Bundle savedInstanceState) {
44 | sp = this.getActivity().getSharedPreferences("sharedPreference", MODE_PRIVATE);
45 |
46 | initItemList();
47 |
48 | View v = inflater.inflate(R.layout.fragment_menu_list,null);
49 |
50 | menuListView = (ListView) v.findViewById(R.id.menu_list);
51 | mListMenuAdapter = new ItemAdapter(getActivity(), R.layout.fragment_menu_item, itemList, true);
52 | menuListView.setAdapter(mListMenuAdapter);
53 |
54 | menuListView.setOnItemClickListener(new OnItemClickListener(){
55 | public void onItemClick (AdapterView> arg0, View arg1, int arg2, long arg3){
56 | Item item = mListMenuAdapter.getItem(arg2);
57 |
58 | if(null == item) return;
59 |
60 | Intent intent = new Intent(getActivity(), DetailActivity.class);
61 | intent.putExtra("iItemSeqNum", item.iItemSeqNum);
62 | intent.putExtra("strItemName", item.strItemName);
63 | intent.putExtra("dItemPrice", item.dItemPrice);
64 | intent.putExtra("iItemOrdNumber", item.iItemOrdNum);
65 | intent.putExtra("iItemImgId", item.iItemImgId);
66 |
67 | //intent.putExtra("itemOrderedList", (Serializable)MenuCartFragment.itemOrderedList);
68 |
69 | startActivity(intent);
70 | }
71 |
72 | });
73 |
74 | return v;
75 | }
76 |
77 | public void initItemList(){
78 | itemList = new ArrayList
- ();
79 | int[] tmpArray = parseFromSharePreference(sp);
80 | if(null != tmpArray) {
81 | for (int i = 0; i < 10; i++) {
82 | Item item = new Item(i + 1, "Food #" + Integer.toString(i + 1), 10.0 * (i + 1), tmpArray[i], DetailActivity.imgArr[i]);
83 | itemList.add(item);
84 | }
85 | } else {
86 | for (int i = 0; i < 10; i++) {
87 | Item item = new Item(i + 1, "Food #" + Integer.toString(i + 1), 10.0 * (i + 1), 0, DetailActivity.imgArr[i]);
88 | itemList.add(item);
89 | }
90 | saveToSharedPreference(itemList);
91 | }
92 | //item = new Item(2,"Item 2", 10.0, 0);
93 | //itemList.add(item);
94 | }
95 |
96 | @Override
97 | public void onResume(){
98 | super.onResume();
99 | mListMenuAdapter.notifyDataSetChanged();
100 | saveToSharedPreference(itemList);
101 | }
102 |
103 | public int[] parseFromSharePreference(SharedPreferences sp){
104 | String strTmp = sp.getString("itemList", null);
105 | if(null == strTmp)return null;
106 |
107 | String[] tmpStrArray = strTmp.split("-");
108 |
109 | int[] array = new int[tmpStrArray.length];
110 | for(int i = 0; i < array.length; i++){
111 | array[i] = Integer.parseInt(tmpStrArray[i]);
112 | }
113 | return array;
114 | }
115 |
116 | public void saveToSharedPreference(List
- itemList){
117 | int[] itemNum = new int[itemList.size()];
118 | for(int i = 0; i < itemList.size(); i++){
119 | itemNum[i] = itemList.get(i).iItemOrdNum;
120 | }
121 |
122 | StringBuffer sb = new StringBuffer();
123 | for(int i : itemNum){
124 | sb.append(i);
125 | sb.append('-');
126 | }
127 |
128 | //sp = this.getActivity().getSharedPreferences("sharedPreference", MODE_PRIVATE);
129 | sp.edit().putString("itemList",sb.toString()).commit();
130 | }
131 | }
132 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/barbecue.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yiiiiil-fx717/Android-Library-Management-System/68afa42673a6c8647dab6e3196560264a1307afb/app/src/main/res/drawable/barbecue.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/default_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yiiiiil-fx717/Android-Library-Management-System/68afa42673a6c8647dab6e3196560264a1307afb/app/src/main/res/drawable/default_white.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/fries.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yiiiiil-fx717/Android-Library-Management-System/68afa42673a6c8647dab6e3196560264a1307afb/app/src/main/res/drawable/fries.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/lamb_soup.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yiiiiil-fx717/Android-Library-Management-System/68afa42673a6c8647dab6e3196560264a1307afb/app/src/main/res/drawable/lamb_soup.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/malatang.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yiiiiil-fx717/Android-Library-Management-System/68afa42673a6c8647dab6e3196560264a1307afb/app/src/main/res/drawable/malatang.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/noodles.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yiiiiil-fx717/Android-Library-Management-System/68afa42673a6c8647dab6e3196560264a1307afb/app/src/main/res/drawable/noodles.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/pho.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yiiiiil-fx717/Android-Library-Management-System/68afa42673a6c8647dab6e3196560264a1307afb/app/src/main/res/drawable/pho.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/pizza.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yiiiiil-fx717/Android-Library-Management-System/68afa42673a6c8647dab6e3196560264a1307afb/app/src/main/res/drawable/pizza.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/spicy_fish.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yiiiiil-fx717/Android-Library-Management-System/68afa42673a6c8647dab6e3196560264a1307afb/app/src/main/res/drawable/spicy_fish.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/spicy_soup.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yiiiiil-fx717/Android-Library-Management-System/68afa42673a6c8647dab6e3196560264a1307afb/app/src/main/res/drawable/spicy_soup.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/taco.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yiiiiil-fx717/Android-Library-Management-System/68afa42673a6c8647dab6e3196560264a1307afb/app/src/main/res/drawable/taco.png
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_detail.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
15 |
16 |
22 |
23 |
28 |
29 |
36 |
37 |
42 |
48 |
51 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
15 |
16 |
23 |
24 |
30 |
31 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/button.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
13 |
14 |
21 |
22 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_menu_cart.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
10 |
11 |
15 |
16 |
20 |
21 |
26 |
27 |
28 |
32 |
33 |
38 |
44 |
47 |
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_menu_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
13 |
18 |
19 |
24 |
25 |
30 |
31 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_menu_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
12 |
13 |
18 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yiiiiil-fx717/Android-Library-Management-System/68afa42673a6c8647dab6e3196560264a1307afb/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yiiiiil-fx717/Android-Library-Management-System/68afa42673a6c8647dab6e3196560264a1307afb/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yiiiiil-fx717/Android-Library-Management-System/68afa42673a6c8647dab6e3196560264a1307afb/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yiiiiil-fx717/Android-Library-Management-System/68afa42673a6c8647dab6e3196560264a1307afb/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yiiiiil-fx717/Android-Library-Management-System/68afa42673a6c8647dab6e3196560264a1307afb/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yiiiiil-fx717/Android-Library-Management-System/68afa42673a6c8647dab6e3196560264a1307afb/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yiiiiil-fx717/Android-Library-Management-System/68afa42673a6c8647dab6e3196560264a1307afb/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yiiiiil-fx717/Android-Library-Management-System/68afa42673a6c8647dab6e3196560264a1307afb/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yiiiiil-fx717/Android-Library-Management-System/68afa42673a6c8647dab6e3196560264a1307afb/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yiiiiil-fx717/Android-Library-Management-System/68afa42673a6c8647dab6e3196560264a1307afb/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | FoodOrderAPP
3 |
4 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/test/java/com/cs442/yliu308/foodorderapp/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.cs442.yliu308.foodorderapp;
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() throws Exception {
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 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:2.3.3'
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 | jcenter()
18 | }
19 | }
20 |
21 | task clean(type: Delete) {
22 | delete rootProject.buildDir
23 | }
24 |
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-09-24-06-48-34-880.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yiiiiil-fx717/Android-Library-Management-System/68afa42673a6c8647dab6e3196560264a1307afb/build/android-profile/profile-2017-09-24-06-48-34-880.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-09-24-06-48-47-845.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yiiiiil-fx717/Android-Library-Management-System/68afa42673a6c8647dab6e3196560264a1307afb/build/android-profile/profile-2017-09-24-06-48-47-845.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-09-24-06-49-13-368.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yiiiiil-fx717/Android-Library-Management-System/68afa42673a6c8647dab6e3196560264a1307afb/build/android-profile/profile-2017-09-24-06-49-13-368.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-09-24-06-49-54-061.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yiiiiil-fx717/Android-Library-Management-System/68afa42673a6c8647dab6e3196560264a1307afb/build/android-profile/profile-2017-09-24-06-49-54-061.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-09-24-06-59-36-251.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yiiiiil-fx717/Android-Library-Management-System/68afa42673a6c8647dab6e3196560264a1307afb/build/android-profile/profile-2017-09-24-06-59-36-251.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-09-24-07-02-28-425.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yiiiiil-fx717/Android-Library-Management-System/68afa42673a6c8647dab6e3196560264a1307afb/build/android-profile/profile-2017-09-24-07-02-28-425.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-09-24-07-03-07-243.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yiiiiil-fx717/Android-Library-Management-System/68afa42673a6c8647dab6e3196560264a1307afb/build/android-profile/profile-2017-09-24-07-03-07-243.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-09-24-07-03-39-413.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yiiiiil-fx717/Android-Library-Management-System/68afa42673a6c8647dab6e3196560264a1307afb/build/android-profile/profile-2017-09-24-07-03-39-413.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-09-24-07-04-03-062.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yiiiiil-fx717/Android-Library-Management-System/68afa42673a6c8647dab6e3196560264a1307afb/build/android-profile/profile-2017-09-24-07-04-03-062.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-09-24-07-04-43-206.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yiiiiil-fx717/Android-Library-Management-System/68afa42673a6c8647dab6e3196560264a1307afb/build/android-profile/profile-2017-09-24-07-04-43-206.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-09-24-18-42-20-690.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yiiiiil-fx717/Android-Library-Management-System/68afa42673a6c8647dab6e3196560264a1307afb/build/android-profile/profile-2017-09-24-18-42-20-690.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-09-24-18-54-37-620.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yiiiiil-fx717/Android-Library-Management-System/68afa42673a6c8647dab6e3196560264a1307afb/build/android-profile/profile-2017-09-24-18-54-37-620.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-09-24-18-55-33-747.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yiiiiil-fx717/Android-Library-Management-System/68afa42673a6c8647dab6e3196560264a1307afb/build/android-profile/profile-2017-09-24-18-55-33-747.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-09-24-18-55-52-230.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yiiiiil-fx717/Android-Library-Management-System/68afa42673a6c8647dab6e3196560264a1307afb/build/android-profile/profile-2017-09-24-18-55-52-230.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-09-24-18-59-30-514.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yiiiiil-fx717/Android-Library-Management-System/68afa42673a6c8647dab6e3196560264a1307afb/build/android-profile/profile-2017-09-24-18-59-30-514.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-09-24-19-06-29-868.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yiiiiil-fx717/Android-Library-Management-System/68afa42673a6c8647dab6e3196560264a1307afb/build/android-profile/profile-2017-09-24-19-06-29-868.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-09-24-19-08-06-174.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yiiiiil-fx717/Android-Library-Management-System/68afa42673a6c8647dab6e3196560264a1307afb/build/android-profile/profile-2017-09-24-19-08-06-174.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-09-24-19-17-46-955.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yiiiiil-fx717/Android-Library-Management-System/68afa42673a6c8647dab6e3196560264a1307afb/build/android-profile/profile-2017-09-24-19-17-46-955.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-09-24-19-18-08-040.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yiiiiil-fx717/Android-Library-Management-System/68afa42673a6c8647dab6e3196560264a1307afb/build/android-profile/profile-2017-09-24-19-18-08-040.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-09-24-19-18-27-453.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yiiiiil-fx717/Android-Library-Management-System/68afa42673a6c8647dab6e3196560264a1307afb/build/android-profile/profile-2017-09-24-19-18-27-453.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-09-24-19-19-18-740.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yiiiiil-fx717/Android-Library-Management-System/68afa42673a6c8647dab6e3196560264a1307afb/build/android-profile/profile-2017-09-24-19-19-18-740.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-09-24-19-23-06-650.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yiiiiil-fx717/Android-Library-Management-System/68afa42673a6c8647dab6e3196560264a1307afb/build/android-profile/profile-2017-09-24-19-23-06-650.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-09-24-19-26-35-672.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yiiiiil-fx717/Android-Library-Management-System/68afa42673a6c8647dab6e3196560264a1307afb/build/android-profile/profile-2017-09-24-19-26-35-672.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-09-24-19-29-28-925.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yiiiiil-fx717/Android-Library-Management-System/68afa42673a6c8647dab6e3196560264a1307afb/build/android-profile/profile-2017-09-24-19-29-28-925.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-09-24-19-45-02-320.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yiiiiil-fx717/Android-Library-Management-System/68afa42673a6c8647dab6e3196560264a1307afb/build/android-profile/profile-2017-09-24-19-45-02-320.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-09-24-19-45-26-157.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yiiiiil-fx717/Android-Library-Management-System/68afa42673a6c8647dab6e3196560264a1307afb/build/android-profile/profile-2017-09-24-19-45-26-157.rawproto
--------------------------------------------------------------------------------
/build/generated/mockable-android-26.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yiiiiil-fx717/Android-Library-Management-System/68afa42673a6c8647dab6e3196560264a1307afb/build/generated/mockable-android-26.jar
--------------------------------------------------------------------------------
/build/intermediates/dex-cache/cache.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
-
11 |
12 |
13 | -
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | org.gradle.jvmargs=-Xmx1536m
13 |
14 | # When configured, Gradle will run in incubating parallel mode.
15 | # This option should only be used with decoupled projects. More details, visit
16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
17 | # org.gradle.parallel=true
18 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yiiiiil-fx717/Android-Library-Management-System/68afa42673a6c8647dab6e3196560264a1307afb/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Sat Sep 23 14:04:37 CDT 2017
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-3.3-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # Attempt to set APP_HOME
46 | # Resolve links: $0 may be a link
47 | PRG="$0"
48 | # Need this for relative symlinks.
49 | while [ -h "$PRG" ] ; do
50 | ls=`ls -ld "$PRG"`
51 | link=`expr "$ls" : '.*-> \(.*\)$'`
52 | if expr "$link" : '/.*' > /dev/null; then
53 | PRG="$link"
54 | else
55 | PRG=`dirname "$PRG"`"/$link"
56 | fi
57 | done
58 | SAVED="`pwd`"
59 | cd "`dirname \"$PRG\"`/" >/dev/null
60 | APP_HOME="`pwd -P`"
61 | cd "$SAVED" >/dev/null
62 |
63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64 |
65 | # Determine the Java command to use to start the JVM.
66 | if [ -n "$JAVA_HOME" ] ; then
67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68 | # IBM's JDK on AIX uses strange locations for the executables
69 | JAVACMD="$JAVA_HOME/jre/sh/java"
70 | else
71 | JAVACMD="$JAVA_HOME/bin/java"
72 | fi
73 | if [ ! -x "$JAVACMD" ] ; then
74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
75 |
76 | Please set the JAVA_HOME variable in your environment to match the
77 | location of your Java installation."
78 | fi
79 | else
80 | JAVACMD="java"
81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82 |
83 | Please set the JAVA_HOME variable in your environment to match the
84 | location of your Java installation."
85 | fi
86 |
87 | # Increase the maximum file descriptors if we can.
88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89 | MAX_FD_LIMIT=`ulimit -H -n`
90 | if [ $? -eq 0 ] ; then
91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92 | MAX_FD="$MAX_FD_LIMIT"
93 | fi
94 | ulimit -n $MAX_FD
95 | if [ $? -ne 0 ] ; then
96 | warn "Could not set maximum file descriptor limit: $MAX_FD"
97 | fi
98 | else
99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100 | fi
101 | fi
102 |
103 | # For Darwin, add options to specify how the application appears in the dock
104 | if $darwin; then
105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106 | fi
107 |
108 | # For Cygwin, switch paths to Windows format before running java
109 | if $cygwin ; then
110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112 | JAVACMD=`cygpath --unix "$JAVACMD"`
113 |
114 | # We build the pattern for arguments to be converted via cygpath
115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116 | SEP=""
117 | for dir in $ROOTDIRSRAW ; do
118 | ROOTDIRS="$ROOTDIRS$SEP$dir"
119 | SEP="|"
120 | done
121 | OURCYGPATTERN="(^($ROOTDIRS))"
122 | # Add a user-defined pattern to the cygpath arguments
123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125 | fi
126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
127 | i=0
128 | for arg in "$@" ; do
129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131 |
132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134 | else
135 | eval `echo args$i`="\"$arg\""
136 | fi
137 | i=$((i+1))
138 | done
139 | case $i in
140 | (0) set -- ;;
141 | (1) set -- "$args0" ;;
142 | (2) set -- "$args0" "$args1" ;;
143 | (3) set -- "$args0" "$args1" "$args2" ;;
144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150 | esac
151 | fi
152 |
153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154 | function splitJvmOpts() {
155 | JVM_OPTS=("$@")
156 | }
157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
159 |
160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
161 |
--------------------------------------------------------------------------------
/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 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
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 Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/local.properties:
--------------------------------------------------------------------------------
1 | ## This file is automatically generated by Android Studio.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file should *NOT* be checked into Version Control Systems,
5 | # as it contains information specific to your local configuration.
6 | #
7 | # Location of the SDK. This is only used by Gradle.
8 | # For customization when using a Version Control System, please read the
9 | # header note.
10 | sdk.dir=/Users/liuyi/Library/Android/sdk
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------