Program: 94132
Project: 94132
Buggy source:
@Override public View getView(final int position,View convertView,ViewGroup parent){
  final int[] colorsBg=new int[]{Color.WHITE,Color.WHITE,Color.WHITE,Color.WHITE,Color.WHITE};
  final int[] currentItemBg={2};
  final int[] colorsText=new int[]{Color.WHITE,Color.WHITE,Color.WHITE,Color.WHITE,Color.WHITE};
  final int[] currentItemText={2};
  Holder holder=new Holder();
  View rowView;
  rowView=inflater.inflate(mRes.getLayout(R.layout.optionlayout),null);
  holder.tv=(TextView)rowView.findViewById(mRes.getIdentifier("String_Node_Str","String_Node_Str","String_Node_Str"));
  holder.img=(ImageView)rowView.findViewById(mRes.getIdentifier("String_Node_Str","String_Node_Str","String_Node_Str"));
  holder.tv.setText(options[position]);
  holder.img.setImageDrawable(mRes.getDrawable(optionImageId[position]));
  rowView.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
switch (position) {
case 0:
{
          ColorPickerDialog colorPickerDialog=new ColorPickerDialog(context,HookMethods.editText.getCurrentTextColor(),new ColorPickerDialog.OnColorSelectedListener(){
            @Override public void onColorSelected(            int color){
              HookMethods.editText.setTextColor(color);
            }
          }
);
          colorPickerDialog.setButton(-3,Common.dialog_default,new DialogInterface.OnClickListener(){
            @Override public void onClick(            DialogInterface dialogInterface,            int which){
              HookMethods.editText.setTextColor(Color.WHITE);
              HookMethods.editText.setAlpha(1);
            }
          }
);
          colorPickerDialog.setTitle(Common.dialog_txtcolour);
          colorPickerDialog.show();
          return;
        }
case 1:
{
        AlertDialog.Builder builder=new AlertDialog.Builder(context);
        SeekBar seekBar=new SeekBar(context);
        seekBar.setMax(150);
        seekBar.setProgress((int)HookMethods.editText.getTextSize());
        seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener(){
          public void onProgressChanged(          SeekBar seekBar,          int n,          boolean bl){
            HookMethods.editText.setTextSize(TypedValue.COMPLEX_UNIT_DIP,n);
          }
          @Override public void onStartTrackingTouch(          SeekBar arg0){
          }
          @Override public void onStopTrackingTouch(          SeekBar arg0){
          }
        }
);
        builder.setNeutralButton(Common.dialog_default,new DialogInterface.OnClickListener(){
          @Override public void onClick(          DialogInterface dialog,          int which){
            HookMethods.editText.setTextSize(TypedValue.COMPLEX_UNIT_PX,32.5125f);
          }
        }
);
        builder.setPositiveButton(Common.dialog_done,null);
        builder.setView((View)seekBar);
        builder.show();
        return;
      }
case 2:
{
      AlertDialog.Builder builder=new AlertDialog.Builder(context);
      SeekBar seekBar=new SeekBar(context);
      seekBar.setMax(100);
      seekBar.setProgress((int)HookMethods.editText.getAlpha() * 100);
      seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener(){
        public void onProgressChanged(        SeekBar seekBar2,        int n,        boolean bl){
          float alpha=(float)n / 100;
          HookMethods.editText.setAlpha(alpha);
        }
        @Override public void onStartTrackingTouch(        SeekBar arg0){
        }
        @Override public void onStopTrackingTouch(        SeekBar arg0){
        }
      }
);
      builder.setNeutralButton(Common.dialog_default,new DialogInterface.OnClickListener(){
        @Override public void onClick(        DialogInterface dialog,        int which){
          HookMethods.editText.setAlpha(1);
        }
      }
);
      builder.setPositiveButton(Common.dialog_done,null);
      builder.setView((View)seekBar);
      builder.show();
      return;
    }
case 3:
{
    AlertDialog.Builder builder=new AlertDialog.Builder(context);
    builder.setTitle("String_Node_Str");
    builder.setNegativeButton("String_Node_Str",new DialogInterface.OnClickListener(){
      @Override public void onClick(      DialogInterface dialogInterface,      int i){
      }
    }
);
    LinearLayout rootLayout=new LinearLayout(context);
    LinearLayout.LayoutParams rootParams=new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT);
    LayoutInflater inflater=(LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    rootLayout.addView(inflater.inflate(HookMethods.modRes.getLayout(R.layout.gradient_layout),null),rootParams);
    final RadioGroup orientation=(RadioGroup)rootLayout.findViewById(R.id.orientation);
    final LinearLayout listLayout=(LinearLayout)rootLayout.findViewById(R.id.itemLayout);
    final LinearLayout.LayoutParams params=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.WRAP_CONTENT);
    for (int i=1; i <= 5; i++) {
      Button btn=new Button(context);
      btn.setId(i);
      final int id_=btn.getId();
      btn.setText("String_Node_Str" + id_);
      btn.setBackgroundColor(colorsText[i - 1]);
      listLayout.addView(btn,params);
      final Button btn1=((Button)listLayout.findViewById(id_));
      btn1.setOnClickListener(new View.OnClickListener(){
        public void onClick(        View view){
          ColorPickerDialog colorPickerDialog=new ColorPickerDialog(context,colorsText[id_ - 1],new ColorPickerDialog.OnColorSelectedListener(){
            @Override public void onColorSelected(            int color){
              colorsText[id_ - 1]=color;
              btn1.setBackgroundColor(colorsText[id_ - 1]);
            }
          }
);
          colorPickerDialog.setTitle("String_Node_Str" + id_);
          colorPickerDialog.show();
        }
      }
);
      if (btn1.getId() <= currentItemText[0]) {
        btn1.setVisibility(View.VISIBLE);
      }
 else {
        btn1.setVisibility(View.GONE);
      }
    }
    Button add=(Button)rootLayout.findViewById(R.id.add);
    add.setOnClickListener(new View.OnClickListener(){
      @Override public void onClick(      View view){
        if (currentItemText[0] < 5) {
          currentItemText[0]++;
          listLayout.findViewById(currentItemText[0]).setVisibility(View.VISIBLE);
        }
 else {
          Toast.makeText(context,"String_Node_Str",Toast.LENGTH_SHORT).show();
        }
      }
    }
);
    Button remove=(Button)rootLayout.findViewById(R.id.remove);
    remove.setOnClickListener(new View.OnClickListener(){
      @Override public void onClick(      View view){
        if (currentItemText[0] > 2) {
          listLayout.findViewById(currentItemText[0]).setVisibility(View.GONE);
          currentItemText[0]--;
        }
 else {
          Toast.makeText(context,"String_Node_Str",Toast.LENGTH_SHORT).show();
        }
      }
    }
);
    builder.setView(rootLayout);
    builder.setPositiveButton("String_Node_Str",new DialogInterface.OnClickListener(){
      @Override public void onClick(      DialogInterface dialogInterface,      int i){
        final int[] usedColors=new int[currentItemText[0]];
        System.arraycopy(colorsText,0,usedColors,0,currentItemText[0]);
        Shader textShader=null;
        int checkedID=orientation.getCheckedRadioButtonId();
        if (checkedID == R.id.horizontal) {
          double angleInRadians=Math.toRadians(90);
          double length=100;
          double endX=Math.cos(angleInRadians) * length;
          double endY=Math.sin(angleInRadians) * HookMethods.editText.getHeight();
          WindowManager wm=(WindowManager)context.getSystemService(Context.WINDOW_SERVICE);
          Display display=wm.getDefaultDisplay();
          Point size=new Point();
          display.getSize(size);
          int width=size.x;
          textShader=new LinearGradient(0,0,width,0,usedColors,null,Shader.TileMode.CLAMP);
        }
 else         if (checkedID == R.id.vertical) {
          textShader=new LinearGradient(0,0,0,HookMethods.editText.getHeight(),usedColors,null,Shader.TileMode.CLAMP);
        }
        HookMethods.editText.getPaint().setShader(textShader);
        HookMethods.editText.setText(HookMethods.editText.getText());
      }
    }
);
    builder.show();
    return;
  }
case 4:
{
  AlertDialog.Builder builder=new AlertDialog.Builder(context);
  Button button_left=new Button(context);
  Button button_center=new Button(context);
  Button button_right=new Button(context);
  LinearLayout linearLayout=new LinearLayout(context);
  linearLayout.setOrientation(LinearLayout.VERTICAL);
  button_left.setText(Common.dialog_left);
  button_left.setOnClickListener(new View.OnClickListener(){
    public void onClick(    View view){
      HookMethods.editText.setGravity(Gravity.LEFT);
    }
  }
);
  button_center.setText(Common.dialog_center);
  button_center.setOnClickListener(new View.OnClickListener(){
    public void onClick(    View view){
      HookMethods.editText.setGravity(Gravity.CENTER);
    }
  }
);
  button_right.setText(Common.dialog_right);
  button_right.setOnClickListener(new View.OnClickListener(){
    public void onClick(    View view){
      HookMethods.editText.setGravity(Gravity.RIGHT);
    }
  }
);
  linearLayout.addView((View)button_left);
  linearLayout.addView((View)button_center);
  linearLayout.addView((View)button_right);
  builder.setView((View)linearLayout);
  builder.setPositiveButton(Common.dialog_done,null);
  builder.show();
  return;
}
case 5:
{
AlertDialog.Builder builder=new AlertDialog.Builder(context);
Button button_bold=new Button(context);
Button button_italic=new Button(context);
Button button_bolditalic=new Button(context);
Button button_normal=new Button(context);
LinearLayout linearLayout=new LinearLayout(context);
linearLayout.setOrientation(LinearLayout.VERTICAL);
button_bold.setText(Common.dialog_bold);
button_bold.setOnClickListener(new View.OnClickListener(){
  public void onClick(  View view){
    HookMethods.editText.setTypeface(null,Typeface.BOLD);
  }
}
);
button_italic.setText(Common.dialog_italic);
button_italic.setOnClickListener(new View.OnClickListener(){
  public void onClick(  View view){
    HookMethods.editText.setTypeface(null,Typeface.ITALIC);
  }
}
);
button_bolditalic.setText(Common.dialog_bolditalic);
button_bolditalic.setOnClickListener(new View.OnClickListener(){
  public void onClick(  View view){
    HookMethods.editText.setTypeface(null,Typeface.BOLD_ITALIC);
  }
}
);
button_normal.setText(Common.dialog_normal);
button_normal.setOnClickListener(new View.OnClickListener(){
  public void onClick(  View view){
    HookMethods.editText.setTypeface(null,Typeface.NORMAL);
  }
}
);
linearLayout.addView((View)button_bold);
linearLayout.addView((View)button_italic);
linearLayout.addView((View)button_bolditalic);
linearLayout.addView((View)button_normal);
builder.setView((View)linearLayout);
builder.setPositiveButton(Common.dialog_done,null);
builder.show();
return;
}
case 6:
{
File folder=new File(Environment.getExternalStorageDirectory() + "String_Node_Str");
if (folder.exists()) {
FilenameFilter filter=new FilenameFilter(){
  @Override public boolean accept(  File dir,  String filename){
    if (filename.lastIndexOf('.') > 0) {
      int lastIndex=filename.lastIndexOf('.');
      String extension=filename.substring(lastIndex);
      if (extension.equalsIgnoreCase("String_Node_Str") || extension.equalsIgnoreCase("String_Node_Str")) {
        return true;
      }
    }
    return false;
  }
}
;
File[] fonts=folder.listFiles(filter);
if (fonts.length > 0) {
  AlertDialog.Builder builder=new AlertDialog.Builder(context);
  builder.setTitle("String_Node_Str");
  builder.setNeutralButton("String_Node_Str",new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
      HookMethods.editText.setTypeface(HookMethods.defTypeface);
    }
  }
);
  builder.setNegativeButton("String_Node_Str",new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialogInterface,    int i){
    }
  }
);
  LinearLayout rootLayout=new LinearLayout(context);
  LinearLayout.LayoutParams rootParams=new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT);
  LayoutInflater inflater=(LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  rootLayout.addView(inflater.inflate(HookMethods.modRes.getLayout(R.layout.font_list),null),rootParams);
  LinearLayout listLayout=(LinearLayout)rootLayout.findViewById(R.id.fontLayout);
  for (  final File font : fonts) {
    String fontname=font.getName().substring(0,font.getName().toLowerCase().lastIndexOf("String_Node_Str"));
    TextView item=new TextView(context);
    item.setLayoutParams(new TableLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.WRAP_CONTENT));
    item.setPadding(0,0,0,2);
    item.setText(fontname);
    item.setTextSize(TypedValue.COMPLEX_UNIT_DIP,22.0f);
    item.setGravity(Gravity.CENTER_HORIZONTAL);
    item.setTypeface(TypefaceUtil.get(font));
    item.setOnClickListener(new View.OnClickListener(){
      @Override public void onClick(      View view){
        HookMethods.editText.setTypeface(TypefaceUtil.get(font));
      }
    }
);
    listLayout.addView(item);
  }
  builder.setView(rootLayout);
  builder.show();
}
 else {
  NotificationUtils.showMessage("String_Node_Str",Color.RED,NotificationUtils.LENGHT_SHORT,HookMethods.classLoader);
}
}
 else {
NotificationUtils.showMessage("String_Node_Str",Color.RED,NotificationUtils.LENGHT_SHORT,HookMethods.classLoader);
}
return;
}
case 7:
{
ColorPickerDialog colorPickerDialog=new ColorPickerDialog(context,HookMethods.editText.getSolidColor(),new ColorPickerDialog.OnColorSelectedListener(){
@Override public void onColorSelected(int color){
HookMethods.editText.setBackgroundColor(color);
}
}
);
colorPickerDialog.setButton(-3,Common.dialog_default,new DialogInterface.OnClickListener(){
@Override public void onClick(DialogInterface dialogInterface,int which){
HookMethods.editText.setBackgroundColor((Color.parseColor("String_Node_Str")));
HookMethods.editText.setAlpha(1);
}
}
);
colorPickerDialog.setTitle(Common.dialog_bgcolour);
colorPickerDialog.show();
return;
}
case 8:
{
AlertDialog.Builder builder=new AlertDialog.Builder(HookMethods.SnapContext);
SeekBar seekBar=new SeekBar(HookMethods.SnapContext);
seekBar.setMax(255);
seekBar.setProgress((int)HookMethods.editText.getBackground().getAlpha());
seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener(){
public void onProgressChanged(SeekBar seekBar3,int n,boolean bl){
HookMethods.editText.getBackground().setAlpha(n);
}
@Override public void onStartTrackingTouch(SeekBar arg0){
}
@Override public void onStopTrackingTouch(SeekBar arg0){
}
}
);
builder.setNeutralButton(Common.dialog_default,new DialogInterface.OnClickListener(){
@Override public void onClick(DialogInterface dialog,int which){
HookMethods.editText.getBackground().setAlpha(153);
}
}
);
builder.setPositiveButton(Common.dialog_done,null);
builder.setView((View)seekBar);
builder.show();
return;
}
case 9:
{
AlertDialog.Builder builder=new AlertDialog.Builder(context);
builder.setTitle("String_Node_Str");
builder.setNegativeButton("String_Node_Str",new DialogInterface.OnClickListener(){
@Override public void onClick(DialogInterface dialogInterface,int i){
}
}
);
final LinearLayout rootLayout=new LinearLayout(context);
LinearLayout.LayoutParams rootParams=new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT);
LayoutInflater inflater=(LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
rootLayout.addView(inflater.inflate(HookMethods.modRes.getLayout(R.layout.gradient_layout),null),rootParams);
final RadioGroup orientation=(RadioGroup)rootLayout.findViewById(R.id.orientation);
final LinearLayout listLayout=(LinearLayout)rootLayout.findViewById(R.id.itemLayout);
final LinearLayout.LayoutParams params=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.WRAP_CONTENT);
for (int i=1; i <= 5; i++) {
Button btn=new Button(context);
btn.setId(i);
final int id_=btn.getId();
btn.setText("String_Node_Str" + id_);
btn.setBackgroundColor(colorsBg[i - 1]);
listLayout.addView(btn,params);
final Button btn1=((Button)listLayout.findViewById(id_));
btn1.setOnClickListener(new View.OnClickListener(){
public void onClick(View view){
ColorPickerDialog colorPickerDialog=new ColorPickerDialog(context,colorsBg[id_ - 1],new ColorPickerDialog.OnColorSelectedListener(){
@Override public void onColorSelected(int color){
  colorsBg[id_ - 1]=color;
  btn1.setBackgroundColor(colorsBg[id_ - 1]);
}
}
);
colorPickerDialog.setTitle("String_Node_Str" + id_);
colorPickerDialog.show();
}
}
);
if (btn1.getId() <= currentItemBg[0]) {
btn1.setVisibility(View.VISIBLE);
}
 else {
btn1.setVisibility(View.GONE);
}
}
Button add=(Button)rootLayout.findViewById(R.id.add);
add.setOnClickListener(new View.OnClickListener(){
@Override public void onClick(View view){
if (currentItemBg[0] < 5) {
currentItemBg[0]++;
listLayout.findViewById(currentItemBg[0]).setVisibility(View.VISIBLE);
}
 else {
Toast.makeText(context,"String_Node_Str",Toast.LENGTH_SHORT).show();
}
}
}
);
Button remove=(Button)rootLayout.findViewById(R.id.remove);
remove.setOnClickListener(new View.OnClickListener(){
@Override public void onClick(View view){
if (currentItemBg[0] > 2) {
listLayout.findViewById(currentItemBg[0]).setVisibility(View.GONE);
currentItemBg[0]--;
}
 else {
Toast.makeText(context,"String_Node_Str",Toast.LENGTH_SHORT).show();
}
}
}
);
builder.setView(rootLayout);
builder.setPositiveButton("String_Node_Str",new DialogInterface.OnClickListener(){
@Override public void onClick(DialogInterface dialogInterface,int i){
final int[] usedColors=new int[currentItemBg[0]];
System.arraycopy(colorsBg,0,usedColors,0,currentItemBg[0]);
PaintDrawable p=new PaintDrawable();
p.setShape(new RectShape());
ShapeDrawable.ShaderFactory sf=new ShapeDrawable.ShaderFactory(){
@Override public Shader resize(int width,int height){
LinearGradient returnGradient=null;
int checkedID=orientation.getCheckedRadioButtonId();
if (checkedID == R.id.horizontal) {
  returnGradient=new LinearGradient(0,0,width,height,usedColors,null,Shader.TileMode.MIRROR);
}
 else if (checkedID == R.id.vertical) {
  double angleInRadians=Math.toRadians(90);
  double length=100;
  double endX=Math.cos(angleInRadians) * length;
  double endY=Math.sin(angleInRadians) * HookMethods.editText.getHeight();
  returnGradient=new LinearGradient(0,0,(float)endX,(float)endY,usedColors,null,Shader.TileMode.MIRROR);
}
return returnGradient;
}
}
;
p.setShaderFactory(sf);
HookMethods.editText.setBackgroundDrawable(p);
}
}
);
builder.show();
return;
}
case 10:
{
HookMethods.editText.setBackgroundDrawable(null);
HookMethods.editText.getPaint().reset();
HookMethods.editText.setTextColor(Color.WHITE);
HookMethods.editText.setBackgroundColor((Color.parseColor("String_Node_Str")));
HookMethods.editText.setGravity(Gravity.CENTER);
HookMethods.editText.setAlpha(1);
HookMethods.editText.getBackground().setAlpha(153);
HookMethods.editText.setTypeface(HookMethods.defTypeface);
HookMethods.editText.setTextSize(TypedValue.COMPLEX_UNIT_PX,32.5125f);
return;
}
default :
return;
}
}
}
);
return rowView;
}

Fixed version (ground truth):
@Override public View getView(final int position,View convertView,ViewGroup parent){
  final int[] colorsBg=new int[]{Color.WHITE,Color.WHITE,Color.WHITE,Color.WHITE,Color.WHITE};
  final int[] currentItemBg={2};
  final int[] colorsText=new int[]{Color.WHITE,Color.WHITE,Color.WHITE,Color.WHITE,Color.WHITE};
  final int[] currentItemText={2};
  Holder holder=new Holder();
  View rowView;
  rowView=inflater.inflate(mRes.getLayout(R.layout.optionlayout),null);
  holder.tv=(TextView)rowView.findViewById(mRes.getIdentifier("String_Node_Str","String_Node_Str","String_Node_Str"));
  holder.img=(ImageView)rowView.findViewById(mRes.getIdentifier("String_Node_Str","String_Node_Str","String_Node_Str"));
  holder.tv.setText(options[position]);
  holder.img.setImageDrawable(mRes.getDrawable(optionImageId[position]));
  rowView.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
switch (position) {
case 0:
{
          ColorPickerDialog colorPickerDialog=new ColorPickerDialog(context,HookMethods.editText.getCurrentTextColor(),new ColorPickerDialog.OnColorSelectedListener(){
            @Override public void onColorSelected(            int color){
              HookMethods.editText.setTextColor(color);
            }
          }
);
          colorPickerDialog.setButton(-3,Common.dialog_default,new DialogInterface.OnClickListener(){
            @Override public void onClick(            DialogInterface dialogInterface,            int which){
              HookMethods.editText.setTextColor(Color.WHITE);
              HookMethods.editText.setAlpha(1);
            }
          }
);
          colorPickerDialog.setTitle(Common.dialog_txtcolour);
          colorPickerDialog.show();
          return;
        }
case 1:
{
        AlertDialog.Builder builder=new AlertDialog.Builder(context);
        SeekBar seekBar=new SeekBar(context);
        seekBar.setMax(150);
        seekBar.setProgress((int)HookMethods.editText.getTextSize());
        seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener(){
          public void onProgressChanged(          SeekBar seekBar,          int n,          boolean bl){
            HookMethods.editText.setTextSize(TypedValue.COMPLEX_UNIT_DIP,n);
          }
          @Override public void onStartTrackingTouch(          SeekBar arg0){
          }
          @Override public void onStopTrackingTouch(          SeekBar arg0){
          }
        }
);
        builder.setNeutralButton(Common.dialog_default,new DialogInterface.OnClickListener(){
          @Override public void onClick(          DialogInterface dialog,          int which){
            HookMethods.editText.setTextSize(TypedValue.COMPLEX_UNIT_PX,32.5125f);
          }
        }
);
        builder.setPositiveButton(Common.dialog_done,null);
        builder.setView((View)seekBar);
        builder.show();
        return;
      }
case 2:
{
      AlertDialog.Builder builder=new AlertDialog.Builder(context);
      SeekBar seekBar=new SeekBar(context);
      seekBar.setMax(100);
      seekBar.setProgress((int)HookMethods.editText.getAlpha() * 100);
      seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener(){
        public void onProgressChanged(        SeekBar seekBar2,        int n,        boolean bl){
          float alpha=(float)n / 100;
          HookMethods.editText.setAlpha(alpha);
        }
        @Override public void onStartTrackingTouch(        SeekBar arg0){
        }
        @Override public void onStopTrackingTouch(        SeekBar arg0){
        }
      }
);
      builder.setNeutralButton(Common.dialog_default,new DialogInterface.OnClickListener(){
        @Override public void onClick(        DialogInterface dialog,        int which){
          HookMethods.editText.setAlpha(1);
        }
      }
);
      builder.setPositiveButton(Common.dialog_done,null);
      builder.setView((View)seekBar);
      builder.show();
      return;
    }
case 3:
{
    AlertDialog.Builder builder=new AlertDialog.Builder(context);
    builder.setTitle("String_Node_Str");
    builder.setNegativeButton("String_Node_Str",new DialogInterface.OnClickListener(){
      @Override public void onClick(      DialogInterface dialogInterface,      int i){
      }
    }
);
    LinearLayout rootLayout=new LinearLayout(context);
    LinearLayout.LayoutParams rootParams=new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT);
    LayoutInflater inflater=(LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    rootLayout.addView(inflater.inflate(HookMethods.modRes.getLayout(R.layout.gradient_layout),null),rootParams);
    final RadioGroup orientation=(RadioGroup)rootLayout.findViewById(R.id.orientation);
    final LinearLayout listLayout=(LinearLayout)rootLayout.findViewById(R.id.itemLayout);
    final LinearLayout.LayoutParams params=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.WRAP_CONTENT);
    for (int i=1; i <= 5; i++) {
      Button btn=new Button(context);
      btn.setId(i);
      final int id_=btn.getId();
      btn.setText("String_Node_Str" + id_);
      btn.setBackgroundColor(colorsText[i - 1]);
      listLayout.addView(btn,params);
      final Button btn1=((Button)listLayout.findViewById(id_));
      btn1.setOnClickListener(new View.OnClickListener(){
        public void onClick(        View view){
          ColorPickerDialog colorPickerDialog=new ColorPickerDialog(context,colorsText[id_ - 1],new ColorPickerDialog.OnColorSelectedListener(){
            @Override public void onColorSelected(            int color){
              colorsText[id_ - 1]=color;
              btn1.setBackgroundColor(colorsText[id_ - 1]);
            }
          }
);
          colorPickerDialog.setTitle("String_Node_Str" + id_);
          colorPickerDialog.show();
        }
      }
);
      if (btn1.getId() <= currentItemText[0]) {
        btn1.setVisibility(View.VISIBLE);
      }
 else {
        btn1.setVisibility(View.GONE);
      }
    }
    Button add=(Button)rootLayout.findViewById(R.id.add);
    add.setOnClickListener(new View.OnClickListener(){
      @Override public void onClick(      View view){
        if (currentItemText[0] < 5) {
          currentItemText[0]++;
          listLayout.findViewById(currentItemText[0]).setVisibility(View.VISIBLE);
        }
 else {
          Toast.makeText(context,"String_Node_Str",Toast.LENGTH_SHORT).show();
        }
      }
    }
);
    Button remove=(Button)rootLayout.findViewById(R.id.remove);
    remove.setOnClickListener(new View.OnClickListener(){
      @Override public void onClick(      View view){
        if (currentItemText[0] > 2) {
          listLayout.findViewById(currentItemText[0]).setVisibility(View.GONE);
          currentItemText[0]--;
        }
 else {
          Toast.makeText(context,"String_Node_Str",Toast.LENGTH_SHORT).show();
        }
      }
    }
);
    builder.setView(rootLayout);
    builder.setPositiveButton("String_Node_Str",new DialogInterface.OnClickListener(){
      @Override public void onClick(      DialogInterface dialogInterface,      int i){
        final int[] usedColors=new int[currentItemText[0]];
        System.arraycopy(colorsText,0,usedColors,0,currentItemText[0]);
        Shader textShader=null;
        int checkedID=orientation.getCheckedRadioButtonId();
        if (checkedID == R.id.horizontal) {
          double angleInRadians=Math.toRadians(90);
          double length=100;
          double endX=Math.cos(angleInRadians) * length;
          double endY=Math.sin(angleInRadians) * HookMethods.editText.getHeight();
          WindowManager wm=(WindowManager)context.getSystemService(Context.WINDOW_SERVICE);
          Display display=wm.getDefaultDisplay();
          Point size=new Point();
          display.getSize(size);
          int width=size.x;
          textShader=new LinearGradient(0,0,width,0,usedColors,null,Shader.TileMode.CLAMP);
        }
 else         if (checkedID == R.id.vertical) {
          textShader=new LinearGradient(0,0,0,HookMethods.editText.getHeight(),usedColors,null,Shader.TileMode.CLAMP);
        }
        HookMethods.editText.getPaint().setShader(textShader);
        HookMethods.editText.setText(HookMethods.editText.getText());
      }
    }
);
    builder.show();
    return;
  }
case 4:
{
  AlertDialog.Builder builder=new AlertDialog.Builder(context);
  Button button_left=new Button(context);
  Button button_center=new Button(context);
  Button button_right=new Button(context);
  LinearLayout linearLayout=new LinearLayout(context);
  linearLayout.setOrientation(LinearLayout.VERTICAL);
  button_left.setText(Common.dialog_left);
  button_left.setOnClickListener(new View.OnClickListener(){
    public void onClick(    View view){
      HookMethods.editText.setGravity(Gravity.LEFT);
    }
  }
);
  button_center.setText(Common.dialog_center);
  button_center.setOnClickListener(new View.OnClickListener(){
    public void onClick(    View view){
      HookMethods.editText.setGravity(Gravity.CENTER);
    }
  }
);
  button_right.setText(Common.dialog_right);
  button_right.setOnClickListener(new View.OnClickListener(){
    public void onClick(    View view){
      HookMethods.editText.setGravity(Gravity.RIGHT);
    }
  }
);
  linearLayout.addView((View)button_left);
  linearLayout.addView((View)button_center);
  linearLayout.addView((View)button_right);
  builder.setView((View)linearLayout);
  builder.setPositiveButton(Common.dialog_done,null);
  builder.show();
  return;
}
case 5:
{
AlertDialog.Builder builder=new AlertDialog.Builder(context);
Button button_bold=new Button(context);
Button button_italic=new Button(context);
Button button_bolditalic=new Button(context);
Button button_normal=new Button(context);
LinearLayout linearLayout=new LinearLayout(context);
linearLayout.setOrientation(LinearLayout.VERTICAL);
button_bold.setText(Common.dialog_bold);
button_bold.setOnClickListener(new View.OnClickListener(){
  public void onClick(  View view){
    HookMethods.editText.setTypeface(null,Typeface.BOLD);
  }
}
);
button_italic.setText(Common.dialog_italic);
button_italic.setOnClickListener(new View.OnClickListener(){
  public void onClick(  View view){
    HookMethods.editText.setTypeface(null,Typeface.ITALIC);
  }
}
);
button_bolditalic.setText(Common.dialog_bolditalic);
button_bolditalic.setOnClickListener(new View.OnClickListener(){
  public void onClick(  View view){
    HookMethods.editText.setTypeface(null,Typeface.BOLD_ITALIC);
  }
}
);
button_normal.setText(Common.dialog_normal);
button_normal.setOnClickListener(new View.OnClickListener(){
  public void onClick(  View view){
    HookMethods.editText.setTypeface(null,Typeface.NORMAL);
  }
}
);
linearLayout.addView((View)button_bold);
linearLayout.addView((View)button_italic);
linearLayout.addView((View)button_bolditalic);
linearLayout.addView((View)button_normal);
builder.setView((View)linearLayout);
builder.setPositiveButton(Common.dialog_done,null);
builder.show();
return;
}
case 6:
{
File folder=new File(Environment.getExternalStorageDirectory() + "String_Node_Str");
if (folder.exists()) {
FilenameFilter filter=new FilenameFilter(){
  @Override public boolean accept(  File dir,  String filename){
    if (filename.lastIndexOf('.') > 0) {
      int lastIndex=filename.lastIndexOf('.');
      String extension=filename.substring(lastIndex);
      if (extension.equalsIgnoreCase("String_Node_Str") || extension.equalsIgnoreCase("String_Node_Str")) {
        return true;
      }
    }
    return false;
  }
}
;
File[] fonts=folder.listFiles(filter);
if (fonts.length > 0) {
  AlertDialog.Builder builder=new AlertDialog.Builder(context);
  builder.setTitle("String_Node_Str");
  builder.setNeutralButton("String_Node_Str",new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
      HookMethods.editText.setTypeface(HookMethods.defTypeface);
    }
  }
);
  builder.setNegativeButton("String_Node_Str",new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialogInterface,    int i){
    }
  }
);
  LinearLayout rootLayout=new LinearLayout(context);
  LinearLayout.LayoutParams rootParams=new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT);
  LayoutInflater inflater=(LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  rootLayout.addView(inflater.inflate(HookMethods.modRes.getLayout(R.layout.font_list),null),rootParams);
  LinearLayout listLayout=(LinearLayout)rootLayout.findViewById(R.id.fontLayout);
  for (  final File font : fonts) {
    String fontname=font.getName().substring(0,font.getName().toLowerCase().lastIndexOf("String_Node_Str"));
    TextView item=new TextView(context);
    item.setLayoutParams(new TableLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.WRAP_CONTENT));
    item.setPadding(0,0,0,2);
    item.setText(fontname);
    item.setTextSize(TypedValue.COMPLEX_UNIT_DIP,22.0f);
    item.setGravity(Gravity.CENTER_HORIZONTAL);
    item.setTypeface(TypefaceUtil.get(font));
    item.setOnClickListener(new View.OnClickListener(){
      @Override public void onClick(      View view){
        HookMethods.editText.setTypeface(TypefaceUtil.get(font));
      }
    }
);
    listLayout.addView(item);
  }
  builder.setView(rootLayout);
  builder.show();
}
 else {
  NotificationUtils.showMessage("String_Node_Str",Color.RED,NotificationUtils.LENGHT_SHORT,HookMethods.classLoader);
}
}
 else {
NotificationUtils.showMessage("String_Node_Str",Color.RED,NotificationUtils.LENGHT_SHORT,HookMethods.classLoader);
}
return;
}
case 7:
{
ColorPickerDialog colorPickerDialog=new ColorPickerDialog(context,HookMethods.editText.getSolidColor(),new ColorPickerDialog.OnColorSelectedListener(){
@Override public void onColorSelected(int color){
HookMethods.editText.setBackgroundColor(color);
}
}
);
colorPickerDialog.setButton(-3,Common.dialog_default,new DialogInterface.OnClickListener(){
@Override public void onClick(DialogInterface dialogInterface,int which){
HookMethods.editText.setBackgroundColor((Color.parseColor("String_Node_Str")));
HookMethods.editText.setAlpha(1);
}
}
);
colorPickerDialog.setTitle(Common.dialog_bgcolour);
colorPickerDialog.show();
return;
}
case 8:
{
AlertDialog.Builder builder=new AlertDialog.Builder(HookMethods.SnapContext);
SeekBar seekBar=new SeekBar(HookMethods.SnapContext);
seekBar.setMax(255);
int currentapiVersion=android.os.Build.VERSION.SDK_INT;
if (currentapiVersion >= Build.VERSION_CODES.KITKAT) {
seekBar.setProgress((int)HookMethods.editText.getBackground().getAlpha());
}
 else {
seekBar.setProgress(255);
}
seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener(){
public void onProgressChanged(SeekBar seekBar3,int n,boolean bl){
HookMethods.editText.getBackground().setAlpha(n);
}
@Override public void onStartTrackingTouch(SeekBar arg0){
}
@Override public void onStopTrackingTouch(SeekBar arg0){
}
}
);
builder.setNeutralButton(Common.dialog_default,new DialogInterface.OnClickListener(){
@Override public void onClick(DialogInterface dialog,int which){
HookMethods.editText.getBackground().setAlpha(153);
}
}
);
builder.setPositiveButton(Common.dialog_done,null);
builder.setView((View)seekBar);
builder.show();
return;
}
case 9:
{
AlertDialog.Builder builder=new AlertDialog.Builder(context);
builder.setTitle("String_Node_Str");
builder.setNegativeButton("String_Node_Str",new DialogInterface.OnClickListener(){
@Override public void onClick(DialogInterface dialogInterface,int i){
}
}
);
final LinearLayout rootLayout=new LinearLayout(context);
LinearLayout.LayoutParams rootParams=new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT);
LayoutInflater inflater=(LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
rootLayout.addView(inflater.inflate(HookMethods.modRes.getLayout(R.layout.gradient_layout),null),rootParams);
final RadioGroup orientation=(RadioGroup)rootLayout.findViewById(R.id.orientation);
final LinearLayout listLayout=(LinearLayout)rootLayout.findViewById(R.id.itemLayout);
final LinearLayout.LayoutParams params=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.WRAP_CONTENT);
for (int i=1; i <= 5; i++) {
Button btn=new Button(context);
btn.setId(i);
final int id_=btn.getId();
btn.setText("String_Node_Str" + id_);
btn.setBackgroundColor(colorsBg[i - 1]);
listLayout.addView(btn,params);
final Button btn1=((Button)listLayout.findViewById(id_));
btn1.setOnClickListener(new View.OnClickListener(){
public void onClick(View view){
ColorPickerDialog colorPickerDialog=new ColorPickerDialog(context,colorsBg[id_ - 1],new ColorPickerDialog.OnColorSelectedListener(){
@Override public void onColorSelected(int color){
  colorsBg[id_ - 1]=color;
  btn1.setBackgroundColor(colorsBg[id_ - 1]);
}
}
);
colorPickerDialog.setTitle("String_Node_Str" + id_);
colorPickerDialog.show();
}
}
);
if (btn1.getId() <= currentItemBg[0]) {
btn1.setVisibility(View.VISIBLE);
}
 else {
btn1.setVisibility(View.GONE);
}
}
Button add=(Button)rootLayout.findViewById(R.id.add);
add.setOnClickListener(new View.OnClickListener(){
@Override public void onClick(View view){
if (currentItemBg[0] < 5) {
currentItemBg[0]++;
listLayout.findViewById(currentItemBg[0]).setVisibility(View.VISIBLE);
}
 else {
Toast.makeText(context,"String_Node_Str",Toast.LENGTH_SHORT).show();
}
}
}
);
Button remove=(Button)rootLayout.findViewById(R.id.remove);
remove.setOnClickListener(new View.OnClickListener(){
@Override public void onClick(View view){
if (currentItemBg[0] > 2) {
listLayout.findViewById(currentItemBg[0]).setVisibility(View.GONE);
currentItemBg[0]--;
}
 else {
Toast.makeText(context,"String_Node_Str",Toast.LENGTH_SHORT).show();
}
}
}
);
builder.setView(rootLayout);
builder.setPositiveButton("String_Node_Str",new DialogInterface.OnClickListener(){
@Override public void onClick(DialogInterface dialogInterface,int i){
final int[] usedColors=new int[currentItemBg[0]];
System.arraycopy(colorsBg,0,usedColors,0,currentItemBg[0]);
PaintDrawable p=new PaintDrawable();
p.setShape(new RectShape());
ShapeDrawable.ShaderFactory sf=new ShapeDrawable.ShaderFactory(){
@Override public Shader resize(int width,int height){
LinearGradient returnGradient=null;
int checkedID=orientation.getCheckedRadioButtonId();
if (checkedID == R.id.horizontal) {
  returnGradient=new LinearGradient(0,0,width,height,usedColors,null,Shader.TileMode.MIRROR);
}
 else if (checkedID == R.id.vertical) {
  double angleInRadians=Math.toRadians(90);
  double length=100;
  double endX=Math.cos(angleInRadians) * length;
  double endY=Math.sin(angleInRadians) * HookMethods.editText.getHeight();
  returnGradient=new LinearGradient(0,0,(float)endX,(float)endY,usedColors,null,Shader.TileMode.MIRROR);
}
return returnGradient;
}
}
;
p.setShaderFactory(sf);
HookMethods.editText.setBackgroundDrawable(p);
}
}
);
builder.show();
return;
}
case 10:
{
HookMethods.editText.setBackgroundDrawable(null);
HookMethods.editText.getPaint().reset();
HookMethods.editText.setTextColor(Color.WHITE);
HookMethods.editText.setBackgroundColor((Color.parseColor("String_Node_Str")));
HookMethods.editText.setGravity(Gravity.CENTER);
HookMethods.editText.setAlpha(1);
HookMethods.editText.getBackground().setAlpha(153);
HookMethods.editText.setTypeface(HookMethods.defTypeface);
HookMethods.editText.setTextSize(TypedValue.COMPLEX_UNIT_PX,32.5125f);
return;
}
default :
return;
}
}
}
);
return rowView;
}