Skip to content

Commit

Permalink
- Ability to change chat background, choosing from Telegram gallery o…
Browse files Browse the repository at this point in the history
…r using a picture from your device

- Bug fixes and improvements
  • Loading branch information
FrayxRulez committed Jun 10, 2017
2 parents 9bd75cc + cc62a88 commit 3acd70a
Show file tree
Hide file tree
Showing 101 changed files with 5,629 additions and 368 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -256,3 +256,5 @@ _Pvt_Extensions
/Unigram/PreviewTest
/Unigram/PreviewTest
/Unigram/UnigramHost/Generated Files
/Unigram/Telegram.Api.Native/Telegram.Api.Native.h
/Unigram/Telegram.Api.Native.Test/Constants.Secret.cs
8 changes: 8 additions & 0 deletions Unigram/Telegram.Api.Native.Test/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Application
x:Class="Telegram.Api.Native.Test.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Telegram.Api.Native.Test"
RequestedTheme="Light">

</Application>
100 changes: 100 additions & 0 deletions Unigram/Telegram.Api.Native.Test/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;

namespace Telegram.Api.Native.Test
{
/// <summary>
/// Fornisci un comportamento specifico dell'applicazione in supplemento alla classe Application predefinita.
/// </summary>
sealed partial class App : Application
{
/// <summary>
/// Inizializza l'oggetto Application singleton. Si tratta della prima riga del codice creato
/// creato e, come tale, corrisponde all'equivalente logico di main() o WinMain().
/// </summary>
public App()
{
this.InitializeComponent();
this.Suspending += OnSuspending;
}

/// <summary>
/// Richiamato quando l'applicazione viene avviata normalmente dall'utente. All'avvio dell'applicazione
/// verranno usati altri punti di ingresso per aprire un file specifico.
/// </summary>
/// <param name="e">Dettagli sulla richiesta e sul processo di avvio.</param>
protected override void OnLaunched(LaunchActivatedEventArgs e)
{
Frame rootFrame = Window.Current.Content as Frame;

// Non ripetere l'inizializzazione dell'applicazione se la finestra già dispone di contenuto,
// assicurarsi solo che la finestra sia attiva
if (rootFrame == null)
{
// Creare un frame che agisca da contesto di navigazione e passare alla prima pagina
rootFrame = new Frame();

rootFrame.NavigationFailed += OnNavigationFailed;

if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
{
//TODO: caricare lo stato dall'applicazione sospesa in precedenza
}

// Posizionare il frame nella finestra corrente
Window.Current.Content = rootFrame;
}

if (e.PrelaunchActivated == false)
{
if (rootFrame.Content == null)
{
// Quando lo stack di esplorazione non viene ripristinato, passare alla prima pagina
// e configurare la nuova pagina passando le informazioni richieste come parametro
// parametro
rootFrame.Navigate(typeof(MainPage), e.Arguments);
}
// Assicurarsi che la finestra corrente sia attiva
Window.Current.Activate();
}
}

/// <summary>
/// Chiamato quando la navigazione a una determinata pagina ha esito negativo
/// </summary>
/// <param name="sender">Frame la cui navigazione non è riuscita</param>
/// <param name="e">Dettagli sull'errore di navigazione.</param>
void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
{
throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
}

/// <summary>
/// Richiamato quando l'esecuzione dell'applicazione viene sospesa. Lo stato dell'applicazione viene salvato
/// senza che sia noto se l'applicazione verrà terminata o ripresa con il contenuto
/// della memoria ancora integro.
/// </summary>
/// <param name="sender">Origine della richiesta di sospensione.</param>
/// <param name="e">Dettagli relativi alla richiesta di sospensione.</param>
private void OnSuspending(object sender, SuspendingEventArgs e)
{
var deferral = e.SuspendingOperation.GetDeferral();
//TODO: salvare lo stato dell'applicazione e arrestare eventuali attività eseguite in background
deferral.Complete();
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions Unigram/Telegram.Api.Native.Test/MainPage.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Page
x:Class="Telegram.Api.Native.Test.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Telegram.Api.Native.Test"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">

<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

</Grid>
</Page>
32 changes: 32 additions & 0 deletions Unigram/Telegram.Api.Native.Test/MainPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;

// Il modello di elemento Pagina vuota è documentato all'indirizzo https://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x410

namespace Telegram.Api.Native.Test
{
/// <summary>
/// Pagina vuota che può essere usata autonomamente oppure per l'esplorazione all'interno di un frame.
/// </summary>
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();

var xxx = ConnectionManager.Instance;
}
}
}
49 changes: 49 additions & 0 deletions Unigram/Telegram.Api.Native.Test/Package.appxmanifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>

<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
IgnorableNamespaces="uap mp">

<Identity
Name="d482e209-d959-4aea-9f79-1d6ce059e754"
Publisher="CN=loren"
Version="1.0.0.0" />

<mp:PhoneIdentity PhoneProductId="d482e209-d959-4aea-9f79-1d6ce059e754" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>

<Properties>
<DisplayName>Telegram.Api.Native.Test</DisplayName>
<PublisherDisplayName>loren</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
</Properties>

<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
</Dependencies>

<Resources>
<Resource Language="x-generate"/>
</Resources>

<Applications>
<Application Id="App"
Executable="$targetnametoken$.exe"
EntryPoint="Telegram.Api.Native.Test.App">
<uap:VisualElements
DisplayName="Telegram.Api.Native.Test"
Square150x150Logo="Assets\Square150x150Logo.png"
Square44x44Logo="Assets\Square44x44Logo.png"
Description="Telegram.Api.Native.Test"
BackgroundColor="transparent">
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png"/>
<uap:SplashScreen Image="Assets\SplashScreen.png" />
</uap:VisualElements>
</Application>
</Applications>

<Capabilities>
<Capability Name="internetClient" />
</Capabilities>
</Package>
29 changes: 29 additions & 0 deletions Unigram/Telegram.Api.Native.Test/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Telegram.Api.Native.Test")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Telegram.Api.Native.Test")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: ComVisible(false)]
31 changes: 31 additions & 0 deletions Unigram/Telegram.Api.Native.Test/Properties/Default.rd.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!--
Questo file contiene le direttive di runtime usate da .NET Native. Le impostazioni predefinite sono adatte per la
maggior parte degli sviluppatori, ma è possibile modificare questi parametri per cambiare il
comportamento dell'ottimizzatore di .NET Native.
Le direttive di runtime sono documentate in https://go.microsoft.com/fwlink/?LinkID=391919
Per abilitare completamente la reflection per App1.MyClass e tutti i relativi membri pubblici/privati
<Type Name="App1.MyClass" Dynamic="Required All"/>
Per abilitare la creazione dinamica della creazione di istanze specifica di AppClass<T> tramite System.Int32
<TypeInstantiation Name="App1.AppClass" Arguments="System.Int32" Activate="Required Public" />
Uso della direttiva Namespace per applicare i criteri di reflection a tutti i tipi in uno spazio dei nomi specifico
<Namespace Name="DataClasses.ViewModels" Seralize="All" />
-->

<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
<Application>
<!--
Un elemento Assembly il cui nome è "*Application*" si applica a tutti gli assembly
nel pacchetto dell'applicazione. Gli asterischi non sono caratteri jolly.
-->
<Assembly Name="*Application*" Dynamic="Required All" />


<!-- Aggiungere qui le direttive di runtime specifiche dell'applicazione. -->


</Application>
</Directives>
Loading

0 comments on commit 3acd70a

Please sign in to comment.