Commit 6eac9579 authored by Varun Patil's avatar Varun Patil

Revert unnecessary whitespace changes in MainActivity

parent 241cf8e3
...@@ -97,9 +97,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On ...@@ -97,9 +97,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
private RetrofitInterface retrofitInterface; private RetrofitInterface retrofitInterface;
private List<Notification> notifications = null; private List<Notification> notifications = null;
/** /** which menu item should be checked on activity start */
* which menu item should be checked on activity start
*/
private int initMenuChecked = R.id.nav_feed; private int initMenuChecked = R.id.nav_feed;
public static void hideKeyboard(Activity activity) { public static void hideKeyboard(Activity activity) {
...@@ -157,9 +155,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On ...@@ -157,9 +155,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
checkLatestVersion(); checkLatestVersion();
} }
/** /** Get the notifications from memory cache or network */
* Get the notifications from memory cache or network
*/
private void fetchNotifications() { private void fetchNotifications() {
// Try memory cache // Try memory cache
if (notifications != null) { if (notifications != null) {
...@@ -180,9 +176,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On ...@@ -180,9 +176,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
}); });
} }
/** /** Show the right notification icon */
* Show the right notification icon
*/
private void showNotifications() { private void showNotifications() {
if (notifications != null && !notifications.isEmpty()) { if (notifications != null && !notifications.isEmpty()) {
menu.findItem(R.id.action_notifications).setIcon(R.drawable.baseline_notifications_active_white_24); menu.findItem(R.id.action_notifications).setIcon(R.drawable.baseline_notifications_active_white_24);
...@@ -191,9 +185,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On ...@@ -191,9 +185,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
} }
} }
/** /** Get version code we are currently on */
* Get version code we are currently on
*/
private int getCurrentVersion() { private int getCurrentVersion() {
try { try {
PackageInfo pInfo = this.getPackageManager().getPackageInfo(getPackageName(), 0); PackageInfo pInfo = this.getPackageManager().getPackageInfo(getPackageName(), 0);
...@@ -203,14 +195,10 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On ...@@ -203,14 +195,10 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
} }
} }
/** /** Check for updates in andro.json */
* Check for updates in andro.json
*/
private void checkLatestVersion() { private void checkLatestVersion() {
final int versionCode = getCurrentVersion(); final int versionCode = getCurrentVersion();
if (versionCode == 0) { if (versionCode == 0) { return; }
return;
}
RetrofitInterface retrofitInterface = Utils.getRetrofitInterface(); RetrofitInterface retrofitInterface = Utils.getRetrofitInterface();
retrofitInterface.getLatestVersion().enqueue(new EmptyCallback<JsonObject>() { retrofitInterface.getLatestVersion().enqueue(new EmptyCallback<JsonObject>() {
@Override @Override
...@@ -272,9 +260,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On ...@@ -272,9 +260,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
mNotificationManager.createNotificationChannel(mChannel); mNotificationManager.createNotificationChannel(mChannel);
} }
/** /** Handle opening event/body/blog from FCM notification */
* Handle opening event/body/blog from FCM notification
*/
private void handleFCMIntent(Bundle bundle) { private void handleFCMIntent(Bundle bundle) {
/* Mark the notification read */ /* Mark the notification read */
final String notificationId = bundle.getString(FCM_BUNDLE_NOTIFICATION_ID); final String notificationId = bundle.getString(FCM_BUNDLE_NOTIFICATION_ID);
...@@ -290,9 +276,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On ...@@ -290,9 +276,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
); );
} }
/** /** Handle intents for links */
* Handle intents for links
*/
private void handleIntent(Intent appLinkIntent) { private void handleIntent(Intent appLinkIntent) {
String appLinkAction = appLinkIntent.getAction(); String appLinkAction = appLinkIntent.getAction();
String appLinkData = appLinkIntent.getDataString(); String appLinkData = appLinkIntent.getDataString();
...@@ -301,13 +285,9 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On ...@@ -301,13 +285,9 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
} }
} }
/** /** Open the proper fragment from given type and id */
* Open the proper fragment from given type and id
*/
private void chooseIntent(String type, String id) { private void chooseIntent(String type, String id) {
if (type == null || id == null) { if (type == null || id == null) { return; }
return;
}
switch (type) { switch (type) {
case DATA_TYPE_BODY: case DATA_TYPE_BODY:
openBodyFragment(id); openBodyFragment(id);
...@@ -326,9 +306,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On ...@@ -326,9 +306,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
Log.e("NOTIFICATIONS", "Server sent invalid notification?"); Log.e("NOTIFICATIONS", "Server sent invalid notification?");
} }
/** /** Open the proper fragment from given type, id and extra */
* Open the proper fragment from given type, id and extra
*/
private void chooseIntent(String type, String id, String extra) { private void chooseIntent(String type, String id, String extra) {
if (extra == null) { if (extra == null) {
chooseIntent(type, id); chooseIntent(type, id);
...@@ -348,24 +326,18 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On ...@@ -348,24 +326,18 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
} }
} }
/** /** Open user fragment from given id */
* Open user fragment from given id
*/
private void openUserFragment(String id) { private void openUserFragment(String id) {
UserFragment userFragment = UserFragment.newInstance(id); UserFragment userFragment = UserFragment.newInstance(id);
updateFragment(userFragment); updateFragment(userFragment);
} }
/** /** Open the body fragment from given id */
* Open the body fragment from given id
*/
private void openBodyFragment(String id) { private void openBodyFragment(String id) {
Utils.openBodyFragment(new Body(id), this); Utils.openBodyFragment(new Body(id), this);
} }
/** /** Open the event fragment from the provided id */
* Open the event fragment from the provided id
*/
private void openEventFragment(String id) { private void openEventFragment(String id) {
RetrofitInterface retrofitInterface = Utils.getRetrofitInterface(); RetrofitInterface retrofitInterface = Utils.getRetrofitInterface();
final FragmentActivity self = this; final FragmentActivity self = this;
...@@ -576,9 +548,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On ...@@ -576,9 +548,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
return true; return true;
} }
/** /** Open placement blog fragment */
* Open placement blog fragment
*/
private void openPlacementBlog() { private void openPlacementBlog() {
if (session.isLoggedIn()) { if (session.isLoggedIn()) {
PlacementBlogFragment placementBlogFragment = new PlacementBlogFragment(); PlacementBlogFragment placementBlogFragment = new PlacementBlogFragment();
...@@ -597,9 +567,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On ...@@ -597,9 +567,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
} }
} }
/** /** Change the active fragment to the supplied one */
* Change the active fragment to the supplied one
*/
public void updateFragment(Fragment fragment) { public void updateFragment(Fragment fragment) {
Log.d(TAG, "updateFragment: " + fragment.toString()); Log.d(TAG, "updateFragment: " + fragment.toString());
Bundle bundle = fragment.getArguments(); Bundle bundle = fragment.getArguments();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment