Horizontal progressbar with custom color

activity_main.xml <progressbar android:id="@+id/progressBar" style="?android:progressBarStyleHorizontal" android:layout_width="match_parent" android:layout_height="1dp" android:layout_margin="0dp" android:max="100" android:padding="0dp" tools:progress="40" android:progressDrawable="@drawable/progress_drawable" app:layout_collapseMode="pin"/> MainActivity.java ProgressBar mProgressBar = (ProgressBar) findViewById(R.id.progressBar); //somewhere when scrollin mRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() { @Override public void onScrolled(RecyclerView recyclerView, int…

GCM notification with custom sound – shorter version (part)

Here is a short example how to create notification with default stuff but different sound: NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this) .setSmallIcon(R.drawable.ic_launcher) .setContentTitle("title") .setStyle(new NotificationCompat.BigTextStyle() .bigText("message")) .setContentText("message") .setAutoCancel(true) .setSound(soundUri) .setDefaults(NotificationCompat.DEFAULT_ALL ^…