Android

レイアウト作成<Switch android:id="@+id/toggle_switch" android:layout_width="wrap_content" android:layout_height="wrap_content" android:checked="true" android:textColor="#3e3e3e" android:text="toggle switc ...

Android

1 サポート ライブラリを dependencies セクションに追加

implementation ‘androidx.recyclerview:recyclerview:1.1.0’

2 RecyclerView をレイアウトに追加する

<androidx.recyclerview.widget.RecyclerView android:id="@+i ...

Android

WebViewClientを設定してロード時の処理を定義する//WebViewインスタンスの生成WebView webview = new WebView(this);//WebViewClientの設定webview.setWebViewClient(new WebViewClient() {//新しいURLが指定されたときの処理を定義@Overridepublic boolean should ...

Android

少ない開発リソースでAndroidアプリをダークモードに対応した話

これからAndroidでダークモードを実装するエンジニア/デザイナ向け資料

Androidアプリでダークテーマを実装する

要約
ダークテーマの実装の流れは

テーマの切り替えを実装して
ダークテーマ用にリソースを用意して
レイアウトにあててデザインを確認する ...

Android

こっちが良さそう

ImageButton imageButton = (ImageButton)findViewById(R.id.imagebutton1);imageButton.setEnabled(false);

カラー

imageButton.setColorFilter(0xaa808080);Button buttonA = (Button) findViewB ...

Android

・テンプレートから始められる。

 

・既存のプロジェクトに追加する場合は、

New → Activity → Bottom Navigation Activity

・Modelファイルは、「ui」フォルダの中にある。

Fragmentのほうに、onViewCreatedで、作っていく。fragmentなので。Modelでも ...

Android

Android Toolbar

1.res\values\styles.xmlにNoActionBarを継承したテーマを作成

<resources><!-- Base application theme. --><style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"><!-- Custom ...

Android

Android 64k問題を回避するための設定方法

.モジュール レベル(アプリケーションレベル)の build.gradle ファイルで multiDexEnabled を trueに

android { defaultConfig { ... minSdkVersion 21 targetSdkVersion 26 multiDexEnabled true ← コレ } ...