Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Commit

Permalink
アイコンの実装 , 他
Browse files Browse the repository at this point in the history
ギャップツイートの取得に対応
タイトルバーに各種ボタンを追加
スクロール時の挙動を一部修正
  • Loading branch information
cucmberium committed May 6, 2016
1 parent 4637854 commit 760bb51
Show file tree
Hide file tree
Showing 39 changed files with 223 additions and 35 deletions.
Binary file removed Flantter.MilkyWay/Assets/BadgeLogo.scale-100.png
Binary file not shown.
Binary file removed Flantter.MilkyWay/Assets/BadgeLogo.scale-180.png
Binary file not shown.
Binary file added Flantter.MilkyWay/Assets/FlantterLogo_Orig.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Flantter.MilkyWay/Assets/LockScreenLogo.scale-200.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed Flantter.MilkyWay/Assets/Logo.scale-100.png
Binary file not shown.
Binary file removed Flantter.MilkyWay/Assets/SmallLogo.scale-100.png
Binary file not shown.
Binary file removed Flantter.MilkyWay/Assets/SplashScreen.scale-100.png
Binary file not shown.
Binary file modified Flantter.MilkyWay/Assets/SplashScreen.scale-200.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Flantter.MilkyWay/Assets/Square150x150Logo.scale-200.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Flantter.MilkyWay/Assets/Square44x44Logo.scale-200.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Flantter.MilkyWay/Assets/StoreLogo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed Flantter.MilkyWay/Assets/StoreLogo.scale-100.png
Binary file not shown.
Binary file not shown.
Binary file modified Flantter.MilkyWay/Assets/Wide310x150Logo.scale-200.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions Flantter.MilkyWay/BundleArtifacts/arm.txt
@@ -0,0 +1,3 @@
MainPackage=D:\Users\cucmberium\Documents\GitHub\Flantter.MilkyWay\Flantter.MilkyWay\bin\ARM\Release\Flantter.MilkyWay_1.0.0.0_ARM.appx
SymbolPackage=D:\Users\cucmberium\Documents\GitHub\Flantter.MilkyWay\Flantter.MilkyWay\AppPackages\Flantter.MilkyWay_1.0.0.0_Test\Flantter.MilkyWay_1.0.0.0_ARM.appxsym
ResourcePack=D:\Users\cucmberium\Documents\GitHub\Flantter.MilkyWay\Flantter.MilkyWay\bin\ARM\Release\Flantter.MilkyWay_1.0.0.0_language-ja.appx
2 changes: 2 additions & 0 deletions Flantter.MilkyWay/BundleArtifacts/x64.txt
@@ -0,0 +1,2 @@
MainPackage=D:\Users\cucmberium\Documents\GitHub\Flantter.MilkyWay\Flantter.MilkyWay\bin\x64\Release\Flantter.MilkyWay_1.0.0.0_x64.appx
SymbolPackage=D:\Users\cucmberium\Documents\GitHub\Flantter.MilkyWay\Flantter.MilkyWay\AppPackages\Flantter.MilkyWay_1.0.0.0_Test\Flantter.MilkyWay_1.0.0.0_x64.appxsym
2 changes: 2 additions & 0 deletions Flantter.MilkyWay/BundleArtifacts/x86.txt
@@ -0,0 +1,2 @@
MainPackage=D:\Users\cucmberium\Documents\GitHub\Flantter.MilkyWay\Flantter.MilkyWay\bin\x86\Release\Flantter.MilkyWay_1.0.0.0_x86.appx
SymbolPackage=D:\Users\cucmberium\Documents\GitHub\Flantter.MilkyWay\Flantter.MilkyWay\AppPackages\Flantter.MilkyWay_1.0.0.0_Test\Flantter.MilkyWay_1.0.0.0_x86.appxsym
6 changes: 5 additions & 1 deletion Flantter.MilkyWay/Flantter.MilkyWay.csproj
Expand Up @@ -18,6 +18,9 @@
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<PackageCertificateKeyFile>Flantter.MilkyWay_TemporaryKey.pfx</PackageCertificateKeyFile>
<AppxAutoIncrementPackageRevision>False</AppxAutoIncrementPackageRevision>
<AppxBundle>Always</AppxBundle>
<AppxBundlePlatforms>x86|x64|arm</AppxBundlePlatforms>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -99,6 +102,7 @@
<Content Include="ApplicationInsights.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Assets\Square71x71Logo.scale-200.png" />
<Content Include="ReleaseNotes.txt" />
<None Include="project.json" />
<PRIResource Include="String\en-US\Resources.resw" />
Expand Down Expand Up @@ -402,7 +406,7 @@
<SDKReference Include="Microsoft.VCLibs, Version=14.0">
<Name>Visual C++ 2015 Runtime for Universal Windows Platform Apps</Name>
</SDKReference>
<SDKReference Include="SQLite.UWP.2015, Version=3.12.1">
<SDKReference Include="SQLite.UWP.2015, Version=3.12.2">
<Name>SQLite for Universal Windows Platform</Name>
</SDKReference>
<SDKReference Include="WindowsDesktop, Version=10.0.10240.0">
Expand Down
11 changes: 11 additions & 0 deletions Flantter.MilkyWay/Models/ColumnModel.cs
Expand Up @@ -990,6 +990,9 @@ private void Add(Twitter.Objects.Gap gap, bool streaming = false)
{
var index = this.Tweets.IndexOf(this.Tweets.FirstOrDefault(x =>
{
if (x is Twitter.Objects.Gap)
return false;
var tid = ((ITweet)x).Id;
if (x is Twitter.Objects.Status)
tid = ((Twitter.Objects.Status)x).HasRetweetInformation ? ((Twitter.Objects.Status)x).RetweetInformation.Id : ((ITweet)x).Id;
Expand Down Expand Up @@ -1022,6 +1025,14 @@ public void Delete(long id)
this._Tweets.RemoveAt(index);
}

public void Delete(Twitter.Objects.Gap gap)
{
if (!this.Tweets.Contains(gap))
return;

this.Tweets.Remove(gap);
}

public bool GapCheck(long id)
{
var index = this.Tweets.IndexOf(this.Tweets.FirstOrDefault(x =>
Expand Down
2 changes: 1 addition & 1 deletion Flantter.MilkyWay/Package.appxmanifest
Expand Up @@ -16,7 +16,7 @@
<Applications>
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="Flantter.MilkyWay.App">
<uap:VisualElements DisplayName="Flantter.MilkyWay" Square150x150Logo="Assets\Square150x150Logo.png" Square44x44Logo="Assets\Square44x44Logo.png" Description="Flantter.MilkyWay is 3rd generation of Flantter. Powerful, cheerful and moeful twitter client for Windows 10." BackgroundColor="#B01E00">
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png">
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png" ShortName="Flantter" Square71x71Logo="Assets\Square71x71Logo.png">
</uap:DefaultTile>
<uap:SplashScreen Image="Assets\SplashScreen.png" BackgroundColor="#B01E00" />
<uap:InitialRotationPreference>
Expand Down
3 changes: 3 additions & 0 deletions Flantter.MilkyWay/String/en-US/Resources.resw
Expand Up @@ -865,4 +865,7 @@
<data name="ShareContract_NeedAuthorize.Text" xml:space="preserve">
<value>You need authorization in main app if you want to use this feature.</value>
</data>
<data name="Tweet_Gap_GetGapStatus_Textblock.Text" xml:space="preserve">
<value>Get gap tweet</value>
</data>
</root>
3 changes: 3 additions & 0 deletions Flantter.MilkyWay/String/ja-JP/Resources.resw
Expand Up @@ -865,4 +865,7 @@
<data name="ShareContract_NeedAuthorize.Text" xml:space="preserve">
<value>この機能を使うには一度アプリを立ち上げてアカウントの認証を行う必要があります。</value>
</data>
<data name="Tweet_Gap_GetGapStatus_Textblock.Text" xml:space="preserve">
<value>ギャップツイートを取得</value>
</data>
</root>
4 changes: 2 additions & 2 deletions Flantter.MilkyWay/Themes/Style/Style.xaml
Expand Up @@ -4319,8 +4319,8 @@
<Setter Property="Padding" Value="0"/>
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="MinWidth" Value="{ThemeResource ListViewItemMinWidth}"/>
<Setter Property="MinHeight" Value="{ThemeResource ListViewItemMinHeight}"/>
<Setter Property="MinWidth" Value="0"/>
<Setter Property="MinHeight" Value="0"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListViewItem">
Expand Down
16 changes: 14 additions & 2 deletions Flantter.MilkyWay/ViewModels/AccountViewModel.cs
Expand Up @@ -722,7 +722,7 @@ public AccountViewModel(AccountModel account)
if (!msgNotification.Result)
return;
this.Model.MuteUser(screenName);
await this.Model.MuteUser(screenName);
}).AddTo(this.Disposable);

Services.Notice.Instance.AddListColumnCommand.SubscribeOn(ThreadPoolScheduler.Default).Where(_ => this.Model.IsEnabled).Subscribe(x =>
Expand All @@ -747,7 +747,7 @@ public AccountViewModel(AccountModel account)
if (!msgNotification.Result)
return;
this.Model.DeleteColumn(columnSetting);
await this.Model.DeleteColumn(columnSetting);
}).AddTo(this.Disposable);

Services.Notice.Instance.AddFilterColumnCommand.SubscribeOn(ThreadPoolScheduler.Default).Where(_ => this.Model.IsEnabled).Subscribe(async x =>
Expand Down Expand Up @@ -794,6 +794,18 @@ public AccountViewModel(AccountModel account)
this.ColumnSelectedIndex.Value = this.Columns.IndexOf(this.Columns.First(y => y.Index.Value == columnIndex - 1));
}).AddTo(this.Disposable);

Services.Notice.Instance.GetGapStatusCommand.SubscribeOn(ThreadPoolScheduler.Default).Where(_ => this.Model.IsEnabled).Subscribe(async x =>
{
var gapViewModel = x as GapViewModel;
if (gapViewModel == null)
return;
var column = this.Columns.First(y => y.Tweets.Contains(gapViewModel));
await column.Model.Update(maxid: gapViewModel.Model.MaxId);
column.Model.Delete(gapViewModel.Model);
}).AddTo(this.Disposable);

#endregion
}
#endregion
Expand Down
11 changes: 8 additions & 3 deletions Flantter.MilkyWay/ViewModels/ColumnViewModel.cs
Expand Up @@ -159,7 +159,12 @@ public ColumnViewModel(ColumnModel column)
return false;
}
}).ToReactiveCommand().AddTo(this.Disposable);
this.StreamingCommand.SubscribeOn(ThreadPoolScheduler.Default).Subscribe(_ => { this.Model.Streaming = !this.Model.Streaming; }).AddTo(this.Disposable);
this.StreamingCommand.SubscribeOn(ThreadPoolScheduler.Default).Subscribe(async _ =>
{
this.Model.Streaming = !this.Model.Streaming;
this.Model.ColumnSetting.Streaming = this.Model.Streaming;
await AdvancedSettingService.AdvancedSetting.SaveToAppSettings();
}).AddTo(this.Disposable);

this.ScrollToTopCommand = column.ObserveProperty(x => x.UnreadCount).Select(x => x != 0).ToReactiveCommand().AddTo(this.Disposable);
this.ScrollToTopCommand.SubscribeOn(ThreadPoolScheduler.Default).Subscribe(async _ =>
Expand All @@ -184,9 +189,9 @@ public ColumnViewModel(ColumnModel column)
this.RefreshCommand.SubscribeOn(ThreadPoolScheduler.Default).Subscribe(async _ =>
{
this.IsScrollLockEnabled.Value = true;
await Task.Delay(100);
await Task.Delay(50);
await this.Model.Update();
await Task.Delay(250);
await Task.Delay(200);
this.IsScrollLockEnabled.Value = false;
}).AddTo(this.Disposable);

Expand Down
43 changes: 43 additions & 0 deletions Flantter.MilkyWay/ViewModels/MainPageViewModel.cs
Expand Up @@ -30,6 +30,7 @@
using Flantter.MilkyWay.Views.Contents.Authorize;
using System.Collections.ObjectModel;
using Flantter.MilkyWay.License;
using Windows.ApplicationModel;

namespace Flantter.MilkyWay.ViewModels
{
Expand Down Expand Up @@ -649,6 +650,48 @@ public override async void OnNavigatedTo(NavigatedToEventArgs e, Dictionary<stri
await Task.Run(async () => await this.Model.Initialize());

Services.Notice.Instance.TweetAreaAccountChangeCommand.Execute(this.Accounts.First(x => x.IsEnabled.Value));

Application.Current.Resuming += Application_OnResuming;
}

public override void OnNavigatingFrom(NavigatingFromEventArgs e, Dictionary<string, object> viewModelState, bool suspending)
{
base.OnNavigatingFrom(e, viewModelState, suspending);

Application.Current.Resuming -= Application_OnResuming;
}

private async void Application_OnResuming(object sender, object e)
{
foreach (var account in this.Accounts)
{
foreach (var column in account.Columns)
{
column.IsScrollLockEnabled.Value = false;
}
}

foreach (var account in this.Accounts)
{
foreach (var column in account.Columns)
{
if (column.IsEnabledStreaming.Value && column.Model.Streaming)
{
column.Model.Streaming = false;
column.Model.Streaming = true;
}
}
}

await Task.Delay(500);

foreach (var account in this.Accounts)
{
foreach (var column in account.Columns)
{
column.IsScrollLockEnabled.Value = false;
}
}
}
#endregion
}
Expand Down
4 changes: 3 additions & 1 deletion Flantter.MilkyWay/ViewModels/Services/Notice.cs
Expand Up @@ -46,6 +46,7 @@ private Notice()
this.RetweetStatusesCommand = new ReactiveCommand();
this.FavoriteStatusesCommand = new ReactiveCommand();
this.ShowMyListsCommand = new ReactiveCommand();
this.GetGapStatusCommand = new ReactiveCommand();

this.AddListColumnCommand = new ReactiveCommand();
this.AddFilterColumnCommand = new ReactiveCommand();
Expand Down Expand Up @@ -152,7 +153,8 @@ public static Notice Instance
public ReactiveCommand RetweetStatusesCommand { get; private set; }
public ReactiveCommand FavoriteStatusesCommand { get; private set; }
public ReactiveCommand ShowMyListsCommand { get; private set; }

public ReactiveCommand GetGapStatusCommand { get; private set; }

public ReactiveCommand AddListColumnCommand { get; private set; }
public ReactiveCommand AddFilterColumnCommand { get; private set; }

Expand Down
23 changes: 17 additions & 6 deletions Flantter.MilkyWay/Views/Behaviors/ListViewScrollControlBehavior.cs
Expand Up @@ -141,12 +141,23 @@ private void ListView_CollectionChanged(object sender, NotifyCollectionChangedEv

var verticalOffset = previousVerticalOffset;
var offset = verticalOffset + ChangedVertialOffset;

if (this.ScrollViewerObject.ScrollableHeight + 1 - offset <= 0)
return;


if (e.NewStartingIndex >= verticalOffset - 0.5)
return;

if (this.ScrollViewerObject.ScrollableHeight + 1 - offset <= 0)
{
try
{
this.ScrollViewerObject.UpdateLayout();
}
catch
{
}

if (this.ScrollViewerObject.ScrollableHeight + 1 - offset <= 0)
return;
}

previousVerticalOffset = offset;

Expand Down Expand Up @@ -191,7 +202,7 @@ private void ListView_CollectionChanged(object sender, NotifyCollectionChangedEv
story.Begin();

this.ScrollViewerObject.ChangeView(null, 0.02, null, true);
previousVerticalOffset = 0;
previousVerticalOffset = 2;

break;
case SettingSupport.TweetAnimationEnum.None:
Expand All @@ -203,7 +214,7 @@ private void ListView_CollectionChanged(object sender, NotifyCollectionChangedEv
else
{
this.ScrollViewerObject.ChangeView(null, 0.02, null, true);
previousVerticalOffset = 0;
previousVerticalOffset = 2;
}

break;
Expand Down
2 changes: 1 addition & 1 deletion Flantter.MilkyWay/Views/Behaviors/TitlebarSwitchAction.cs
Expand Up @@ -37,7 +37,7 @@ public object Execute(object sender, object parameter)
{
coreApplicationView.TitleBar.ExtendViewIntoTitleBar = true;
VisualStateManager.GoToState(page, "TitleBarOpened", true);
Window.Current.SetTitleBar(page.FindName("Flantter_TitleBar") as UIElement);
Window.Current.SetTitleBar(page.FindName("Flantter_TitleBarMain") as UIElement);
}
else
{
Expand Down
4 changes: 2 additions & 2 deletions Flantter.MilkyWay/Views/Contents/ColumnArea.xaml
Expand Up @@ -149,10 +149,10 @@
</Button>

<SymbolIcon Grid.Row="1" Foreground="{StaticResource ColumnViewControlBarSymbolIconForegroundBrush}" Symbol="{x:Bind ActionSymbol.Value, Mode=OneWay}" HorizontalAlignment="Center" Width="50" Height="50"/>
<TextBlock Grid.Row="2" Text="{x:Bind Name.Value, Mode=OneWay}" HorizontalAlignment="Center" />
<TextBlock Grid.Row="2" Foreground="{StaticResource ColumnViewControlBarTextblockForegroundBrush}" Text="{x:Bind Name.Value, Mode=OneWay}" HorizontalAlignment="Center" />

<Rectangle Grid.Row="4" Fill="{StaticResource ColumnViewControlBarUnselectedForegroundBrush}"/>
<TextBlock Grid.Row="4" HorizontalAlignment="Left" Margin="5,0" VerticalAlignment="Center">
<TextBlock Grid.Row="4" Foreground="{StaticResource ColumnViewControlBarTextblockForegroundBrush}" HorizontalAlignment="Left" Margin="5,0" VerticalAlignment="Center">
<Run Text="@"/><Run Text="{x:Bind ScreenName.Value, Mode=OneWay}" />
</TextBlock>
</Grid>
Expand Down
Expand Up @@ -32,7 +32,7 @@

<controls:HorizontalBar/>

<TextBlock x:Uid="SettingsFlyout_AccountChange_SelectAccount_Textblock" Margin="10,3" TextWrapping="NoWrap" Text="アカウント選択"/>
<TextBlock x:Uid="SettingsFlyout_AccountChange_SelectAccount_Textblock" Foreground="{StaticResource SettingsFlyoutTextblockForegroundBrush}" Margin="10,3" TextWrapping="NoWrap" Text="アカウント選択"/>

<controls:HorizontalBar/>

Expand All @@ -51,7 +51,7 @@

<controls:HorizontalBar/>

<TextBlock x:Uid="SettingsFlyout_AccountChange_AccountSetting_Textblock" Margin="10,3" TextWrapping="NoWrap" Text="アカウント設定"/>
<TextBlock x:Uid="SettingsFlyout_AccountChange_AccountSetting_Textblock" Foreground="{StaticResource SettingsFlyoutTextblockForegroundBrush}" Margin="10,3" TextWrapping="NoWrap" Text="アカウント設定"/>

<controls:HorizontalBar/>

Expand Down
Expand Up @@ -57,15 +57,15 @@

<controls:HorizontalBar/>

<TextBox x:Uid="SettingsFlyout_Settings_Column_Filter_TextBox" IsEnabled="{x:Bind ViewModel.CanChangeSetting.Value, Mode=OneWay}" MinHeight="128" MaxHeight="384" AcceptsReturn="True" Margin="10" Header="フィルター" HorizontalAlignment="Stretch" Text="{Binding Filter.Value, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
<TextBox x:Uid="SettingsFlyout_Settings_Column_Filter_TextBox" Foreground="{StaticResource SettingsFlyoutTextblockForegroundBrush}" IsEnabled="{x:Bind ViewModel.CanChangeSetting.Value, Mode=OneWay}" MinHeight="128" MaxHeight="384" AcceptsReturn="True" Margin="10" Header="フィルター" HorizontalAlignment="Stretch" Text="{Binding Filter.Value, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />

</StackPanel>
</ScrollViewer>

<StackPanel Grid.Row="1">
<controls:HorizontalBar/>

<TextBlock Margin="10" TextWrapping="Wrap" Text="{x:Bind ViewModel.ErrorMessage.Value, Mode=OneWay}"/>
<TextBlock Foreground="{StaticResource SettingsFlyoutTextblockForegroundBrush}" Margin="10" TextWrapping="Wrap" Text="{x:Bind ViewModel.ErrorMessage.Value, Mode=OneWay}"/>

<controls:HorizontalBar/>

Expand Down

0 comments on commit 760bb51

Please sign in to comment.