My app is fullscreen so I use this in my style.xml:
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowNoTitle">true</item>
<item name="android:windowFullscreen">true</item>
</style>
I implemented a notification for uploading. Now how do you show the status bar temporarily like when swiping down the app a transparent version of it shows.
-EDIT-
public class UploadService extends IntentService {
private NotificationManager mNotificationManager;
public UploadService() {
super("UploadService");
}
@Override
public void onDestroy() {
super.onDestroy();
mNotificationManager.cancel(0);
}
@Override
protected void onHandleIntent(Intent intent) {
Resources resources = getResources();
final Notification uploadNotification = new NotificationCompat.Builder(this)
.setTicker(resources.getString(R.string.upload))
.setSmallIcon(android.R.drawable.ic_menu_upload)
.setContentTitle(resources.getString(R.string.app_name))
.setContentText(resources.getString(R.string.upload_progress))
.setProgress(0, 0, true)
.build();
final Notification failedNotification = new NotificationCompat.Builder(this)
.setSmallIcon(android.R.drawable.ic_menu_report_image)
.setTicker(resources.getString(R.string.upload_failed))
.setContentTitle(resources.getString(R.string.upload_failed))
.setAutoCancel(true)
.build();
mNotificationManager = (NotificationManager)
getSystemService(NOTIFICATION_SERVICE);
mNotificationManager.notify(0, uploadNotification);
ParseFile parseFile = null;
boolean success = true;
Bundle bundle = intent.getBundleExtra("bundleImage");
String userID = bundle.getString("userID");
ParseUser parseUser = ParseUser.createWithoutData(ParseUser.class, userID);
String image = bundle.getString("imagePath");
Uri imageUri = Uri.parse(image);
String filename = bundle.getString("imageName");
ByteArrayOutputStream baos;
InputStream is;
try {
baos = new ByteArrayOutputStream();
is = getContentResolver().openInputStream(imageUri);
Bitmap bitmap = BitmapFactory.decodeStream(is);
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, baos);
parseFile = new ParseFile(filename, baos.toByteArray());
baos.close();
is.close();
} catch (Exception e) {
success = false;
mNotificationManager.notify(0, failedNotification);
}
if (success) {
Frames frames = new Frames();
frames.setUploader(parseUser);
frames.setFrameFile(parseFile);
try {
frames.save();
} catch (ParseException e) {
mNotificationManager.notify(0, failedNotification);
}
}
}