MR.B4A 246 ارسال شده در 26 تیر اشتراک گذاری ارسال شده در 26 تیر با استفاده از این مینی سورس کد، میتوانید با زدن یک دکمه، تم برنامه تان را تغییر دهید. در این سورس چندتا تم آوردم که با کدنویسی میتوانید آن ها را تغییر دهید. سورس: این سورس ها را در برنامه تان کپی کنید: Sub Process_Globals Private Theme_Value As Int End Sub Sub Globals Private res As XmlLayoutBuilder Private run As RuntimePermissions Private ProgressBar1 As ProgressBar Private Spinner1 As Spinner End Sub Sub Activity_Create(FirstTime As Boolean) Activity.LoadLayout("1") ProgressBar1.Progress = 50 Spinner1.AddAll(Array("Item 1", "Item 2", "Item 3")) run.CheckAndRequest(run.PERMISSION_WRITE_EXTERNAL_STORAGE) End Sub Private Sub activity_PermissionResult (Permission As String, Result As Boolean) End Sub Sub btnHolo_Click SetTheme(res.GetResourceId("style", "android:style/Theme.Holo")) End Sub Sub btnHoloLight_Click SetTheme(res.GetResourceId("style", "android:style/Theme.Holo.Light")) End Sub Sub btnHoloLightDark_Click SetTheme(res.GetResourceId("style", "android:style/Theme.Holo.Light.DarkActionBar")) End Sub Sub btnOld_Click SetTheme(16973829) End Sub Sub btnMaterialLightDark_Click SetTheme(res.GetResourceId("style", "android:style/Theme.Material.Light.DarkActionBar")) End Sub Sub btnMaterialLight_Click SetTheme(res.GetResourceId("style", "android:style/Theme.Material.Light")) End Sub Sub btnMaterial_Click SetTheme(res.GetResourceId("style", "android:style/Theme.Material")) End Sub Private Sub SetTheme (Theme As Int) If Theme = 0 Then ToastMessageShow("Theme not available.", False) Return End If If Theme = Theme_Value Then Return File.WriteString(File.DirInternal, "theme.txt", Theme) Theme_Value = Theme Activity.Finish StartActivity(Me) End Sub #if java import anywheresoftware.b4a.objects.streams.*; public void _onCreate() { try { if (File.Exists(getFilesDir().toString(), "theme.txt")) _theme_value = Integer.parseInt(File.ReadString(getFilesDir().toString(), "theme.txt")); } catch (Exception e) { throw new RuntimeException(e); } if (_theme_value != 0) setTheme(_theme_value); } #end if تمام طراح و تهیه کننده: مرتضی صباغی MR.B4A لینک کانال ایتا: https://eitaa.com/basic4androidlan لینک کانال روبیکا: https://web.rubika.ir/#c=c0DYTXf0c992f816317cf4280db0333a نقل قول لینک ارسال به اشتراک گذاری در سایت های دیگر تنظیمات بیشتر اشتراک گذاری ...
ارسالهای توصیه شده
به گفتگو بپیوندید
هم اکنون می توانید مطلب خود را ارسال نمایید و بعداً ثبت نام کنید. اگر حساب کاربری دارید، برای ارسال با حساب کاربری خود اکنون وارد شوید .
توجه: strong> مطلب ارسالی شما پس از تایید مدیریت برای همه قابل رویت خواهد بود.