Transparent Status Bar on Fragment and Activity

After using other libraries for just translating the status bar at Android, I found a method.
This method does not require any library or anything, just use this code segment into your @OnCreate method and taa-data :)
Gist:java
@OnCreate
{
  // FullScreen
  getWindow().setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, 
  WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
}


xml
// XML : 
<item name="android:windowTranslucentStatus">true</item>


Markdown:
@OnCreate{  
// FullScreen  getWindow().setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
} // XML Part
<item name="android:windowTranslucentStatus">true</item>

Fragment Usage

Example: LoginActivity + LoginActivityFragment, you should put this code into LoginActivitynot the fragment one.

Activity Usage

Completely Transparent Status Bar
Be sure to also set the transparency in /res/values-v21/styles.xml:
<item name="android:statusBarColor">@android:color/transparent</item>
Or set the transparency programmatically:
getWindow().setStatusBarColor(Color.TRANSPARENT);
Annotation: This method just works on API 21 and above.
Note: You should add the code segment in styles.xml
<item name="android:windowTranslucentStatus">true</item>
Note 2: This method just works on API 19 and above.
if you have any question, ask me :)


How to extract filename from Uri?

Now, we can extract filename with and without extension :) You will convert your bitmap to uri and get the real path of your file. Now w...