package com.appsomehow.ramadan.views;

import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.drawable.Drawable;
import android.preference.CheckBoxPreference;
import android.text.TextPaint;
import android.util.AttributeSet;
import android.view.View;
import android.widget.TextView;

import com.appsomehow.ramadan.R;
import com.appsomehow.ramadan.utilities.Utilities;
import com.dibosh.experiments.android.support.customfonthelper.AndroidCustomFontSupport;

/**
 * TODO: document your custom view class.
 */
public class CheckBoxPreferenceAlarm extends CheckBoxPreference {

    public CheckBoxPreferenceAlarm(Context context) {
        super(context);
    }

    public CheckBoxPreferenceAlarm(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public CheckBoxPreferenceAlarm(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }

    @Override
    protected void onBindView(View view) {
        super.onBindView(view);
        TextView summaryView = (TextView) view.findViewById(android.R.id.title);
        summaryView.setTypeface(Utilities.getFont(getContext()));
        summaryView.setText(AndroidCustomFontSupport.getCorrectedBengaliFormat(getContext().getString(R.string.pref_title_new_message_notifications), Utilities.getFont(getContext()), -1));
        summaryView.setTextColor(Color.BLACK);
    }
}

@@ -377,16 +377,47 @@
 w.View;%0A
+import android.view.ViewGroup;%0A
 import a
@@ -440,16 +440,16 @@
 xtView;%0A
-
 %0Aimport 
@@ -732,16 +732,42 @@
 ence %7B%0A%0A
+    private String text;%0A%0A
     publ
@@ -1087,24 +1087,270 @@
 le);%0A    %7D%0A%0A
+    @Override%0A    protected View onCreateView(ViewGroup parent) %7B%0A%0A        View newView = super.onCreateView(parent);%0A%0A        // Making the text visible (The background is transparent, no need to worry there)l6%0A%0A%0A%0A        return newView;%0A    %7D%0A%0A
     @Overrid
@@ -1577,197 +1577,8 @@
 ));%0A
-        summaryView.setText(AndroidCustomFontSupport.getCorrectedBengaliFormat(getContext().getString(R.string.pref_title_new_message_notifications), Utilities.getFont(getContext()), -1));%0A
     
@@ -1620,16 +1620,19 @@
 BLACK);%0A
-
     %7D%0A
+%0A%0A%0A
 %7D%0A

Update custom preference