| |
---|
| | startActivity(new Intent(RequestListActivity.this, AddRequestActivity.class)); |
---|
| | } |
---|
| | }); |
---|
| | |
---|
| | requestlist.clear(); |
---|
| | |
---|
| | //Add Request |
---|
| | requestlist.add(new Request("わさび", new Date(2019, 6, 7), "スーパー", "a-hongo")); |
---|
| | requestlist.add(new Request("ケーキ" , new Date(2019, 6, 6), "ダニエル", "t-sugisawa")); |
---|
| | requestlist.add(new Request("からし", new Date(2018, 6, 4), "コンビニ", "n-kande")); |
---|
| | |
---|
| | //Add RequestList Table |
---|
| | AddRequestListTable(requestlist); |
---|
| | |
---|
| | //LEFT hamburger button |
---|
| | DrawerLayout requestlistDrawer = (DrawerLayout) findViewById(R.id.request_list_drawer_layout); |
---|
| | ActionBarDrawerToggle toggle = new ActionBarDrawerToggle( |
---|
| | this, requestlistDrawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close); |
---|
| |
---|
| | |
---|
| | NavigationView navigationView = (NavigationView) findViewById(R.id.request_list_nav_view); |
---|
| | navigationView.setNavigationItemSelectedListener(this); |
---|
| | |
---|
| | //Add Request |
---|
| | requestlist.add(new Request("わさび", new Date(2019, 6, 7), "スーパー", "a-hongo")); |
---|
| | requestlist.add(new Request("ケーキ" , new Date(2019, 6, 6), "ダニエル", "t-sugisawa")); |
---|
| | requestlist.add(new Request("からし", new Date(2018, 6, 4), "コンビニ", "n-kande")); |
---|
| | LinearLayout productView = (LinearLayout) findViewById(R.id.product); |
---|
| | productView.setOnClickListener(productOnClick); |
---|
| | |
---|
| | LinearLayout deadlineView = (LinearLayout)findViewById(R.id.deadline); |
---|
| | deadlineView.setOnClickListener(deadlineOnClick); |
---|
| | |
---|
| | LinearLayout locationView = (LinearLayout)findViewById(R.id.location); |
---|
| | locationView.setOnClickListener(locationOnClick); |
---|
| | |
---|
| | } |
---|
| | |
---|
| | @Override |
---|
| | protected void onRestart() { |
---|
| | super.onRestart(); |
---|
| | |
---|
| | ResetRequestListTable(); |
---|
| | |
---|
| | //Add RequestList Table |
---|
| | AddRequestListTable(requestlist); |
---|
| | |
---|
| | LinearLayout productView = (LinearLayout) findViewById(R.id.product); |
---|
| | productView.setOnClickListener(productOnClick); |
---|
| | |
---|
| | LinearLayout deadlineView = (LinearLayout)findViewById(R.id.deadline); |
---|
| | deadlineView.setOnClickListener(deadlineOnClick); |
---|
| | |
---|
| | LinearLayout locationView = (LinearLayout)findViewById(R.id.location); |
---|
| | locationView.setOnClickListener(locationOnClick); |
---|
| | |
---|
| | } |
---|
| | |
---|
| | @Override |
---|
| | protected void onStart() { |
---|
| | super.onStart(); |
---|
| | |
---|
| | } |
---|
| | @Override |
---|
| | protected void onPause(){ |
---|
| | super.onPause(); |
---|
| | ResetRequestListTable(); |
---|
| | requestlist.clear(); |
---|
| | } |
---|
| | |
---|
| | @SuppressWarnings("StatementWithEmptyBody") |
---|
| | @Override |
---|
| |
---|
| | } |
---|
| | |
---|
| | private void AddRequestListTable(ArrayList<Request> requestList) { |
---|
| | Date now = new Date(); |
---|
| | for (int i = 0; i < requestList.size(); i++) { |
---|
| | for (int i = requestList.size()-1; i >= 0; i--) { |
---|
| | TableRow tableRow = new TableRow(this); |
---|
| | |
---|
| | TextView textProduct = new TextView(this); |
---|
| | textProduct.setText(requestList.get(i).getProduct()); |
---|
| |
---|
| | |