﻿B4A=true
Group=Class
ModulesStructureVersion=1
Type=Class
Version=10.6
@EndOfDesignText@
Sub Class_Globals
	Dim jo As JavaObject
End Sub
 
Public Sub Initialize
	jo.InitializeNewInstance(Application.PackageName&".javaclass.TestThis", Array(Null))
End Sub

Public Sub ChangeColorSeekbar(seek1 As View,color1 As Int,color2 As Int)
	jo.RunMethod("changecolorseek",Array As Object(seek1,color1,color2))
End Sub
 
Public Sub hazf(s11 As String)
	jo.RunMethod("deleteRecursive",Array(s11))
End Sub

Public Sub StartArrowAnimation(view As View,Expanded As Boolean)
	jo.RunMethod("StartArrowAnimation",Array(Expanded,view))
End Sub

Public Sub heightView(Label1 As Label,Text As String,offset As Int)
	Label1.Height = jo.RunMethod("MeasureMultilineTextHeight",Array(Label1,1.0f)) + offset
End Sub

Public Sub RemoveHtml1Tags (Text As String) As String
 	Return jo.RunMethod("removeHtm2lTags",Array(Text))
End Sub

 
#if JAVA

public class TestThis{
 
import android.widget.SeekBar;
import android.graphics.PorterDuff;
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);
}
 
import java.io.File;
  public void deleteRecursive(String path) {
    File dir = new File(path); 
      if (dir.isDirectory())
          for (File child : dir.listFiles())
              deleteRecursive(child.toString());

      dir.delete();
  } 

  import android.animation.ObjectAnimator; import android.view.View;
  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(); }

  

  import android.text.StaticLayout;
  import android.text.Layout.Alignment;
  import android.widget.TextView;

    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());
    }

 
import android.text.Html;
    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();
        }
    }
	
 

}

#end if
