Esempio n. 1
0
        private void savedsettings()
        {
            try
            {
                UISettings uiColor = new UISettings();
                gdRectfillColor.Background = new SolidColorBrush(uiColor.GetColorValue(UIColorType.AccentDark2));
                MainGrid.Background        = new SolidColorBrush(uiColor.GetColorValue(UIColorType.AccentDark3));
            }
            catch (Exception)
            {
                gdRectfillColor.Background = UtilityData.ScrollBrush;
            }
            var titleBar = ApplicationView.GetForCurrentView().TitleBar;

            titleBarColor = (Color)titleBar.BackgroundColor;
            UtilityClass.titlebar(scbBrush: (SolidColorBrush)gdRectfillColor.Background);

            _ucInAppPurchase.btIAPFixLicense.Background = gdRectfillColor.Background;

            if (UtilityData.isFluentDesign)
            {
                HeaderBrush = new AcrylicBrush
                {
                    FallbackColor    = ((SolidColorBrush)gdRectfillColor.Background).Color,
                    TintColor        = ((SolidColorBrush)gdRectfillColor.Background).Color,
                    TintOpacity      = 0.5,
                    BackgroundSource = AcrylicBackgroundSource.Backdrop
                };
                //SetAcrylicBackground(rpMain, 0.8);
                SetAcrylicBackground(gdRectfillColor, 0.7);
                SetAcrylicBackground(MainGrid, 0.6);
                _ucInAppPurchase.btIAPFixLicense.Background = gdRectfillColor.Background;
            }
            else
            {
                HeaderBrush = gdRectfillColor.Background;
            }
            if (vsgMain.CurrentState != null && vsgMain.CurrentState.Name == vsMobile.Name)
            {
                gdHeader.Background = HeaderBrush;
            }
        }
Esempio n. 2
0
 private void web_ContentLoading(WebView sender, WebViewContentLoadingEventArgs args)
 {
     style();
     if (args.Uri.AbsoluteUri.Contains("www.instagram.com/p/"))
     {
         if (gdDownloadPhotoOverlay == null)
         {
             this.FindName("gdDownloadPhotoOverlay");
             UtilityClass.TranslationAnimation(_compositor, gdDownloadPhotoOverlay, false);
         }
         gdDownloadPhotoOverlay.Visibility = Visibility.Visible;
     }
     else
     {
         if (gdDownloadPhotoOverlay != null)
         {
             gdDownloadPhotoOverlay.Visibility = Visibility.Collapsed;
         }
     }
 }
Esempio n. 3
0
        private void BtDLPhotoLink_Click(object sender, RoutedEventArgs e)
        {
            if (gdImageDownloadContainer == null)
            {
                this.FindName("gdImageDownloadContainer");

                if (UtilityData.isFluentDesign)
                {
                    gdImageDownloadContainer.Background = new AcrylicBrush()
                    {
                        BackgroundSource = AcrylicBackgroundSource.Backdrop,
                        TintOpacity      = 0.2,
                        TintColor        = (gdImageDownloadContainer.Background as SolidColorBrush).Color,
                        FallbackColor    = (gdImageDownloadContainer.Background as SolidColorBrush).Color
                    };

                    gdPhotoScndContainer.Background = new AcrylicBrush()
                    {
                        BackgroundSource = AcrylicBackgroundSource.Backdrop,
                        TintOpacity      = 0.5,
                        TintColor        = (gdPhotoScndContainer.Background as SolidColorBrush).Color,
                        FallbackColor    = (gdPhotoScndContainer.Background as SolidColorBrush).Color
                    };
                }

                UtilityClass.TranslationAnimation(_compositor, gdPhotoScndContainer, false);
            }

            gdImageDownloadContainer.Visibility = Visibility.Visible;
            gdMediaContainer.Visibility         = Visibility.Collapsed;
            spDLMediaProgress.Visibility        = Visibility.Collapsed;
            mdePlayer.Source = null;

            txtRedditLink.Text = "";
            if (web.Source.AbsoluteUri.Contains("www.reddit.com/"))
            {
                txtRedditLink.Text = web.Source.AbsoluteUri;
            }

            ContentSplitView.IsPaneOpen = !ContentSplitView.IsPaneOpen;
        }
Esempio n. 4
0
        private void HideListView()
        {
            btFaceBook.Visibility  = (bool)UtilityClass.ApplicationDataBool("Hide(F)", false) ? Visibility.Collapsed : Visibility.Visible;
            btTwitter.Visibility   = (bool)UtilityClass.ApplicationDataBool("Hide(Tw)", false) ? Visibility.Collapsed : Visibility.Visible;
            btInstagram.Visibility = (bool)UtilityClass.ApplicationDataBool("Hide(I)", false) ? Visibility.Collapsed : Visibility.Visible;
            btReddit.Visibility    = (bool)UtilityClass.ApplicationDataBool("Hide(R)", false) ? Visibility.Collapsed : Visibility.Visible;
            //btGoogle.Visibility = (bool)UtilityClass.ApplicationDataBool("Hide(G)", false) ? Visibility.Collapsed : Visibility.Visible;

            if (ApplicationData.Current.LocalSettings.Values.ContainsKey("Hide(Mix)"))
            {
                if ((bool)ApplicationData.Current.LocalSettings.Values["Hide(Mix)"] == true)
                {
                    btMix.Visibility = Visibility.Collapsed;
                }
                else if ((bool)ApplicationData.Current.LocalSettings.Values["Hide(Mix)"] == false)
                {
                    btMix.Visibility = Visibility.Visible;
                }
            }

            if (UtilityData.isFirstAppRun)
            {
                ApplicationData.Current.LocalSettings.Values["Hide(Wh)"] = true;
                btWhatsApp.Visibility     = Visibility.Collapsed;
                UtilityData.isFirstAppRun = false;
            }
            else
            {
                if (ApplicationData.Current.LocalSettings.Values.ContainsKey("Hide(Wh)"))
                {
                    if ((bool)ApplicationData.Current.LocalSettings.Values["Hide(Wh)"] == true)
                    {
                        btWhatsApp.Visibility = Visibility.Collapsed;
                    }
                    else if ((bool)ApplicationData.Current.LocalSettings.Values["Hide(Wh)"] == false)
                    {
                        btWhatsApp.Visibility = Visibility.Visible;
                    }
                }
            }
        }
Esempio n. 5
0
        private void EnableDarkMode_Toggled(object sender, RoutedEventArgs e)
        {
            ToggleSwitch toggleSwitch = sender as ToggleSwitch;

            ApplicationData.Current.LocalSettings.Values["EnableDarkMode(F)"] = EnableDarkMode.IsOn;
            if (toggleSwitch != null)
            {
                if (toggleSwitch.IsOn == true)
                {
                    spContentSplitView.Background = new SolidColorBrush(UtilityClass.ConvertStringToColor("#171717"));
                    style();
                }
                else
                {
                    spContentSplitView.Background = new SolidColorBrush(UtilityClass.ConvertStringToColor("#4267B2"));
                    web.Refresh();
                }
            }
            UtilityData.isFacebookDark = EnableDarkMode.IsOn;
            if (!isFirstLoaded || ucCommandBar.scbColor == null)
            {
                MainPage.ncSettings.setSettings = "Facebook";
            }

            _ucCommandBar.Background = ucCommandBar.scbColor;
            //if (UtilityData.isFluentDesign)
            //{
            //    ContentSplitView.PaneBackground = new AcrylicBrush()
            //    {
            //        FallbackColor = ((SolidColorBrush)ContentSplitView.PaneBackground).Color,
            //        TintColor = ((SolidColorBrush)ContentSplitView.PaneBackground).Color,
            //        TintOpacity = 0.6,
            //        BackgroundSource = AcrylicBackgroundSource.Backdrop
            //    };
            //}
            //else
            //{
            //    _ucCommandBar.cbAppbar.Background = MainPage.topSCBrush;
            //}
            _ucCommandBar.cbAppbar.Background = MainPage.topSCBrush;
        }
Esempio n. 6
0
        private void EnableDarkMode_Toggled(object sender, RoutedEventArgs e)
        {
            ApplicationData.Current.LocalSettings.Values["EnableDarkMode(Telegram)"] = EnableDarkMode.IsOn;
            if (EnableDarkMode.IsOn == true)
            {
                spContentSplitView.Background = new SolidColorBrush(UtilityClass.ConvertStringToColor("#171717"));
                style();
            }
            else
            {
                spContentSplitView.Background = new SolidColorBrush(UtilityClass.ConvertStringToColor("#5682A3"));
                web.Refresh();
            }
            UtilityData.isTelegramDark = EnableDarkMode.IsOn;
            if (!isFirstLoaded)
            {
                MainPage.ncSettings.setSettings = "Telegram";
            }

            _ucCommandBar.cbAppbar.Background = MainPage.topSCBrush;
        }
Esempio n. 7
0
 private void OffsetAnimation_PointerExited(object sender, PointerRoutedEventArgs e)
 {
     try
     {
         UIElementCollection stackChild = null;
         var item = (ListViewItem)sender;
         if (item.Content is Grid)
         {
             var stackPanel = (Grid)item.Content;
             stackChild = stackPanel.Children;
         }
         else
         {
             var stackPanel = (StackPanel)item.Content;
             stackChild = stackPanel.Children;
         }
         UtilityClass.moveXOffset(stackChild[0], 0);
         UtilityClass.moveXOffset(stackChild[1], 0);
     }
     catch (Exception)
     {
     }
 }
Esempio n. 8
0
        private async void OneTimeSave()
        {
            isFirstLoaded = true;
            try
            {
                if (ApplicationView.GetForCurrentView().IsViewModeSupported(ApplicationViewMode.CompactOverlay))
                {
                    _ucCommandBar.btCompactOverlay.Visibility = Visibility.Visible;
                    _ucCommandBar.btCompactOverlay.Click     += btCompactOverlay_Click;
                }
            }
            catch (Exception)
            {
            }
            // EnableNotification.IsOn = (bool)Utility.ApplicationDataBool("Notification(Telegram)", true);
            _ucCommandBar.btsetting.Visibility = Visibility.Visible;
            EnableDarkMode.IsOn = UtilityData.isTelegramDark;
            if (!EnableDarkMode.IsOn)
            {
                spContentSplitView.Background = new SolidColorBrush(UtilityClass.ConvertStringToColor("#5682A3"));
            }

            if (UtilityData.isFluentDesign)
            {
                _ucCommandBar.cbAppbar.Style = Application.Current.Resources["CommandBarRevealStyle"] as Style;
            }

            TeleCss = UtilityData.getCss("Tele");
            style();
            var _TeleCss = await UtilityClass.serverStyle("https://rebrand.ly/TeleMain", "Telegram", "TeleMain");

            if (_TeleCss != "")
            {
                TeleCss = _TeleCss;
                style();
            }
        }
Esempio n. 9
0
        private async void TxtInstaLink_TextChanged(object sender, TextChangedEventArgs e)
        {
            try
            {
                spDLMediaProgress.Visibility = Visibility.Visible;
                string imgUri = await UtilityClass.retrieveWebPhotoLink(txtInstaLink.Text, "Insta");

                if (imgUri != null)
                {
                    imgInstaPhoto.Source        = null;
                    gdMediaContainer.Visibility = Visibility.Visible;

                    if (imgUri.Contains(".mp4"))
                    {
                        imgInstaPhoto.Visibility = Visibility.Collapsed;

                        mdePlayer.Source     = new Uri(imgUri);
                        mdePlayer.Visibility = Visibility.Visible;
                    }
                    else
                    {
                        imgInstaPhoto.Visibility = Visibility.Visible;
                        mdePlayer.Visibility     = Visibility.Collapsed;
                        imgInstaPhoto.Source     = new BitmapImage(new Uri(imgUri));
                    }
                }
                gdLinkErrorDownload.Visibility = Visibility.Collapsed;
            }
            catch (Exception)
            {
                gdMediaContainer.Visibility = Visibility.Collapsed;
            }
            finally
            {
                spDLMediaProgress.Visibility = Visibility.Collapsed;
            }
        }
Esempio n. 10
0
 private void style()
 {
     cssToApply = "";
     if (EnableDarkMode.IsOn && web.Source.AbsoluteUri.Contains("https://web.telegram.org/#/login"))
     {
         // background-color #292929
         //cssToApply += "html {background: #1e1e1e}";
         cssToApply += ".login_head_bg {background: #292929}";
         cssToApply += ".login_footer_wrap {display: none}";
     }
     else if (web.Source.AbsoluteUri.Contains("https://web.telegram.org/#/login"))
     {
         cssToApply += ".login_footer_wrap {display: none}";
     }
     if (EnableDarkMode.IsOn && web.Source.AbsoluteUri.Contains("https://web.telegram.org/#/im"))
     {
         cssToApply += TeleCss;
     }
     if (web.Source.AbsoluteUri.Contains("https://web.telegram.org/"))
     {
         cssToApply += ".tg_head_split, .im_page_wrap {max-width: none}";
     }
     UtilityClass.ApplyStyle(web, cssToApply);
 }
Esempio n. 11
0
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     parameter = e.Parameter;
     UtilityClass.titlebar("#0C0C0E");
     pin();
 }
Esempio n. 12
0
 private void bthelp_Click(object sender, RoutedEventArgs e)
 {
     UtilityClass.MessageDialog("You can Unlock the Password and Windows Hello Setting to secure your app by setting your own Password or Windows Hello so that no one can use your app Without your Permission/Password.", "Unlock Custom Password and Windows Hello");
 }
Esempio n. 13
0
        private async void btpinIAP_Click(object sender, RoutedEventArgs e)
        {
            this.FindName("gdPurchasingAddon");
            gdPurchasingAddon.Visibility = Visibility.Visible;

            try
            {
                if (ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 3))
                {
                    string[] filterList = new string[] { "Durable" };

                    if (UtilityData.addOnCollection == null || UtilityData.addOnCollection.ExtendedError != null)
                    {
                        UtilityData.addOnCollection = await storeContext.GetUserCollectionAsync(filterList);
                    }

                    var isPurchasedList = UtilityData.addOnCollection.Products.Values.Where(p => p.InAppOfferToken.Equals(UtilityData.PinIAP)).ToList();
                    if (isPurchasedList.Count == 0)
                    {
                        if (UtilityData.addOnsAssociatedStoreProducts == null)
                        {
                            UtilityData.addOnsAssociatedStoreProducts = await storeContext.GetAssociatedStoreProductsAsync(filterList);
                        }

                        var AddOnList = UtilityData.addOnsAssociatedStoreProducts.Products.Values.Where(p => p.InAppOfferToken.Equals(UtilityData.PinIAP)).ToList();

                        StorePurchaseResult result = await storeContext.RequestPurchaseAsync(AddOnList[0].StoreId);

                        if (result != null)
                        {
                            switch (result.Status)
                            {
                            case StorePurchaseStatus.AlreadyPurchased:
                                PinLicense();
                                break;

                            case StorePurchaseStatus.Succeeded:
                                ApplicationData.Current.RoamingSettings.Values[UtilityData.UpPin] = true;
                                PinLicense();
                                UtilityClass.MessageDialog("Thank You very much for Purchasing. We really appreciate your kind support!", "Thank You very much! :)");
                                break;

                            case StorePurchaseStatus.NetworkError:
                            case StorePurchaseStatus.ServerError:
                                UtilityClass.MessageDialog("An Error Occured , Please Try Again!", "Error occured while purchasing.");
                                break;
                            }
                        }
                    }
                }
                else
                {
                    if (UtilityData.AppLicenseInformation == null)
                    {
                        UtilityData.AppLicenseInformation = CurrentApp.LicenseInformation;
                    }
                    if (!UtilityData.AppLicenseInformation.ProductLicenses["PinIAP"].IsActive)
                    {
                        try
                        {
                            PurchaseResults results = await CurrentApp.RequestProductPurchaseAsync("PinIAP");

                            if (results.Status == ProductPurchaseStatus.Succeeded)
                            {
                                ApplicationData.Current.RoamingSettings.Values["UpPin"] = UtilityData.AppLicenseInformation.ProductLicenses["PinIAP"].IsActive;
                                PinLicense();
                                UtilityClass.MessageDialog("Thank You very much for Purchasing. We really appreciate your kind support!", "Thank You very much! :)");
                            }
                        }
                        catch
                        {
                            UtilityClass.MessageDialog("Please Check your Internet Connection and then try again", "No Internet Connection.");
                        }
                    }
                    else
                    {
                    }
                }
            }
            catch (Exception)
            {
                UtilityClass.MessageDialog("Please Check your Internet Connection and then try again", "No Internet Connection.");
            }
            finally
            {
                if (gdPurchasingAddon != null)
                {
                    gdPurchasingAddon.Visibility = Visibility.Collapsed;
                }
            }
        }
Esempio n. 14
0
        private async void OneTimeSave()
        {
            isFirstLoaded = true;
            try
            {
                if (ApplicationView.GetForCurrentView().IsViewModeSupported(ApplicationViewMode.CompactOverlay))
                {
                    _ucCommandBar.btCompactOverlay.Visibility = Visibility.Visible;
                    _ucCommandBar.btCompactOverlay.Click     += btCompactOverlay_Click;
                }
            }
            catch (Exception)
            {
            }

            _ucCommandBar.btsetting.Visibility = Visibility.Visible;
            cbLiteItems.Visibility             = _ucCommandBar.btforward.Visibility;

            chbGoToTop.IsChecked = (bool)UtilityClass.ApplicationDataBool("isGoToTop(FB)", false);
            if (cbLiteItems.Visibility == Visibility.Visible)
            {
                cbLiteItems.SelectedIndex = (int)UtilityClass.ApplicationDataBool("(FB)cbLiteItems", 0);
                cbLiteItemsSelection();
            }
            else
            {
                web.Source = new Uri("https://m.facebook.com");
            }

            EnableDarkMode.IsOn = UtilityData.isFacebookDark;
            if (!EnableDarkMode.IsOn)
            {
                spContentSplitView.Background = new SolidColorBrush(UtilityClass.ConvertStringToColor("#4267B2"));
            }

            if (UtilityData.isFluentDesign)
            {
                _ucCommandBar.cbAppbar.Style = Application.Current.Resources["CommandBarRevealStyle"] as Style;
            }

            DesktopCss = UtilityData.getCss("DFb");
            MobileCss  = UtilityData.getCss("MFb");
            style();

            StartDarkModeDispatcher();

            DownloadMobileCss();

            var _DesktopCss = await UtilityClass.serverStyle("https://rebrand.ly/fbDesktopMain", "Facebook", "DesktopMain");

            if (_DesktopCss != "")
            {
                var result = _DesktopCss.Split(new[] { '\r', '\n' });
                if (result != null && result[0] != null)
                {
                    styleDisplayNone += result[0];
                }
                DesktopCss = _DesktopCss;
                style();
            }


            //if (ApplicationData.Current.LocalSettings.Values.ContainsKey("TotalUsage(FB)"))
            //{
            //    TotalUsageTime = (int)ApplicationData.Current.LocalSettings.Values["TotalUsage(FB)"];
            //}
            //UsageTimerStart();
        }
Esempio n. 15
0
        private async void btRemoveDesktopAds_Click(object sender, RoutedEventArgs e)
        {
            this.FindName("gdPurchasingAddon");
            gdPurchasingAddon.Visibility = Visibility.Visible;

            try
            {
                if (ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 3))
                {
                    StorePurchaseResult result = await PurchaseAddOn(UtilityData.RemoveAds);

                    if (result != null)
                    {
                        switch (result.Status)
                        {
                        case StorePurchaseStatus.AlreadyPurchased:
                            RemoveAdsLicense();
                            break;

                        case StorePurchaseStatus.Succeeded:
                            ApplicationData.Current.RoamingSettings.Values[UtilityData.UpRemoveAds] = true;
                            RemoveAdsLicense();
                            UtilityClass.MessageDialog("Thank You very much for Purchasing. We really appreciate your kind support!", "Thank You very much! :)");
                            break;

                        case StorePurchaseStatus.NetworkError:
                        case StorePurchaseStatus.ServerError:
                            UtilityClass.MessageDialog("An Error Occured , Please Try Again!", "Error occured while purchasing.");
                            break;
                        }
                    }
                }
                else
                {
                    if (UtilityData.AppLicenseInformation == null)
                    {
                        UtilityData.AppLicenseInformation = CurrentApp.LicenseInformation;
                    }

                    if (!UtilityData.AppLicenseInformation.ProductLicenses["RemoveAds"].IsActive)
                    {
                        try
                        {
                            PurchaseResults results = await CurrentApp.RequestProductPurchaseAsync("RemoveAds");

                            if (results.Status == ProductPurchaseStatus.Succeeded)
                            {
                                ApplicationData.Current.RoamingSettings.Values["UpRemoveAds"] = UtilityData.AppLicenseInformation.ProductLicenses["RemoveAds"].IsActive;
                                RemoveAdsLicense();
                                UtilityClass.MessageDialog("Thank You very much for Purchasing. We really appreciate your kind support!", "Thank You very much! :)");
                            }
                        }
                        catch (Exception)
                        {
                            UtilityClass.MessageDialog("Please Check your Internet Connection and then try again", "No Internet Connection.");
                        }
                    }
                    else
                    {
                        // The customer already owns this feature.
                    }
                }
            }
            catch (Exception)
            {
                UtilityClass.MessageDialog("Please Check your Internet Connection and then try again", "No Internet Connection.");
            }
            finally
            {
                if (gdPurchasingAddon != null)
                {
                    gdPurchasingAddon.Visibility = Visibility.Collapsed;
                }
            }
        }
Esempio n. 16
0
        private async void btTelegramIAP_Tapped()
        {
            this.FindName("gdPurchasingAddon");
            gdPurchasingAddon.Visibility = Visibility.Visible;

            try
            {
                if (ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 3))
                {
                    StorePurchaseResult result = await PurchaseAddOn(UtilityData.UnlockTelegram);

                    if (result != null)
                    {
                        switch (result.Status)
                        {
                        case StorePurchaseStatus.AlreadyPurchased:
                            TelegramLicense();
                            //listboxassets("telegram", typeof(Telegram), "Telegram", UtilityData.TelegramColor, UtilityData.isTelegramDark);
                            break;

                        case StorePurchaseStatus.Succeeded:
                            ApplicationData.Current.RoamingSettings.Values[UtilityData.UpTelegram] = true;
                            TelegramLicense();
                            //lvMain.SelectedIndex = 0;
                            UtilityClass.MessageDialog("Thank You very much for Purchasing. We really appreciate your kind support!", "Thank You very much! :)");
                            break;

                        case StorePurchaseStatus.NetworkError:
                        case StorePurchaseStatus.ServerError:
                            UtilityClass.MessageDialog("An Error Occured , Please Try Again!", "Error occured while purchasing.");
                            break;
                        }
                    }
                }
                else
                {
                    if (UtilityData.AppLicenseInformation == null)
                    {
                        UtilityData.AppLicenseInformation = CurrentApp.LicenseInformation;
                    }

                    if (!UtilityData.AppLicenseInformation.ProductLicenses["UnlockTelegram"].IsActive)
                    {
                        try
                        {
                            PurchaseResults results = await CurrentApp.RequestProductPurchaseAsync("UnlockTelegram");

                            if (results.Status == ProductPurchaseStatus.Succeeded)
                            {
                                ApplicationData.Current.RoamingSettings.Values["UpTelegram"] = UtilityData.AppLicenseInformation.ProductLicenses["UnlockTelegram"].IsActive;
                                TelegramLicense();
                                mylistbox.SelectedIndex = 0;

                                UtilityClass.MessageDialog("Thank You very much for Purchasing. We really appreciate your kind support!", "Thank You very much! :)");
                            }
                        }
                        catch (Exception)
                        {
                            UtilityClass.MessageDialog("Please Check your Internet Connection and then try again", "No Internet Connection.");
                        }
                    }
                    else
                    {
                        TelegramLicense();
                    }
                }
            }
            catch (Exception)
            {
                UtilityClass.MessageDialog("Please Check your Internet Connection and then try again", "No Internet Connection.");
            }
            finally
            {
                if (gdPurchasingAddon != null)
                {
                    gdPurchasingAddon.Visibility = Visibility.Collapsed;
                }
            }
        }
Esempio n. 17
0
 protected override void OnNavigatedFrom(NavigationEventArgs e)
 {
     base.OnNavigatedFrom(e);
     UtilityClass.titlebar(scbBrush: new SolidColorBrush(titleBarColor));
 }
Esempio n. 18
0
 private async void BtDownloadInstaPhotoOverlay_Click(object sender, RoutedEventArgs e)
 {
     await saveInstaPhoto(await UtilityClass.retrieveWebPhotoLink(web.Source.AbsoluteUri, "Insta"));
 }
Esempio n. 19
0
 private async void BtDownloadRedditPhotoOverlay_Click(object sender, RoutedEventArgs e)
 {
     await manualSavePhoto(await UtilityClass.retrieveWebPhotoLink(web.Source.AbsoluteUri, "Reddit"));
 }
Esempio n. 20
0
        private void OneTimeSave()
        {
            try
            {
                storeContext = StoreContext.GetDefault();
            }
            catch (Exception)
            {
            }

            isMenuPinned = (bool)UtilityClass.ApplicationDataBool("isMenuPinned", false);

            if (SystemInformation.DeviceFamily == "Windows.Mobile")
            {
                btPinSplitView.Visibility = Visibility.Collapsed;
            }
            //UserAgentHelper.SetDefaultUserAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.167 Safari/537.36");

            if (ApiInformation.IsTypePresent("Windows.UI.Xaml.Media.AcrylicBrush"))
            {
                UtilityData.isFluentDesign = (bool)UtilityClass.ApplicationDataBool("isFluentDesign", true);
            }
            else
            {
                UtilityData.isFluentDesign = false;
            }
            //UtilityData.isFluentDesign = false;
            try
            {
                if (UtilityData.isFluentDesign)
                {
                    topAcrylicBrush = new AcrylicBrush()
                    {
                        FallbackColor    = ((SolidColorBrush)rpWeb.Background).Color,
                        TintColor        = ((SolidColorBrush)rpWeb.Background).Color,
                        TintOpacity      = 0.7,
                        BackgroundSource = AcrylicBackgroundSource.HostBackdrop
                    };
                    HamburgerAcrylicBrush = new AcrylicBrush()
                    {
                        FallbackColor    = ((SolidColorBrush)mySplitsview.PaneBackground).Color,
                        TintColor        = ((SolidColorBrush)mySplitsview.PaneBackground).Color,
                        TintOpacity      = 0.7,
                        BackgroundSource = AcrylicBackgroundSource.HostBackdrop
                    };
                    // Fluent Button Style
                    bthamburger.Style = Application.Current.Resources["ButtonRevealStyle"] as Style;
                }
            }
            catch (Exception)
            {
                UtilityData.isFluentDesign = false;
            }
            if (ApiInformation.IsTypePresent("Windows.ApplicationModel.Core.CoreApplicationViewTitleBar") && Microsoft.Toolkit.Uwp.Helpers.SystemInformation.DeviceFamily == "Windows.Desktop")
            {
                CoreApplicationViewTitleBar coreTitleBar = CoreApplication.GetCurrentView().TitleBar;
                coreTitleBar.LayoutMetricsChanged += (s, a) =>
                {
                    gdTitleBar.Margin = new Thickness(coreTitleBar.SystemOverlayLeftInset, 0, 0, 0);
                };
                coreTitleBar.IsVisibleChanged += (s, a) => { gdTitleBar.Visibility = coreTitleBar.IsVisible ? Visibility.Visible : Visibility.Collapsed; };
            }

            SavedDarkMode();

            PinnedMenuHelper(isMenuPinned);
        }
Esempio n. 21
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            if (ApiInformation.IsTypePresent("Windows.ApplicationModel.Core.CoreApplicationViewTitleBar") && Microsoft.Toolkit.Uwp.Helpers.SystemInformation.DeviceFamily == "Windows.Desktop")
            {
                gdTitleBar.Visibility = Visibility.Visible;
                CoreApplicationViewTitleBar coreTitleBar = CoreApplication.GetCurrentView().TitleBar;
                coreTitleBar.ExtendViewIntoTitleBar = true;
                Window.Current.SetTitleBar(gdTitleBar);
            }
            else
            {
                gdTitleBar.Visibility = Visibility.Collapsed;
            }

            UtilityData.LinksSetting = (int)UtilityClass.ApplicationDataBool("cbExtLinks", 3);
            isHideCompactMenu        = (bool)UtilityClass.ApplicationDataBool("HideCompactMenu", false);

            if (!isMenuPinned)
            {
                mySplitsview.IsPaneOpen = true;
                mySplitsview.IsPaneOpen = false;
            }

            HideCompactMenu();

            HideListView();

            InAppPurchaseLicense();
            try
            {
                if (e.Parameter == null || (string)e.Parameter == "")
                {
                    if (mylistbox.SelectedIndex == -1)
                    {
                        pageselection();
                    }
                }
                else
                {
                    switch ((string)e.Parameter)
                    {
                    case "jplFacebook":
                        mylistbox.SelectedIndex = 5;
                        break;

                    case "jplTwitter":
                        mylistbox.SelectedIndex = 0;
                        break;

                    case "jplTelegram":
                        mylistbox.SelectedIndex = 2;
                        break;

                    //case "jplWhatsApp":
                    //    mylistbox.SelectedIndex = 3;
                    //    break;
                    case "jplReddit":
                        mylistbox.SelectedIndex = 4;
                        break;

                    case "jplInstagram":
                        mylistbox.SelectedIndex = 1;
                        break;

                    case "jplSplitView":
                        mylistbox.SelectedIndex = 7;
                        break;
                    }
                }
            }
            catch (Exception)
            {
                if (mylistbox.SelectedIndex == -1)
                {
                    pageselection();
                }
            }
            if (ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons"))
            {
                UtilityData.isbtHardwareBack = (bool)UtilityClass.ApplicationDataBool("bthardwareBack", false);
            }
        }
Esempio n. 22
0
 private void BtMoveXOffset_PointerExited(object sender, PointerRoutedEventArgs e)
 {
     UtilityClass.moveYOffset((Button)sender, 0);
 }
Esempio n. 23
0
        private async void Page_Loaded(object sender, RoutedEventArgs e)
        {
            var titleBar = ApplicationView.GetForCurrentView().TitleBar;

            titleBarColor = (Color)titleBar.BackgroundColor;
            UtilityClass.titlebar("#0C0C0E");

            tempImage      = null;
            tempCoverImage = null;
            visualSetters(vsgMain.CurrentState.Name);
            try
            {
                if (ApplicationData.Current.LocalSettings.Values.ContainsKey("isPassImage"))
                {
                    if ((bool)ApplicationData.Current.LocalSettings.Values["isPassImage"])
                    {
                        StorageFolder folder  = ApplicationData.Current.LocalFolder;
                        StorageFile   imgFile = await folder.GetFileAsync("Image");

                        BitmapImage bitmapImage = new BitmapImage();
                        using (IRandomAccessStream stream = await imgFile.OpenAsync(FileAccessMode.ReadWrite))
                        {
                            await bitmapImage.SetSourceAsync(stream);
                        }
                        imgProfile.Source = bitmapImage;
                    }
                    else
                    {
                        imgProfile.Source = new BitmapImage(new Uri("ms-appx:///Assets/account.png"));
                    }
                }
                else
                {
                    imgProfile.Source = new BitmapImage(new Uri("ms-appx:///Assets/account.png"));
                }
            }
            catch (Exception ex)
            {
                imgProfile.Source = new BitmapImage(new Uri("ms-appx:///Assets/account.png"));
            }
            try
            {
                if (ApplicationData.Current.LocalSettings.Values.ContainsKey("isPassCoverImage"))
                {
                    if ((bool)ApplicationData.Current.LocalSettings.Values["isPassCoverImage"])
                    {
                        StorageFolder folder  = ApplicationData.Current.LocalFolder;
                        StorageFile   imgFile = await folder.GetFileAsync("CoverImage");

                        BitmapImage bitmapImage = new BitmapImage();
                        using (IRandomAccessStream stream = await imgFile.OpenAsync(FileAccessMode.ReadWrite))
                        {
                            await bitmapImage.SetSourceAsync(stream);
                        }
                        CoverImageBrush.ImageSource = bitmapImage;
                    }
                    else
                    {
                        CoverImageBrush.ImageSource = new BitmapImage(new Uri("ms-appx:///Assets/win10Purple.jpg"));
                    }
                }
                else
                {
                    CoverImageBrush.ImageSource = new BitmapImage(new Uri("ms-appx:///Assets/win10Purple.jpg"));
                }
            }
            catch (Exception ex)
            {
                CoverImageBrush.ImageSource = new BitmapImage(new Uri("ms-appx:///Assets/win10Purple.jpg"));
            }


            try
            {
                if (UtilityData.isFluentDesign)
                {
                    spPassCont.Background = new AcrylicBrush()
                    {
                        FallbackColor    = ((SolidColorBrush)spPassCont.Background).Color,
                        TintColor        = ((SolidColorBrush)spPassCont.Background).Color,
                        TintOpacity      = 0.9,
                        BackgroundSource = AcrylicBackgroundSource.Backdrop
                    };
                }
            }
            catch (Exception)
            {
            }
        }