Is possible set Expanded Notification as default in Big Text Notifications?

The documentation states: A notification’s big view appears only when the notification is expanded, which happens when the notification is at the top of the notification drawer, or when the user expands the notification with a gesture. So my answer is no, you can’t expand it by default. There is however a trick to push … Read more

How to change the style of a DatePicker in android?

call like this button5.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub DialogFragment dialogfragment = new DatePickerDialogTheme(); dialogfragment.show(getFragmentManager(), “Theme”); } }); public static class DatePickerDialogTheme extends DialogFragment implements DatePickerDialog.OnDateSetListener{ @Override public Dialog onCreateDialog(Bundle savedInstanceState){ final Calendar calendar = Calendar.getInstance(); int year = calendar.get(Calendar.YEAR); int month = calendar.get(Calendar.MONTH); int day = … Read more

How to change color of EditText handles?

For changing the handle color you can do as specified here you do it using style as <style name=”MyCustomTheme” parent=”@style/MyNotSoCustomTheme”> <item name=”android:textSelectHandle”>@drawable/text_select_handle_middle</item> <item name=”android:textSelectHandleLeft”>@drawable/text_select_handle_left</item> <item name=”android:textSelectHandleRight”>@drawable/text_select_handle_right</item> </style> For doing it programmatically check same question another reply here which is done using reflection try { final Field fEditor = TextView.class.getDeclaredField(“mEditor”); fEditor.setAccessible(true); final Object editor = fEditor.get(editText); … Read more

Why the background of ProgressDialog doesn’t set to the transparent?

create custom MyTheme in values\styles.xml <style name=”MyTheme” parent=”android:Theme.Holo.Dialog”> <item name=”android:alertDialogStyle”>@style/CustomAlertDialogStyle</item> <item name=”android:windowBackground”>@android:color/transparent</item> <item name=”android:textColorPrimary”>#FFFFFF</item> <item name=”android:backgroundDimEnabled”>false</item> <item name=”android:textColor”>#FFFFFF</item> <item name=”android:textStyle”>normal</item> <item name=”android:textSize”>12sp</item> </style> And also add this CustomAlertDialogStyle in values\styles.xml <style name=”CustomAlertDialogStyle”> <item name=”android:bottomBright”>@android:color/transparent</item> <item name=”android:bottomDark”>@android:color/transparent</item> <item name=”android:bottomMedium”>@android:color/transparent</item> <item name=”android:centerBright”>@android:color/transparent</item> <item name=”android:centerDark”>@android:color/transparent</item> <item name=”android:centerMedium”>@android:color/transparent</item> <item name=”android:fullBright”>@android:color/transparent</item> <item name=”android:fullDark”>@android:color/transparent</item> <item name=”android:topBright”>@android:color/transparent</item> <item name=”android:topDark”>@android:color/transparent</item> </style> And set … Read more

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

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

Style bottom Line in Android

It’s kind of a hack, but I think this is probably the best way to do it. The dashed line will always be on the bottom, regardless of the height. <layer-list xmlns:android=”http://schemas.android.com/apk/res/android”> <item> <shape android:shape=”rectangle” > <solid android:color=”#1bd4f6″ /> </shape> </item> <item android:top=”-2dp” android:right=”-2dp” android:left=”-2dp”> <shape> <solid android:color=”@android:color/transparent” /> <stroke android:dashGap=”10px” android:dashWidth=”10px” android:width=”1dp” android:color=”#ababb2″ /> … Read more