package com.pas.abtahibo.parvaz;

import android.widget.SeekBar;
import android.graphics.PorterDuff;
import java.io.File;
  import android.animation.ObjectAnimator; import android.view.View;
  import android.text.StaticLayout;
  import android.text.Layout.Alignment;
  import android.widget.TextView;
import android.text.Html;

import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.B4AClass;
import anywheresoftware.b4a.BALayout;
import anywheresoftware.b4a.debug.*;

public class javaclass extends B4AClass.ImplB4AClass implements BA.SubDelegator{
    private static java.util.HashMap<String, java.lang.reflect.Method> htSubs;
    private void innerInitialize(BA _ba) throws Exception {
        if (ba == null) {
            ba = new BA(_ba, this, htSubs, "com.pas.abtahibo.parvaz.javaclass");
            if (htSubs == null) {
                ba.loadHtSubs(this.getClass());
                htSubs = ba.htSubs;
            }
            
        }
        if (BA.isShellModeRuntimeCheck(ba)) 
			   this.getClass().getMethod("_class_globals", com.pas.abtahibo.parvaz.javaclass.class).invoke(this, new Object[] {null});
        else
            ba.raiseEvent2(null, true, "class_globals", false);
    }

 public anywheresoftware.b4a.keywords.Common __c = null;
public anywheresoftware.b4j.object.JavaObject _vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv7 = null;
public b4a.example.dateutils _vvvvvvvvvvvvvvvv1 = null;
public com.pas.abtahibo.parvaz.main _vvvvvvvvvvvvvvvv2 = null;
public com.pas.abtahibo.parvaz.actbook _vvvvvvvvvvvvvvvv3 = null;
public com.pas.abtahibo.parvaz.actapps _vvvvvvvvvvvvvvvv4 = null;
public com.pas.abtahibo.parvaz.actguide _vvvvvvvvvvvvvvvv5 = null;
public com.pas.abtahibo.parvaz.actnotific _vvvvvvvvvvvvvvvv6 = null;
public com.pas.abtahibo.parvaz.func _vvvvvvvvvvvvvvvv7 = null;
public com.pas.abtahibo.parvaz.myservice _vvvvvvvvvvvvvvvv0 = null;
public com.pas.abtahibo.parvaz.playservicebook _vvvvvvvvvvvvvvvvv1 = null;
public com.pas.abtahibo.parvaz.playsrds _vvvvvvvvvvvvvvvvv2 = null;
public com.pas.abtahibo.parvaz.starter _vvvvvvvvvvvvvvvvv3 = null;
public com.pas.abtahibo.parvaz.support _vvvvvvvvvvvvvvvvv4 = null;
public com.pas.abtahibo.parvaz.urls _vvvvvvvvvvvvvvvvv5 = null;
public com.pas.abtahibo.parvaz.xuiviewsutils _vvvvvvvvvvvvvvvvv6 = null;
public String  _v0(anywheresoftware.b4a.objects.ConcreteViewWrapper _seek1,int _color1,int _color2) throws Exception{
 //BA.debugLineNum = 9;BA.debugLine="Public Sub ChangeColorSeekbar(seek1 As View,color1";
 //BA.debugLineNum = 10;BA.debugLine="jo.RunMethod(\"changecolorseek\",Array As Object(se";
_vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv7.RunMethod("changecolorseek",new Object[]{(Object)(_seek1.getObject()),(Object)(_color1),(Object)(_color2)});
 //BA.debugLineNum = 11;BA.debugLine="End Sub";
return "";
}
public String  _class_globals() throws Exception{
 //BA.debugLineNum = 1;BA.debugLine="Sub Class_Globals";
 //BA.debugLineNum = 2;BA.debugLine="Dim jo As JavaObject";
_vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv7 = new anywheresoftware.b4j.object.JavaObject();
 //BA.debugLineNum = 3;BA.debugLine="End Sub";
return "";
}
public String  _vvv3(String _s11) throws Exception{
 //BA.debugLineNum = 13;BA.debugLine="Public Sub hazf(s11 As String)";
 //BA.debugLineNum = 14;BA.debugLine="jo.RunMethod(\"deleteRecursive\",Array(s11))";
_vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv7.RunMethod("deleteRecursive",new Object[]{(Object)(_s11)});
 //BA.debugLineNum = 15;BA.debugLine="End Sub";
return "";
}
public String  _vvv5(anywheresoftware.b4a.objects.LabelWrapper _label1,String _text,int _offset) throws Exception{
 //BA.debugLineNum = 21;BA.debugLine="Public Sub heightView(Label1 As Label,Text As Stri";
 //BA.debugLineNum = 22;BA.debugLine="Label1.Height = jo.RunMethod(\"MeasureMultilineTex";
_label1.setHeight((int) ((double)(BA.ObjectToNumber(_vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv7.RunMethod("MeasureMultilineTextHeight",new Object[]{(Object)(_label1.getObject()),(Object)(1.0f)})))+_offset));
 //BA.debugLineNum = 23;BA.debugLine="End Sub";
return "";
}
public String  _initialize(anywheresoftware.b4a.BA _ba) throws Exception{
innerInitialize(_ba);
 //BA.debugLineNum = 5;BA.debugLine="Public Sub Initialize";
 //BA.debugLineNum = 6;BA.debugLine="jo.InitializeNewInstance(Application.PackageName&";
_vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv7.InitializeNewInstance(__c.Application.getPackageName()+".javaclass.TestThis",new Object[]{__c.Null});
 //BA.debugLineNum = 7;BA.debugLine="End Sub";
return "";
}
public String  _vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv5(String _text) throws Exception{
 //BA.debugLineNum = 25;BA.debugLine="Public Sub RemoveHtml1Tags (Text As String) As Str";
 //BA.debugLineNum = 26;BA.debugLine="Return jo.RunMethod(\"removeHtm2lTags\",Array(Text";
if (true) return BA.ObjectToString(_vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv7.RunMethod("removeHtm2lTags",new Object[]{(Object)(_text)}));
 //BA.debugLineNum = 27;BA.debugLine="End Sub";
return "";
}
public String  _vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv6(anywheresoftware.b4a.objects.ConcreteViewWrapper _view,boolean _expanded) throws Exception{
 //BA.debugLineNum = 17;BA.debugLine="Public Sub StartArrowAnimation(view As View,Expand";
 //BA.debugLineNum = 18;BA.debugLine="jo.RunMethod(\"StartArrowAnimation\",Array(Expanded";
_vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv7.RunMethod("StartArrowAnimation",new Object[]{(Object)(_expanded),(Object)(_view.getObject())});
 //BA.debugLineNum = 19;BA.debugLine="End Sub";
return "";
}
public Object callSub(String sub, Object sender, Object[] args) throws Exception {
BA.senderHolder.set(sender);
return BA.SubDelegator.SubNotFound;
}

public class TestThis{
 
public void changecolorseek(SeekBar seekBar,int progresscolor,int thumbcolor){
	seekBar.getProgressDrawable().setColorFilter(progresscolor, PorterDuff.Mode.SRC_IN);
	seekBar.getThumb().setColorFilter(thumbcolor, PorterDuff.Mode.SRC_IN);
}
 
  public void deleteRecursive(String path) {
    File dir = new File(path); 
      if (dir.isDirectory())
          for (File child : dir.listFiles())
              deleteRecursive(child.toString());

      dir.delete();
  } 

  public void StartArrowAnimation(boolean expanded,View mArrow) {
        float start, target; if (expanded) {start = 0f; target = 90f; } else {start = 90f; target = 0f;}
        ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(mArrow, View.ROTATION, start, target);
        objectAnimator.setDuration(300); objectAnimator.start(); }

  


    public int MeasureMultilineTextHeight(TextView Label, float linehieght) {
    	StaticLayout sl = new StaticLayout(Label.getText(), Label.getPaint(),
    	Label.getLayoutParams().width - Label.getPaddingLeft() - Label.getPaddingRight(),
    	Alignment.ALIGN_NORMAL, linehieght, 0 , true);
    	return sl.getLineTop(sl.getLineCount());
    }

 
    public String removeHtm2lTags(String text){
        final String fText = text.replaceAll("\\n","<br>");

        if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.N) {
             return Html.fromHtml(fText,Html.FROM_HTML_MODE_LEGACY).toString();
        } else {
            return Html.fromHtml(fText).toString();
        }
    }
	
 

}

}
