android-styles
How to set checkbox border color
You can use the property android:buttonTint=”what you want” to set your checkbox border color.
Android: default AppTheme background colors
You can use your theme’s default background color by referencing the attribute: ?android:colorBackground
Disable Material Ripple on Tablayout
app:tabBackground does not work in my case. This is my solution: tabLayout.setTabRippleColor(null);
How to programmatically create an Android theme style?
TL;DR: Just no, you can’t. That’s how Android works and will never be changed. There is a plain and simple reason why programmatically creating Android themes will never be possible. That is, when an app is starting, Android creates a dummy window that shows the app’s android:windowBackground. At this time, the app process is still … Read more
Setting header color of app in overview (recent apps) screen
You can change this via ActivityManager.TaskDescription: https://developer.android.com/reference/android/app/ActivityManager.TaskDescription.html From an Activity context, call: TaskDescription taskDescription = new TaskDescription(label, icon, colorPrimary); ((Activity)this).setTaskDescription(taskDescription);
Android AlertDialog with rounded corners
You can do it using the following code: CustomDialog.java: public class MainActivity extends Activity{ private static final int ALERT_DIALOG = 1; @Override public void onCreate( Bundle savedInstanceState ) { super.onCreate( savedInstanceState ); setContentView( R.layout.main ); ( (Button) findViewById( R.id.button1 ) ) .setOnClickListener( new OnClickListener() { public void onClick( View v ) { showDialog( ALERT_DIALOG ); … Read more
Creating styles-v21.xml
Right click on res folder, choose New –> Android resource file, set the same name for the new file “styles”, in Available qualifiers: choose the last item “Version” and finally set “Platform API level” 21.
How to use Percentage for android layout?
UPDATE 2018: PercentRelativeLayout and PercentFrameLayout are deprecated. Consider using ConstraintLayout Old Answer: So far Android Support library has limited on where to use this: with RelativeLayout android.support.percent.PercentRelativeLayout with FrameLayout android.support.percent.PercentFrameLayout How to use it? Well, first make sure to include the dependency at build.grade(Module: app) in your android app. dependencies { compile ‘com.android.support:percent:23.3.0’ } Then … Read more
How to change focus color of EditText in Android
You’ll have to create/modify your own NinePatch image to replace the default one, and use that as the background of your EditText. If you look in your SDK folder, under your platform, then res/drawable, you should find the NinePatch image for the EditText focus state. If that’s all you want to change, you can just … Read more