Skip to content

Commit ff05177

Browse files
committed
#16 : Improved UI
1 parent be97848 commit ff05177

File tree

15 files changed

+58
-32
lines changed

15 files changed

+58
-32
lines changed

.DS_Store

0 Bytes
Binary file not shown.

app/.DS_Store

6 KB
Binary file not shown.

app/src/.DS_Store

6 KB
Binary file not shown.

app/src/main/.DS_Store

6 KB
Binary file not shown.

app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<application
1414
android:name="android.support.multidex.MultiDexApplication"
1515
android:allowBackup="true"
16-
android:icon="@mipmap/ic_launcher"
16+
android:icon="@drawable/app_icon"
1717
android:label="@string/app_name"
1818
android:supportsRtl="true"
1919
android:theme="@style/AppTheme.NoActionBar">

app/src/main/java/com/pulkit4tech/privy/MainActivity.java

Lines changed: 49 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -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)

app/src/main/java/com/pulkit4tech/privy/utilities/LocationServices.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ public LocationData getCurrentLocation() {
3636
criteria.setPowerRequirement(Criteria.POWER_MEDIUM);
3737
String bestProvider = locationManager.getBestProvider(criteria, true);
3838
if (ActivityCompat.checkSelfPermission(mContext, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
39-
// TODO: Consider calling
4039
// ActivityCompat#requestPermissions
4140
// here to request the missing permissions, and then overriding
4241
// public void onRequestPermissionsResult(int requestCode, String[] permissions,
2.56 KB
Loading
3.39 KB
Loading
2.18 KB
Loading

0 commit comments

Comments
 (0)