2019-06-20から1日間の記事一覧

Kotlin 戻り値をジェネリクスとした抽象メソッドの定義と実装、TemplateMethodの応用

APIで取得したJsonデータをパース、Modelメンバにパースした値をセットしてオブジェクトを返す。という処理をtemplate method的な固有実装のみサブクラスに実装したかったので勉強しました。 クラス関係 //ジェネリクスは継承先のクラスが指定する open abst…

Android 処理中インジゲーターを表示する

導入 ProgressDialogはdeprecatedになったので、ProgressBarを使用する <ProgressBar style="?android:attr/progressBarStyle" android:id="@+id/progressBar" android:layout_width="wrap_content" android:layout_height="wrap_content" android:visibility="invisible" /> style="?android:attr/progressBarStyle"でくるくる回るインジゲーターや横棒の進捗バ…</progressbar>

Android ViewにPull to Refreshを導入する

導入 android.support.v4.widget.SwipeRefreshLayoutを使用する。 サポートライブラリを指定せず、<SwipeRefreshLayout></SwipeRefreshLayout>と記述すると、Error inflating class SwipeRefreshLayoutとなり、ビルドは通るがXMLパースでコケる。