@@ -135,14 +135,14 @@ private void hideBottomNavigationView() {
135
135
this .bottomNavigationView .clearAnimation ();
136
136
this .bottomNavigationView .post (() -> this .bottomNavigationView .animate ().translationY (bottomNavigationView .getMeasuredHeight ()));
137
137
138
- int gestureLeft = 0 ;
139
-
140
138
if (Build .VERSION .SDK_INT >= 29 ) {
141
- gestureLeft = this .getWindow ().getDecorView ().getRootWindowInsets (). getSystemGestureInsets (). left ;
142
- }
139
+ this .getWindow ().getDecorView ().post (() -> {
140
+ int gestureLeft = this . getWindow (). getDecorView (). getRootWindowInsets (). getSystemGestureInsets (). left ;
143
141
144
- if (gestureLeft == 0 ) {
145
- this .getWindow ().addFlags (WindowManager .LayoutParams .FLAG_TRANSLUCENT_NAVIGATION );
142
+ if (gestureLeft == 0 ) {
143
+ this .getWindow ().addFlags (WindowManager .LayoutParams .FLAG_TRANSLUCENT_NAVIGATION );
144
+ }
145
+ });
146
146
}
147
147
}
148
148
@@ -165,9 +165,9 @@ private void getUnreadCount() {
165
165
Bundle unreadCount = new Bundle ();
166
166
167
167
Observable .concat (
168
- Observable .fromSingle (appDatabase .spotlightDao ().getUnreadCount ()),
169
- Observable .fromSingle (appDatabase .marksDao ().getMarksUnreadCount ())
170
- )
168
+ Observable .fromSingle (appDatabase .spotlightDao ().getUnreadCount ()),
169
+ Observable .fromSingle (appDatabase .marksDao ().getMarksUnreadCount ())
170
+ )
171
171
.subscribeOn (Schedulers .single ())
172
172
.observeOn (AndroidSchedulers .mainThread ())
173
173
.subscribe (new Observer <Integer >() {
@@ -264,6 +264,8 @@ protected void onCreate(Bundle savedInstanceState) {
264
264
getSupportFragmentManager ().setFragmentResultListener ("syncData" , this , (requestKey , result ) -> this .syncData ());
265
265
getSupportFragmentManager ().setFragmentResultListener ("getUnreadCount" , this , (requestKey , result ) -> this .getUnreadCount ());
266
266
267
+ this .getUnreadCount ();
268
+
267
269
this .bottomNavigationView .setOnItemSelectedListener (item -> {
268
270
Fragment selectedFragment ;
269
271
String selectedFragmentTag ;
@@ -309,13 +311,20 @@ protected void onCreate(Bundle savedInstanceState) {
309
311
310
312
int selectedItem = R .id .item_home ;
311
313
Serializable launchFragment = this .getIntent ().getSerializableExtra ("launchFragment" );
314
+ String launchSubFragment = this .getIntent ().getStringExtra ("launchSubFragment" );
312
315
313
316
if (savedInstanceState != null ) {
314
317
selectedItem = savedInstanceState .getInt ("selectedItem" );
315
318
} else if (launchFragment != null ) {
316
319
// If the application is launched from notifications
317
- if (AssignmentsFragment .class .equals (launchFragment )) {
318
- selectedItem = R .id .item_assignments ;
320
+ if (launchFragment .equals (ProfileFragment .class )) {
321
+ selectedItem = R .id .item_profile ;
322
+ }
323
+
324
+ if (launchSubFragment != null ) {
325
+ Bundle launchSubFragmentBundle = new Bundle ();
326
+ launchSubFragmentBundle .putString ("subFragment" , launchSubFragment );
327
+ getSupportFragmentManager ().setFragmentResult ("launchSubFragment" , launchSubFragmentBundle );
319
328
}
320
329
}
321
330
@@ -348,18 +357,18 @@ public void onComplete() {
348
357
349
358
while (data != -1 ) {
350
359
char current = (char ) data ;
351
- sb .append (current );
352
- data = reader .read ();
353
- }
360
+ sb .append (current );
361
+ data = reader .read ();
362
+ }
354
363
355
- String result = sb .toString ();
356
- JSONObject about = new JSONObject (result );
364
+ String result = sb .toString ();
365
+ JSONObject about = new JSONObject (result );
357
366
358
- return about .getInt ("versionCode" );
359
- } catch (Exception ignored ) {
360
- return 0 ;
361
- }
362
- })
367
+ return about .getInt ("versionCode" );
368
+ } catch (Exception ignored ) {
369
+ return 0 ;
370
+ }
371
+ })
363
372
.subscribeOn (Schedulers .io ())
364
373
.observeOn (AndroidSchedulers .mainThread ())
365
374
.subscribe (new Observer <Integer >() {
0 commit comments