parent
							
								
									9a6b559afe
								
							
						
					
					
						commit
						3e890e11d9
					
				| @ -0,0 +1,9 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <android.support.v7.widget.SwitchCompat xmlns:android="http://schemas.android.com/apk/res/android" | ||||
|                                         android:id="@android:id/checkbox" | ||||
|                                         android:layout_width="wrap_content" | ||||
|                                         android:layout_height="wrap_content" | ||||
|                                         android:background="@null" | ||||
|                                         android:clickable="false" | ||||
|                                         android:focusable="false" | ||||
|                                         android:focusableInTouchMode="false" /> | ||||
| @ -0,0 +1,37 @@ | ||||
| package org.thoughtcrime.securesms.components; | ||||
| 
 | ||||
| import android.annotation.TargetApi; | ||||
| import android.content.Context; | ||||
| import android.os.Build; | ||||
| import android.preference.CheckBoxPreference; | ||||
| import android.util.AttributeSet; | ||||
| 
 | ||||
| import org.thoughtcrime.securesms.R; | ||||
| 
 | ||||
| public class SwitchPreferenceCompat extends CheckBoxPreference { | ||||
| 
 | ||||
|     public SwitchPreferenceCompat(Context context, AttributeSet attrs, int defStyleAttr) { | ||||
|         super(context, attrs, defStyleAttr); | ||||
|         setLayoutRes(); | ||||
|     } | ||||
| 
 | ||||
|     @TargetApi(Build.VERSION_CODES.LOLLIPOP) | ||||
|     public SwitchPreferenceCompat(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { | ||||
|         super(context, attrs, defStyleAttr, defStyleRes); | ||||
|         setLayoutRes(); | ||||
|     } | ||||
| 
 | ||||
|     public SwitchPreferenceCompat(Context context, AttributeSet attrs) { | ||||
|         super(context, attrs); | ||||
|         setLayoutRes(); | ||||
|     } | ||||
| 
 | ||||
|     public SwitchPreferenceCompat(Context context) { | ||||
|         super(context); | ||||
|         setLayoutRes(); | ||||
|     } | ||||
| 
 | ||||
|     private void setLayoutRes() { | ||||
|         setWidgetLayoutResource(R.layout.switch_compat_preference); | ||||
|     } | ||||
| } | ||||
					Loading…
					
					
				
		Reference in New Issue