1010import android .os .Handler ;
1111import android .os .Looper ;
1212import android .os .Parcelable ;
13- import android .util .Log ;
1413import android .view .LayoutInflater ;
1514import android .view .View ;
1615import android .view .ViewGroup ;
2019import androidx .annotation .Nullable ;
2120import androidx .annotation .RestrictTo ;
2221import androidx .annotation .RestrictTo .Scope ;
23- import androidx .core .graphics .Insets ;
24- import androidx .core .view .ViewCompat ;
25- import androidx .core .view .WindowInsetsCompat ;
2622import androidx .fragment .app .Fragment ;
2723import androidx .recyclerview .widget .DefaultItemAnimator ;
2824import androidx .recyclerview .widget .LinearLayoutManager ;
@@ -137,7 +133,6 @@ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup c
137133 mediaRecyclerView .setLayoutManager (linearLayoutManager );
138134 mediaRecyclerView .addItemDecoration (new VerticalSpaceItemDecoration (18 ));
139135 mediaRecyclerView .setItemAnimator (new DefaultItemAnimator ());
140- applySystemBarsInsets (mediaRecyclerView );
141136
142137 mediaRecyclerView .setAdapter (inboxMessageAdapter );
143138 inboxMessageAdapter .notifyDataSetChanged ();
@@ -159,24 +154,12 @@ public void run() {
159154 recyclerView .setLayoutManager (linearLayoutManager );
160155 recyclerView .addItemDecoration (new VerticalSpaceItemDecoration (18 ));
161156 recyclerView .setItemAnimator (new DefaultItemAnimator ());
162- applySystemBarsInsets (recyclerView );
163157 recyclerView .setAdapter (inboxMessageAdapter );
164158 inboxMessageAdapter .notifyDataSetChanged ();
165159 }
166160 return allView ;
167161 }
168162
169- private void applySystemBarsInsets (RecyclerView view ) {
170- view .setClipToPadding (false );
171- ViewCompat .setOnApplyWindowInsetsListener (view , (v , insets ) -> {
172- Insets bars = insets .getInsets (
173- WindowInsetsCompat .Type .systemBars ()
174- );
175- v .setPadding (bars .left , 0 , bars .right , bars .bottom );
176- return WindowInsetsCompat .CONSUMED ;
177- });
178- }
179-
180163 @ Override
181164 public void onViewStateRestored (@ Nullable Bundle savedInstanceState ) {
182165 super .onViewStateRestored (savedInstanceState );
0 commit comments