Transparent navigation bar and status bar in dialog activity

Viewed 540

I want transparent navigation bar and status bar for my dialog activity and i have this codes in my style:

   <style name="AppTheme.Dialog" parent="Theme.AppCompat.Dialog">
    <item name="colorAccent">@color/gray</item>
    <item name="windowNoTitle">true</item>
</style>

and this in java:

public class FilterActivity extends AppCompatActivity {
FloatingActionButton fab;
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
    setContentView(R.layout.filter_activity);
    getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
    fab = (FloatingActionButton) findViewById(R.id.fab_filter_close);
    fab.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            finish();
        }
    });

}
}

enter image description here

my dialog activity is full screen and has transparent background but navigation bar and status bar is black. what can i do?

0 Answers
Related