diff --git a/app/src/main/java/com/example/cosmosclient/views/RequestListActivity.java b/app/src/main/java/com/example/cosmosclient/views/RequestListActivity.java index f22ce59..e4f8131 100644 --- a/app/src/main/java/com/example/cosmosclient/views/RequestListActivity.java +++ b/app/src/main/java/com/example/cosmosclient/views/RequestListActivity.java @@ -1,10 +1,10 @@ package com.example.cosmosclient.views; import android.content.Intent; +import android.graphics.ColorFilter; import android.os.Bundle; import android.support.design.widget.FloatingActionButton; import android.support.design.widget.Snackbar; -import android.view.Gravity; import android.view.View; import android.support.design.widget.NavigationView; import android.support.v4.view.GravityCompat; @@ -12,13 +12,15 @@ import android.support.v7.app.ActionBarDrawerToggle; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; -import android.view.Menu; import android.view.MenuItem; +import android.widget.ImageView; +import android.widget.LinearLayout; import android.widget.Toast; -import com.example.cosmosclient.MainActivity; import com.example.cosmosclient.R; +import static android.graphics.Color.BLACK; + public class RequestListActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener { @@ -40,61 +42,72 @@ } }); - //LEFTMARK -// DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); -// ActionBarDrawerToggle toggle = new ActionBarDrawerToggle( -// this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close); -// drawer.addDrawerListener(toggle); -// -// toggle.syncState(); + //LEFT hamburger button + DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); + ActionBarDrawerToggle toggle = new ActionBarDrawerToggle( + this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close); + drawer.addDrawerListener(toggle); + + toggle.syncState(); NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view); navigationView.setNavigationItemSelectedListener(this); + + LinearLayout linerlayoutView = (LinearLayout) findViewById(R.id.product); + linerlayoutView.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Toast.makeText(RequestListActivity.this, "product sorted", Toast.LENGTH_SHORT).show(); + ImageView product = (ImageView) findViewById(R.id.imageView); + product.setColorFilter(BLACK); + } + }); + } - @Override - public void onBackPressed() { - DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); - if (drawer.isDrawerOpen(GravityCompat.END)) { - drawer.closeDrawer(GravityCompat.END); - } else { - super.onBackPressed(); - } - } - - @Override - public boolean onCreateOptionsMenu(Menu menu) { - // Inflate the menu; this adds items to the action bar if it is present. - getMenuInflater().inflate(R.menu.request_list, menu); - return true; - } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - // Handle action bar item clicks here. The action bar will - // automatically handle clicks on the Home/Up button, so long - // as you specify a parent activity in AndroidManifest.xml. - int id = item.getItemId(); - - //noinspection SimplifiableIfStatement - if (id == R.id.nav_member_list) { - // Handle the camera action - toast = Toast.makeText(RequestListActivity.this, "Next Member List Activity", Toast.LENGTH_LONG); - toast.show(); - } else if (id == R.id.nav_add_member) { - startActivity(new Intent(RequestListActivity.this, AddMemberActivity.class)); - } else if (id == R.id.nav_notification) { - toast = Toast.makeText(RequestListActivity.this, "Next Notification Activity", Toast.LENGTH_LONG); - toast.show(); - } else if (id == R.id.nav_settings) { - toast = Toast.makeText(RequestListActivity.this, "Next Settings Activity", Toast.LENGTH_LONG); - toast.show(); - } else if (id == R.id.nav_close) { - - } - - return super.onOptionsItemSelected(item); - } +// @Override +// public void onBackPressed() { +// DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); +// if (drawer.isDrawerOpen(GravityCompat.START)) { +// drawer.closeDrawer(GravityCompat.START); +// } else { +// super.onBackPressed(); +// } +// } +// +// @Override +// public boolean onCreateOptionsMenu(Menu menu) { +// // Inflate the menu; this adds items to the action bar if it is present. +// getMenuInflater().inflate(R.menu.request_list, menu); +// return true; +// } +// +// @Override +// public boolean onOptionsItemSelected(MenuItem item) { +// // Handle action bar item clicks here. The action bar will +// // automatically handle clicks on the Home/Up button, so long +// // as you specify a parent activity in AndroidManifest.xml. +// int id = item.getItemId(); +// +// //noinspection SimplifiableIfStatement +// if (id == R.id.nav_member_list) { +// // Handle the camera action +// toast = Toast.makeText(RequestListActivity.this, "Next Member List Activity", Toast.LENGTH_LONG); +// toast.show(); +// } else if (id == R.id.nav_add_member) { +// startActivity(new Intent(RequestListActivity.this, AddMemberActivity.class)); +// } else if (id == R.id.nav_notification) { +// toast = Toast.makeText(RequestListActivity.this, "Next Notification Activity", Toast.LENGTH_LONG); +// toast.show(); +// } else if (id == R.id.nav_settings) { +// toast = Toast.makeText(RequestListActivity.this, "Next Settings Activity", Toast.LENGTH_LONG); +// toast.show(); +// } else if (id == R.id.nav_close) { +// +// } +// +// return super.onOptionsItemSelected(item); +// } @SuppressWarnings("StatementWithEmptyBody") @Override @@ -119,7 +132,7 @@ } DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); - drawer.closeDrawer(GravityCompat.END); + drawer.closeDrawer(GravityCompat.START); return true; } }