اینم سورس برنامم اگر تونستید یک منو شبیه متریال اضافه کنید یا بگید مشکل از کجا هست؟(منو در سورس حذف شد)
اینم کد :
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: false
#End Region
Sub Process_Globals
Dim timer1 As Timer
Dim tm As Timer
End Sub
Sub Globals
Private EditText1 As EditText
Private EditText2 As EditText
Private webview1 As WebView
Dim web As WebViewExtras
Private Label1 As Label
Private button1 As Button
Private Button2 As Button
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("layout1")
EditText1.TextColor= Colors.Black
EditText2.TextColor= Colors.Black
EditText2.Hint="پسورد"
EditText1.Hint="نام کاربری"
EditText1.HintColor=Colors.Black
EditText2.HintColor=Colors.Black
EditText1.Gravity=Gravity.RIGHT
EditText2.Gravity=Gravity.RIGHT
Label1.Gravity=Gravity.CENTER
Label1.TextColor= Colors.Black
Label1.Text="یوزرمن فارسی"
webview1.LoadUrl("http://portal.userman.net")
web.AddJavascriptInterface(webview1,"learnnet")
web.addWebChromeClient(webview1,"")
ProgressDialogShow2("loadding",False)
webview1.Visible=False
webview1.ZoomEnabled=False
tm.Initialize("tm",5)
tm.Enabled = True
If webview1.Url.Contains("https://portal.userman.net/login") Then
webview1.Visible=False
webview1.Enabled=False
EditText1.Visible=True
EditText2.Visible=True
EditText1.Enabled=True
EditText2.Enabled=True
button1.Enabled=True
Else
webview1.Visible=True
webview1.Enabled=True
EditText1.Visible=False
EditText2.Visible=False
button1.Visible=False
EditText1.Enabled=False
EditText2.Enabled=False
button1.Enabled=False
End If
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub webview1_pageFinished (Url As String)
ProgressDialogHide
web.executeJavascript(webview1,"learnnet.cullsub('getHtml',true,document.documentElment.outerHTML)")
If webview1.Url.Contains("https://portal.userman.net/welcome")=True Then
webview1.Visible=True
EditText1.Visible=False
EditText2.Visible=False
button1.Visible=False
EditText1.Enabled=False
EditText2.Enabled=False
button1.Enabled=False
Else
End If
End Sub
Sub getHTML(amir As String)
amir= amir.Replace("""","'")
End Sub
Sub EditText1_TextChanged (Old As String, New As String)
web.executeJavascript(webview1,"document.getElementsByClassName('mtik-username tooltips')[0].value = '"&New&"'")
End Sub
Sub EditText2_TextChanged (Old As String, New As String)
web.executeJavascript(webview1,"document.getElementsByClassName('mtik-password tooltips')[0].value = '"&New&"'")
End Sub
Sub Button1_Click
web.executeJavascript(webview1,"document.getElementsByClassName('btn btn-block login-btn')[0].click();")
timer1.Initialize("Timer1",1000)
timer1.Enabled = True
End Sub
Sub timer1_Tick
timer1.Enabled = False
If webview1.Url.Contains("https://portal.userman.net/welcome")= True Then
webview1.Visible=True
EditText1.Visible=False
EditText2.Visible=False
button1.Visible=False
EditText1.Enabled=False
EditText2.Enabled=False
button1.Enabled=False
EditText1.Text=""
EditText2.Text=""
Else
Msgbox("مشخصات اشتباه است","خطا")
EditText1.Text=""
EditText2.Text=""
End If
End Sub
Sub tm_Tick
If webview1.Url.Contains("https://portal.userman.net/login")= True Then
webview1.Visible=False
webview1.Enabled=False
EditText1.Visible=True
EditText2.Visible=True
button1.Visible=True
EditText1.Enabled=True
EditText2.Enabled=True
button1.Enabled=True
End If
End Sub
Sub Activity_KeyPress (KeyCode As Int) As Boolean
If KeyCode = KeyCodes.KEYCODE_BACK Then
Dim i As Int
i = Msgbox2 ("میخواهید از برنامه خارج شوید "," خارج شدن","بله ","خیر","",Null)
If i = DialogResponse.POSITIVE Then
ExitApplication
Else If i = DialogResponse.CANCEL Then
Return True
Else If i = DialogResponse.NEGATIVE Then
End If
Else If KeyCode = KeyCodes.KEYCODE_MENU Then
End If
End Sub
سوال
mostafa.kasiri 115
با سلام ببخشید من دوباره تاپیک با همین عنوان میزنم چون مشکلم حل نشد
من الان سورسم درست هست بدون منو
اما وقتی منو شبیه متریال اضافه میکنم به تایمر ها ایراد میگیره
اینم سورس برنامم اگر تونستید یک منو شبیه متریال اضافه کنید یا بگید مشکل از کجا هست؟(منو در سورس حذف شد)
اینم کد :
#Region Activity Attributes #FullScreen: False #IncludeTitle: false #End Region Sub Process_Globals Dim timer1 As Timer Dim tm As Timer End Sub Sub Globals Private EditText1 As EditText Private EditText2 As EditText Private webview1 As WebView Dim web As WebViewExtras Private Label1 As Label Private button1 As Button Private Button2 As Button End Sub Sub Activity_Create(FirstTime As Boolean) Activity.LoadLayout("layout1") EditText1.TextColor= Colors.Black EditText2.TextColor= Colors.Black EditText2.Hint="پسورد" EditText1.Hint="نام کاربری" EditText1.HintColor=Colors.Black EditText2.HintColor=Colors.Black EditText1.Gravity=Gravity.RIGHT EditText2.Gravity=Gravity.RIGHT Label1.Gravity=Gravity.CENTER Label1.TextColor= Colors.Black Label1.Text="یوزرمن فارسی" webview1.LoadUrl("http://portal.userman.net") web.AddJavascriptInterface(webview1,"learnnet") web.addWebChromeClient(webview1,"") ProgressDialogShow2("loadding",False) webview1.Visible=False webview1.ZoomEnabled=False tm.Initialize("tm",5) tm.Enabled = True If webview1.Url.Contains("https://portal.userman.net/login") Then webview1.Visible=False webview1.Enabled=False EditText1.Visible=True EditText2.Visible=True EditText1.Enabled=True EditText2.Enabled=True button1.Enabled=True Else webview1.Visible=True webview1.Enabled=True EditText1.Visible=False EditText2.Visible=False button1.Visible=False EditText1.Enabled=False EditText2.Enabled=False button1.Enabled=False End If End Sub Sub Activity_Resume End Sub Sub Activity_Pause (UserClosed As Boolean) End Sub Sub webview1_pageFinished (Url As String) ProgressDialogHide web.executeJavascript(webview1,"learnnet.cullsub('getHtml',true,document.documentElment.outerHTML)") If webview1.Url.Contains("https://portal.userman.net/welcome")=True Then webview1.Visible=True EditText1.Visible=False EditText2.Visible=False button1.Visible=False EditText1.Enabled=False EditText2.Enabled=False button1.Enabled=False Else End If End Sub Sub getHTML(amir As String) amir= amir.Replace("""","'") End Sub Sub EditText1_TextChanged (Old As String, New As String) web.executeJavascript(webview1,"document.getElementsByClassName('mtik-username tooltips')[0].value = '"&New&"'") End Sub Sub EditText2_TextChanged (Old As String, New As String) web.executeJavascript(webview1,"document.getElementsByClassName('mtik-password tooltips')[0].value = '"&New&"'") End Sub Sub Button1_Click web.executeJavascript(webview1,"document.getElementsByClassName('btn btn-block login-btn')[0].click();") timer1.Initialize("Timer1",1000) timer1.Enabled = True End Sub Sub timer1_Tick timer1.Enabled = False If webview1.Url.Contains("https://portal.userman.net/welcome")= True Then webview1.Visible=True EditText1.Visible=False EditText2.Visible=False button1.Visible=False EditText1.Enabled=False EditText2.Enabled=False button1.Enabled=False EditText1.Text="" EditText2.Text="" Else Msgbox("مشخصات اشتباه است","خطا") EditText1.Text="" EditText2.Text="" End If End Sub Sub tm_Tick If webview1.Url.Contains("https://portal.userman.net/login")= True Then webview1.Visible=False webview1.Enabled=False EditText1.Visible=True EditText2.Visible=True button1.Visible=True EditText1.Enabled=True EditText2.Enabled=True button1.Enabled=True End If End Sub Sub Activity_KeyPress (KeyCode As Int) As Boolean If KeyCode = KeyCodes.KEYCODE_BACK Then Dim i As Int i = Msgbox2 ("میخواهید از برنامه خارج شوید "," خارج شدن","بله ","خیر","",Null) If i = DialogResponse.POSITIVE Then ExitApplication Else If i = DialogResponse.CANCEL Then Return True Else If i = DialogResponse.NEGATIVE Then End If Else If KeyCode = KeyCodes.KEYCODE_MENU Then End If End Sub
لینک ارسال
به اشتراک گذاری در سایت های دیگر
0 پاسخ به این سوال تاکنون داده شده است
ارسالهای توصیه شده
بایگانی شده
این موضوع بایگانی و قفل شده و دیگر امکان ارسال پاسخ نیست.