local L0_89
L0_89 = _ENV
L0_89.require("import")
L0_89.require("AndLua")
L0_89.import({
  "android.app.*",
  "android.os.*",
  "android.widget.*",
  "android.view.*",
  "layout"
})
L0_89.activity.setTheme(L0_89.R.Theme_Black)
L0_89.activity.setContentView(L0_89.loadlayout(L0_89.layout))
L0_89.隐藏标题栏()
function L0_89.tg(A0_90, A1_91, A2_92, A3_93)
  local L4_94
  L4_94 = L0_89
  L4_94.import("android.graphics.drawable.GradientDrawable")
  L4_94.import("com.androlua.R$drawable")
  L4_94.import("android.R$drawable")
  if A3_93 == "v" then
    A3_93 = L4_94.GradientDrawable.Orientation.TOP_BOTTOM
  elseif A3_93 == "t" then
    A3_93 = L4_94.GradientDrawable.Orientation.LEFT_RIGHT
  end
  L4_94.drawable = L4_94.GradientDrawable(A3_93, {A1_91, A2_92})
  A0_90.setBackgroundDrawable(L4_94.drawable)
end

L0_89.import("android.graphics.Typeface")
L0_89.import("java.io.File")
function L0_89.font(A0_95, A1_96)
  local L2_97, L3_98
  L2_97 = L0_89
  L3_98 = A0_95.setTypeface
  L3_98(L2_97.Typeface.createFromFile(L2_97.File(L2_97.activity.getLuaDir() .. "/font/" .. A1_96 .. ".ttf")))
end

function L0_89.bold(A0_99)
  local L1_100
  L1_100 = L0_89
  A0_99.getPaint().setFakeBoldText(true)
end

function L0_89.slide_bar(A0_101, A1_102)
  local L2_103
  L2_103 = L0_89
  L2_103.import("android.graphics.PorterDuff")
  A0_101.ProgressDrawable.setColorFilter(L2_103.PorterDuffColorFilter(A1_102, L2_103.PorterDuff.Mode.SRC_ATOP))
end

function L0_89.csb(A0_104, A1_105)
  local L2_106
  L2_106 = L0_89
  L2_106.import("android.graphics.PorterDuffColorFilter")
  L2_106.import("android.graphics.PorterDuff")
  A0_104.Thumb.setColorFilter(L2_106.PorterDuffColorFilter(A1_105, L2_106.PorterDuff.Mode.SRC_ATOP))
end

function L0_89.re(A0_107, A1_108)
  local L2_109
  L2_109 = L0_89
  L2_109.Pretend = L2_109.activity.Resources.getDrawable(L2_109.activity.obtainStyledAttributes({
    L2_109.android.R.attr.selectableItemBackgroundBorderless
  }).getResourceId(0, 0))
  L2_109.Pretend.setColor(L2_109.ColorStateList(L2_109.int[0].class({
    L2_109.int({})
  }), L2_109.nt({A1_108})))
  A0_107.setBackground(L2_109.Pretend.setColor(L2_109.ColorStateList(L2_109.int[0].class({
    L2_109.int({})
  }), L2_109.int({A1_108}))))
end

function L0_89.border(A0_110, A1_111, A2_112, A3_113, A4_114)
  local L5_115
  L5_115 = L0_89
  L5_115.import("android.graphics.drawable.GradientDrawable")
  L5_115.drawable = L5_115.GradientDrawable()
  L5_115.drawable.setShape(L5_115.GradientDrawable.RECTANGLE)
  L5_115.drawable.setStroke(A1_111, L5_115.tonumber(A2_112))
  L5_115.drawable.setColor(L5_115.tonumber(A3_113))
  L5_115.drawable.setCornerRadius(A4_114)
  A0_110.BackgroundDrawable = L5_115.drawable
end

function L0_89.ebcc(A0_116, A1_117)
  local L2_118
  L2_118 = L0_89
  L2_118.import("android.content.res.ColorStateList")
  A0_116.getTextCursorDrawable().setTintList(L2_118.ColorStateList.valueOf(A1_117))
end

function L0_89.cm(A0_119, A1_120, A2_121)
  local L3_122, L4_123, L5_124
  L3_122 = L0_89
  L4_123 = A0_119 / 100
  L5_124 = A1_120 - A2_121
  L4_123 = L4_123 * L5_124
  L4_123 = A1_120 - L4_123
  if A2_121 > L4_123 then
    L4_123 = A2_121
    return L4_123
  else
    return L4_123
  end
end

function L0_89.toast(A0_125, A1_126)
  local L2_127
  L2_127 = L0_89
  L2_127.toast_layout = {
    L2_127.LinearLayout,
    orientation = "vertical",
    {
      L2_127.LinearLayout,
      gravity = "center",
      layout_width = "wrap_content",
      layout_height = "wrap_content",
      {
        L2_127.CardView,
        layout_marginLeft = "10dp",
        radius = "15dp",
        layout_width = "wrap_content",
        layout_marginBottom = "10dp",
        CardElevation = "0dp",
        layout_marginRight = "10dp",
        layout_marginTop = "10dp",
        backgroundColor = "0xFF38393B",
        layout_height = "wrap_content",
        {
          L2_127.LinearLayout,
          layout_marginLeft = "10%w",
          layout_gravity = "right",
          gravity = "center",
          layout_width = "wrap_content",
          layout_height = "5%h",
          {
            L2_127.TextView,
            layout_marginLeft = "5dp",
            id = "text_toast",
            layout_marginRight = "10dp",
            textSize = "14sp",
            textColor = "0xFFFFFFFF"
          }
        },
        {
          L2_127.LinearLayout,
          gravity = "center",
          layout_height = "5%h",
          layout_width = "10%w",
          layout_gravity = "left",
          {
            L2_127.ImageView,
            padding = "5dp",
            src = "icon.png",
            id = "image_toast"
          }
        }
      }
    }
  }
  L2_127.布局 = L2_127.loadlayout(L2_127.toast_layout)
  L2_127.image_toast.setImageBitmap(L2_127.loadbitmap(L2_127.activity.getLuaDir() .. "/resource/" .. A0_125))
  L2_127.text_toast.setText(A1_126)
end

function L0_89.ll(A0_128, A1_129)
  local L2_130
  L2_130 = L0_89
  L2_130.import("android.graphics.PorterDuff")
  A0_128.getBackground().setColorFilter(A1_129, L2_130.PorterDuff.Mode.ADD)
end

function L0_89.sl(A0_131, A1_132)
  local L2_133
  L2_133 = L0_89
  L2_133.import("android.graphics.PorterDuffColorFilter")
  A0_131.getBackground().setColorFilter(L2_133.PorterDuffColorFilter(A1_132, L2_133.PorterDuff.Mode.SRC_ATOP))
end

function L0_89.cfillet(A0_134, A1_135, A2_136)
  local L3_137
  L3_137 = L0_89
  L3_137.drawable = L3_137.GradientDrawable()
  L3_137.drawable.setShape(L3_137.GradientDrawable.RECTANGLE)
  L3_137.drawable.setColor(A1_135)
  L3_137.drawable.setCornerRadii({
    A2_136,
    A2_136,
    A2_136,
    A2_136,
    A2_136,
    A2_136,
    A2_136,
    A2_136
  })
  A0_134.setBackgroundDrawable(L3_137.drawable)
end

function L0_89.font_batch(A0_138, A1_139, A2_140)
  local L3_141
  L3_141 = L0_89
  for _FORV_9_ = L3_141.tonumber(L3_141.string.match(A0_138, "%d+")), L3_141.tonumber(L3_141.string.match(A1_139, "%d+")) do
    L3_141.activity.getWindow().getDecorView().findViewById((L3_141.string.gsub(A0_138, "%d+", L3_141.tostring(_FORV_9_)))):setTypeface(L3_141.Typeface.createFromFile(L3_141.File(L3_141.activity.getLuaDir() .. "/font/" .. A2_140 .. ".ttf")))
  end
end

function L0_89.hide(A0_142)
  A0_142.setVisibility(L0_89.View.GONE)
  return true
end

function L0_89.show(A0_143)
  A0_143.setVisibility(L0_89.View.VISIBLE)
  return true
end

function L0_89.edit_dialog(A0_144, A1_145)
  local L2_146
  L2_146 = L0_89
  L2_146.edit_layout = {
    L2_146.LinearLayout,
    orientation = "vertical",
    gravity = "center",
    {
      L2_146.CardView,
      layout_height = "wrap_content",
      radius = "15dp",
      backgroundColor = "0xFF38393B",
      layout_width = "wrap_content",
      CardElevation = "0dp",
      layout_gravity = "center",
      {
        L2_146.LinearLayout,
        layout_width = "wrap_content",
        orientation = "vertical",
        layout_height = "wrap_content",
        {
          L2_146.LinearLayout,
          layout_width = "match_parent",
          layout_height = "wrap_content",
          layout_gravity = "top",
          gravity = "center",
          {
            L2_146.TextView,
            textSize = "18sp",
            id = "text_title",
            textColor = "0xFFFFFFFF",
            layout_marginBottom = "5dp",
            layout_marginTop = "10dp",
            layout_marginRight = "15dp",
            layout_marginLeft = "15dp"
          }
        },
        {
          L2_146.LinearLayout,
          layout_width = "match_parent",
          layout_gravity = "center",
          gravity = "center",
          {
            L2_146.EditText,
            hintTextColor = "0xB1FFFFFF",
            textSize = "15sp",
            id = "edit_dialog",
            textColor = "0xFFFFFFFF",
            layout_marginBottom = "5dp",
            layout_marginTop = "10dp",
            layout_marginRight = "10dp",
            layout_marginLeft = "10dp"
          }
        },
        {
          L2_146.LinearLayout,
          layout_width = "match_parent",
          layout_gravity = "bottom",
          gravity = "center",
          {
            L2_146.LinearLayout,
            gravity = "center",
            layout_marginBottom = "10dp",
            layout_marginTop = "10dp",
            layout_marginRight = "5dp",
            layout_marginLeft = "5dp",
            {
              L2_146.CardView,
              radius = "15dp",
              layout_marginBottom = "5dp",
              layout_marginTop = "5dp",
              layout_marginRight = "5dp",
              layout_marginLeft = "5dp",
              {
                L2_146.CardView,
                id = "card_cancle",
                radius = "15dp",
                {
                  L2_146.TextView,
                  layout_marginLeft = "15dp",
                  textSize = "14sp",
                  id = "cancle",
                  textColor = "0xFFFFFFFF",
                  layout_marginBottom = "10dp",
                  layout_marginTop = "10dp",
                  layout_marginRight = "15dp",
                  text = "取消"
                }
              }
            }
          },
          {
            L2_146.LinearLayout,
            layout_marginBottom = "10dp",
            layout_marginTop = "10dp",
            layout_marginRight = "5dp",
            gravity = "center",
            {
              L2_146.CardView,
              radius = "15dp",
              layout_marginBottom = "5dp",
              layout_marginTop = "5dp",
              layout_marginRight = "5dp",
              layout_marginLeft = "5dp",
              {
                L2_146.CardView,
                radius = "15dp",
                id = "card_confirm",
                {
                  L2_146.TextView,
                  layout_marginLeft = "15dp",
                  textSize = "14sp",
                  id = "confirm",
                  textColor = "0xFFFFFFFF",
                  layout_marginBottom = "10dp",
                  layout_marginTop = "10dp",
                  layout_marginRight = "15dp",
                  text = "确定"
                }
              }
            }
          }
        }
      }
    }
  }
  L2_146.xxx = L2_146.AlertDialog.Builder(L2_146.this)
  L2_146.xxx.setView(L2_146.loadlayout(L2_146.edit_layout))
  L2_146.xxx.setPositiveButton("确定", function()
    local L0_147, L1_148
    L0_147 = L2_146
  end
  )
  L2_146.xxx.setNegativeButton("取消", nil)
  L2_146.xxx.setNeutralButton("其他", nil)
  L2_146.xxx = L2_146.xxx.show()
  L2_146.xxx.creat()
  L2_146.import("android.graphics.drawable.ColorDrawable")
  L2_146.tc_edit1.getWindow().setBackgroundDrawable(L2_146.ColorDrawable(0))
  L2_146.text_title.setText(A0_144)
  L2_146.edit_dialog.setHint(" " .. A1_145 .. " ")
  L2_146.import("android.content.res.ColorStateList")
  L2_146.edit_dialog.getTextCursorDrawable().setTintList(L2_146.ColorStateList.valueOf(4278238975))
  L2_146.import("android.graphics.PorterDuff")
  L2_146.edit_dialog.getBackground().setColorFilter(4294967295, L2_146.PorterDuff.Mode.ADD)
  L2_146.import("android.graphics.PorterDuffColorFilter")
  L2_146.edit_dialog.getBackground().setColorFilter(L2_146.PorterDuffColorFilter(4294967295, L2_146.PorterDuff.Mode.SRC_ATOP))
  L2_146.import("android.graphics.drawable.GradientDrawable")
  L2_146.drawable = L2_146.GradientDrawable()
  L2_146.drawable.setShape(L2_146.GradientDrawable.RECTANGLE)
  L2_146.drawable.setStroke(2, L2_146.tonumber("0xFFFFFFFF"))
  L2_146.drawable.setColor(L2_146.tonumber("0xFF38393B"))
  L2_146.drawable.setCornerRadius(10)
  L2_146.edit_dialog.BackgroundDrawable = L2_146.drawable
  L2_146.import("android.graphics.drawable.GradientDrawable")
  L2_146.import("com.androlua.R$drawable")
  L2_146.import("android.R$drawable")
  L2_146.direction = L2_146.GradientDrawable.Orientation.LEFT_RIGHT
  L2_146.drawable = L2_146.GradientDrawable(L2_146.direction, {1543503872, 570425348})
  L2_146.card_cancle.setBackgroundDrawable(L2_146.drawable)
  L2_146.drawable1 = L2_146.GradientDrawable(L2_146.direction, {4285297151, 4278238975})
  L2_146.card_confirm.setBackgroundDrawable(L2_146.drawable1)
  function L2_146.cancle.onClick()
    L2_146.xxx.dismiss()
    return false
  end
  
  function L2_146.confirm.onClick()
    local L0_149
    L0_149 = L2_146
    L0_149.xxx.dismiss()
    return L0_149.edit_dialog.getText()
  end
  
end

