Giter Club home page Giter Club logo

smartcontroller's Introduction

smartcontroller's People

Contributors

aconcavy avatar atria64 avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

aconcavy

smartcontroller's Issues

前回のサーバー接続情報を所持した状態で接続に失敗した時、Statusが意図しない挙動をする

#39前回のサーバー接続情報を所持した状態で接続に失敗した時 に起こるものだと特定した。

不具合の発生手順

  • サーバに接続を行った後、1度切断する。
  • サーバに接続できない状態で再起動を行う

本来どのような動作が望ましいか

StatusがBADになり、UIを反映させる

想定される原因

NullをSocketManagerに渡しているのが原因だと思われる。
SocketManagerをインスタンス化する際にNullを渡す可能性がある。

Null渡しても何も問題なかった

ソースコード

...
namespace SmartControllerAndroid
{
    [Activity(Label = "@string/app_name", Theme = "@style/AppTheme", MainLauncher = true)]
    public class MainActivity : AppCompatActivity, ISharedPreferencesOnSharedPreferenceChangeListener
    {
        ISharedPreferencesEditor editor;
        SocketManager socketManager;

        ...

        protected override async void OnCreate(Bundle savedInstanceState)
        {
            string ipAddress = PreferenceManager.GetDefaultSharedPreferences(this).GetString("IpAddress", null);
            if (await new SocketManager(ipAddress).PingAsync())
            {
                socketManager = new SocketManager(ipAddress);
                editor.PutInt("Status", (int)Status.OK).Apply();
            }
            else editor.PutInt("Status", (int)Status.BAD).Apply();
        }

        ...

    }
}

二本指でのスクロール

Webページを見ている際にほしいと思った。

二本指を上下にスワイプすることで、マウスホイールを動かしたい。

QRコードの再表示

接続するためのQRコードを再表示できるようにしたい。

  1. 接続が一定時間されなかったとき自動で開く(予期しない時に開く可能性がある)
  2. コンソールから起動できるようにする(現実的)

最大移動量の設定

2d9b75c 現在、移動量が大きすぎてカーソルを見失ってしまう。
これを防ぐために、最大移動量をユーザー側で設定できるようにしたい。

SeekBarPreferenceのdefaultValueが動作していない

どのような不具合を確認しましたか?

題名通り。一部ソースコードを貼るが、SeekBarPreferenceのdefaultValueが動作していない。

<SeekBarPreference
        app:key="MoveSpeed"
        android:title="スワイプ感度"
        android:summary="スワイプによる移動量を調節できます"
        android:max="10"
        android:defaultValue="5"
        app:iconSpaceReserved="false"
        app:showSeekBarValue="true"/>

不具合発生時のスクリーンショット

image

本来どのような動作が望ましいか

初期値を正しく設定したい。

ダイレクト接続

未接続状態時、QRコード接続ボタンの下にダイレクト接続ボタンを設置する。
ダイレクト接続押下後ダイアログが表示され、ipアドレスを直接指定して接続を試みることができるようにする。

右クリック判定時間調節

既定値では0.5秒以上のタップでロングタップ判定(右クリック判定)としている。
これをユーザー側で調節したい。

単体テストを書く

かなり苦戦している。

役に立つかも知れない記事

自分と全く同じやりたい目標&症状が現れている。

However, using the framework of Xamarin.UITest or NUnit for .Net Framework, I get the following error:
Message: System.IO.FileNotFoundException: Could not load file or assembly 'Mono.Android, Version = 0.0.0.0, Culture = neutral, PublicKeyToken = 84e04ff9cfb79065' or one of its dependencies. The system can not find the specified file.

c# - Xamarin Android UnitTest and Instrumentation Test (not Forms) - Stack Overflow

移動量調整設定

2d9b75c 現在、生の移動量をServerに飛ばしているので移動量がとてつもない。
これをユーザー側で調整したい。

ウォークスルーがほしい

概要

アプリの使い方や仕様などを説明する、スワイプで読み進めるチュートリアル。

理想動作

初回起動時に表示され、スワイプで読み進めることができるもの。

なぜその機能がほしいのか(必須)

ユーザーがこのアプリケーション&システムを利用しやすくするため

実装方法

  • ウォークスルー用Activityを作成する
  • 各ページFragmentを新しく立てる
  • 初回起動時のみウォークスルー用Activityを起動するコードを書く

参考URL/資料

アプリ導入画面のチュートリアル(ウォークスルー)をViewPagerで実装する【Android】

デバッグオプション[設定ファイル削除]の追加

欲しい機能はどのようなものか(必須)

設定ファイルを削除することができるデバッグオプション。

なぜその機能がほしいのか(必須)

#29 のような勘違いの回避

実装方法

  • タップで動作するPreferenceScreenをxmlファイルに記述
  • クリックリスナーを定義して動作処理を書く

参考URL/資料

StatusをSharedPreferencesで管理したい

現行の実装ではMainActivityからしかアクセスすることができない。

具体的には、PreferenceFragment でサーバー終了処理 #15 を行った際に接続に失敗したときに困る。

実装部分

private void UpdateStatus(Status nextStatus)
        {
            //UIはメインスレッドで操作する
            var handler = new Handler(Looper.MainLooper);
            handler.Post(() => {
                switch (nextStatus)
                {
                    case Status.BAD:
                        statusBar.Background = ContextCompat.GetDrawable(this, Resource.Color.badStatus);
                        textView.Text = "未接続";
                        mainLayout.Touch -= OnTouch;
                        qrButton.Visibility = ViewStates.Visible;
                        break;
                    case Status.UNKNOWN:
                        statusBar.Background = ContextCompat.GetDrawable(this, Resource.Color.unknownStatus);
                        textView.Text = "接続チェック中";
                        break;
                    case Status.OK:
                        statusBar.Background = ContextCompat.GetDrawable(this, Resource.Color.okStatus);
                        textView.Text = "接続完了";
                        mainLayout.Touch += OnTouch;
                        qrButton.Visibility = ViewStates.Gone;
                        break;
                }
            });
        }

参考

SharedPreferences でアプリの設定値を保存する | まくまくAndroidノート - SharedPreferences オブジェクトの変更を監視する

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.