@@ -151,8 +151,10 @@ private void changeSignInSignOutOption() {
151151 MenuItem sign_in_out_item = menu .findItem (R .id .nav_sign_in_out );
152152 if (checkIfLoggedIn ()) {
153153 sign_in_out_item .setTitle (R .string .sign_out );
154+ sign_in_out_item .setIcon (this .getResources ().getDrawable (R .drawable .sign_out ));
154155 } else {
155156 sign_in_out_item .setTitle (R .string .sign_in );
157+ sign_in_out_item .setIcon (this .getResources ().getDrawable (R .drawable .sign_in ));
156158 }
157159 }
158160
@@ -247,27 +249,27 @@ public void onBackPressed() {
247249 }
248250 }
249251
250- @ Override
251- public boolean onCreateOptionsMenu (Menu menu ) {
252- // Inflate the menu; this adds items to the action bar if it is present.
253- getMenuInflater ().inflate (R .menu .main , menu );
254- return true ;
255- }
256-
257- @ Override
258- public boolean onOptionsItemSelected (MenuItem item ) {
259- // Handle action bar item clicks here. The action bar will
260- // automatically handle clicks on the Home/Up button, so long
261- // as you specify a parent activity in AndroidManifest.xml.
262- int id = item .getItemId ();
263-
264- //noinspection SimplifiableIfStatement
265- if (id == R .id .action_settings ) {
266- return true ;
267- }
268-
269- return super .onOptionsItemSelected (item );
270- }
252+ // @Override
253+ // public boolean onCreateOptionsMenu(Menu menu) {
254+ // // Inflate the menu; this adds items to the action bar if it is present.
255+ // getMenuInflater().inflate(R.menu.main, menu);
256+ // return true;
257+ // }
258+ //
259+ // @Override
260+ // public boolean onOptionsItemSelected(MenuItem item) {
261+ // // Handle action bar item clicks here. The action bar will
262+ // // automatically handle clicks on the Home/Up button, so long
263+ // // as you specify a parent activity in AndroidManifest.xml.
264+ // int id = item.getItemId();
265+ //
266+ // //noinspection SimplifiableIfStatement
267+ // if (id == R.id.action_settings) {
268+ // return true;
269+ // }
270+ //
271+ // return super.onOptionsItemSelected(item);
272+ // }
271273
272274 @ SuppressWarnings ("StatementWithEmptyBody" )
273275 @ Override
@@ -282,15 +284,38 @@ public boolean onNavigationItemSelected(MenuItem item) {
282284 loadAddNewPrivyActivity ();
283285 closeDrawer ();
284286 } else if (id == R .id .nav_sign_in_out ) {
285- if (checkIfLoggedIn ())
287+ if (checkIfLoggedIn ()) {
286288 signOut ();
287- else
289+ } else {
288290 startGoogleSignInActivity (RC_SIGN_IN );
291+ }
292+ } else if (id == R .id .nav_share ) {
293+ shareApp ();
294+ closeDrawer ();
295+ } else if (id == R .id .nav_feedback ) {
296+ sendFeedBack ();
297+ closeDrawer ();
289298 }
290- //TODO : Add other conditions
291299 return true ;
292300 }
293301
302+ private void sendFeedBack () {
303+ Intent Email = new Intent (Intent .ACTION_SEND );
304+ Email .setType ("text/email" );
305+ Email .putExtra (Intent .EXTRA_EMAIL , new String []{getString (R .string .app_feedback_mail )});
306+ Email .putExtra (Intent .EXTRA_SUBJECT , getString (R .string .feedback_subject ));
307+ startActivity (Intent .createChooser (Email , getString (R .string .send_feedback_msg )));
308+ }
309+
310+ private void shareApp () {
311+ Intent sendIntent = new Intent ();
312+ sendIntent .setAction (Intent .ACTION_SEND );
313+ sendIntent .putExtra (Intent .EXTRA_TEXT ,
314+ getString (R .string .social_share_msg ));
315+ sendIntent .setType ("text/plain" );
316+ startActivity (sendIntent );
317+ }
318+
294319 private void closeDrawer () {
295320 DrawerLayout drawer = (DrawerLayout ) findViewById (R .id .drawer_layout );
296321 drawer .closeDrawer (GravityCompat .START );
@@ -367,7 +392,6 @@ private void handleSignInResult(GoogleSignInResult result) {
367392 }
368393
369394 private void addLoginInfo (GoogleSignInAccount acct ) {
370- // TODO : add Profile Picture
371395 SharedPreferences .Editor editor = mSharedPreferences .edit ();
372396 editor .putBoolean (LOGGED_IN , true );
373397 if (acct .getDisplayName () != null )
0 commit comments