デフォルトのプロパティ
構造的にViewGroupオブジェクトは、Viewオブジェクトを継承しています。このような関係のように、この二人は共通して持っている属性があります。今回のチュートリアルでは、基本的に知っているヤヤする属性について調べてみましょう。
プロジェクトを作成する
[File] >> [New] >> [New Project]
でEmpty Activityを選択し、新しいプロジェクトを作成してください。
プロジェクトは、作成すると、自動的にMainActivity.javaとactivity_main.xmlファイルが生成されます。 MainActivity.javaコードを見ると、activity_main.xmlにUI Layoutを定義するコードが入力されています。
Viewの高さと幅
Viewの幅と高さを定義する属性である android:layout_width
とandroid:layout_height
です。
これらのプロパティが変更されるViewのサイズがどのように変化するかを知ってみましょう。 /res/layout/activity_main.xml
ファイルのすべての内容を消去し、次のコードを入力してください。
コードを見ると、LinearLayoutは、4つのViewが含まれています。そして各Viewオブジェクトは、他のサイズでwidthとheightを定義しました。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="com.example.codestudio.myapplication.MainActivity">
<TextView
android:layout_width="100dp"
android:layout_height="100dp"
android:text="TextView01"
android:background="#80cbc4"/>
<TextView
android:layout_width="200dp"
android:layout_height="200dp"
android:text="TextView02"
android:background="#e0e0e0"/>
<TextView
android:layout_width="50dp"
android:layout_height="50dp"
android:text="TextView03"
android:background="#ababab"/>
<TextView
android:layout_width="50dp"
android:layout_height="50dp"
android:text="TextView04"
android:background="#e1bee7"/>
</LinearLayout>
アプリを起動すると、以下のような画面を見ることができます。 LinearLayoutサイズは見えませんが、画面全体の領域に設定された。その理由は、 layout_width
とlayout_height
が match_parent
に設定されているからです。 match_parentは親のサイズに応じてサイズを設定するという意味です。ここでLinearLayoutの親は、Activity全画面であるため、全画面サイズと同じに設定がされた。
TextViewを見ると、 layout_width
とlayout_height
属性に 100dp
ようdp単位で値が入力されました。画面でTextViewのサイズを見ると、入力したdpだけサイズが設定されたことを見ることができます。
dpは、Androidの密度単位(Density-independent pixel)で、Pixelと同様の意味と考えています。 dpの詳細については、マルチスクリーン対応:Android API guideページで確認することができます。
ちなみに、前の章でも述べたようにTextViewが縦に配置されたのは、 orientation
属性をvertical
に設定したからです。
また、TextViewオブジェクトを区別しやすいように「background」のプロパティに別の色を入力しました。 (色の値は#次に、R、G、Bに16進数の6つを入力します。) LinearLayoutはbackground属性を指定していないので、透明に設定されました。
match_parent、wrap_content
match_parent
は、オブジェクトのサイズを、その親のサイズだけを設定するという意味です。上記のコードでLinearLayoutのwidthとheightはmatch_parentを使用しました。
wrap_content
は、オブジェクトのサイズを、そのオブジェクトのContentサイズだけ設定するという意味です。
これらのプロパティについて見てみましょう。以下のコードを入力して、結果を確認してみてください。
TextView01はwidthとheight属性にwrap_contentを適用し、TextView02はmatch_parentを適用しました。 TextView03はdp単位で設定しました。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="com.example.codestudio.myapplication.MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView01"
android:background="#80cbc4"/>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="TextView02"
android:background="#e0e0e0"/>
<TextView
android:layout_width="400dp"
android:layout_height="400dp"
android:text="TextView03"
android:background="#ababab"/>
</LinearLayout>
wrap_contentは、オブジェクトが持っているcontentのサイズ分だけの長さを増やしてくれます。 TextView01のContentはTextView01という字ですが、その文字の縦、横のサイズだけViewのwidth、heightサイズが設定されました。
match_parentは、親ViewGroupのサイズだけの長さを設定します。 TextView02の親ViewGroupはLinearLayoutです。だからwidthは横領域全体が設定された。 match_parentに設定されると、heightは画面全体のサイズに設定する必要がありますが、LinearLayoutでは、まず描かれたオブジェクトの領域を除いて、残りの領域の合計サイズに設定できます。画面を見ればTextView01が描かれて、残りの領域全体のサイズにTextView02のheightが設定された。
TextView03は、画面に表示されていません。その理由は、LinearLayoutは上から下に順番にサイズを計算するためです。コード上の最上部にあるTextView01のサイズを計算するときに、自分のサイズだけの領域を占め、その次TextView02のサイズを計算するときに、残りの領域がすべて使用されました。最後に、TextView03のサイズを計算しようとしたがLinearLayoutに空き容量がなく、画面の中に描かれました。
LinearLayoutは、内部オブジェクトを上から下の順序でサイズを計算するとしている。今回はTextView01にwidthとheightにmatch_parentを入力してみましょう。次のコードを入力し、結果を確認してください。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="com.example.codestudio.myapplication.MainActivity">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="TextView01"
android:background="#80cbc4"/>
<TextView
android:layout_width="200dp"
android:layout_height="match_parent"
android:text="TextView02"
android:background="#e0e0e0"/>
<TextView
android:layout_width="400dp"
android:layout_height="400dp"
android:text="TextView03"
android:background="#ababab"/>
</LinearLayout>
LinearLayoutはTextView01からサイズを計算します。 widthとheightはmatch_parentに設定され、誰もスペースを使用していないので、親であるLinearLayoutの高さと幅に設定された。
その次にTextView02とTextView03のサイズを計算しようとしたがTextView01が既に使い果たしてしまったので、画面の中に描かれました。従ってこの二つのViewは見られません。
wrap_parentを適用した例も一度戻って確認してみましょう。次のコードを入力し、結果を確認してください。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="com.example.codestudio.myapplication.MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="100dp"
android:text="TextView01"
android:background="#80cbc4"/>
<TextView
android:layout_width="200dp"
android:layout_height="wrap_content"
android:text="TextView02"
android:background="#e0e0e0"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView03"
android:background="#ababab"/>
</LinearLayout>
wrap_contentに入力された領域は、Contentサイズほどの長さが設定され、dpに設定した部分は、dpだけサイズが設定されました。
パディング(Padding)
パディング(padding)は、Viewオブジェクトとその内容(content)との間にギャップ(または余白)を設定するプロパティです。例としてパッティングがどのような属性であることを確認してみましょう。以下のコードを入力して、結果を確認してください。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="com.example.codestudio.myapplication.MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView01"
android:paddingLeft="30dp"
android:background="#80cbc4"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingRight="30dp"
android:text="TextView02"
android:background="#e0e0e0"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="30dp"
android:text="TextView03"
android:background="#ababab"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="30dp"
android:text="TextView04"
android:background="#a1887f"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="30dp"
android:paddingRight="30dp"
android:paddingLeft="30dp"
android:paddingBottom="30dp"
android:text="TextView05"
android:background="#ff8a65"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="30dp"
android:text="TextView06"
android:background="#81c784"/>
</LinearLayout>
実行すると、以下のようにTextViewオブジェクトにpaddingが適用されたことを見ることができます。 TextView01の場合 paddingLeft="30dp"
に設定されて30dpほどの間隔を置いてContent(TextView01文字)を配置しました。
TextView02の場合 paddingRight="30dp"
に設定されて右30dpほど間隔ウール置いContentを配置しました。
TextView03の場合 android:paddingTop="30dp"
に設定されて上向きに30dpほどの間隔を置いてCotentを配置しました。
TextView04の場合 android:paddingBottom="30dp"
に設定されて下方に30dpほどの間隔を置いてCotentを配置しました。
TextView05の場合、すべての方向に30dpだけ設定しので、すべての方向に30dpほどの間隔を置いてContentを配置しました。
TextView06の場合 android:padding="30dp"
で入力したが、TextView05と同様にすべての方向に30dpだけに適用するということを意味します。
パディングは、ViewオブジェクトとそのオブジェクトのContentの余白を調整するため、PaddingもViewオブジェクトの領域に含まれます。だから背景色(Background)を指定したときPaddingを含むViewオブジェクトの領域に適用されることを見ることができます。
マージン(Margin)
マージンは、Viewオブジェクトとその親であるViewGroupオブジェクトとの間隔(マージン)を設定するプロパティです。パディングとは別の方法でViewオブジェクトと親オブジェクトとの余白を置くのでマージンは、Viewオブジェクトの領域に含まれていません。だからBackgroundを指定したときのマージンを除いたViewオブジェクトのみ背景色が適用されます。
例としてマージンがどのような属性であることを説明します。以下のコードを入力して、結果を確認してください。
マージンは、Viewオブジェクトに含まれていないため、背景色を入れても見えません。だから区分やすくTextViewを利用して、区切り線を作成しました。
<!-- 分周器です -->
コメントがあるTextViewオブジェクトは分周器であるため、無視してください。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="com.example.codestudio.myapplication.MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView01"
android:layout_marginLeft="30dp"
android:background="#80cbc4"/>
<TextView
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#000000"/> <!-- 分周器です -->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="30dp"
android:text="TextView02"
android:background="#e0e0e0"/>
<TextView
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#000000"/> <!-- 分周器です -->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:text="TextView03"
android:background="#ababab"/>
<TextView
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#000000"/> <!-- 分周器です -->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="30dp"
android:text="TextView04"
android:background="#a1887f"/>
<TextView
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#000000"/> <!-- 分周器です -->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:layout_marginRight="30dp"
android:layout_marginLeft="30dp"
android:layout_marginBottom="30dp"
android:text="TextView05"
android:background="#ff8a65"/>
<TextView
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#000000"/> <!-- 分周器です -->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="30dp"
android:text="TextView06"
android:background="#81c784"/>
<TextView
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#000000"/> <!-- 分周器です -->
</LinearLayout>
TextView01の場合 layout_marginLeft="30dp"
が設定されてLinearLayoutの左30dpだけ間隔を置いてTextView01を配置しました。背景色は、マージン領域に適用されていない。
TextView02、03、04の場合も、右、上、下方向に間隔を置いて、オブジェクトが配置されました。
TextView05、TextView06の場合、すべての方向にマージンを適用した場合です。
Color
android:background
またはandroid:textColor
などの属性にColorを入力すると、背景や文字の色が変更されます。この属性に加え、Colorを入力する部分があります。例を通してColorを入力する方法について説明します。
まず、 /res/values/colors.xml
にmycolor変数を追加してください。 xml形式でnameに変数名を、elementに#以降の16進数6文字を入力してください。 (前から16進数2個ずつ、R、G、Bを意味します。)
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#FF4081</color>
<color name="mycolor">#ab12ab</color>
</resources>
そして、 /res/layout/activity_main.xml
に以下のコードを入力して、結果を確認してください。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="com.example.codestudio.myapplication.MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView01"
android:textColor="#a1887f"
android:padding="30dp"
android:background="#80cbc4"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView02"
android:padding="30dp"
android:textColor="@color/mycolor"
android:background="#e0e0e0"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView03"
android:padding="30dp"
android:textColor="@android:color/holo_green_dark"
android:background="#ababab"/>
</LinearLayout>
TextView01の場合 textColor="#a1887f"
のように直接RGB値を入力して色を設定しました。
TextView02の場合 textColor="@color/mycolor"
のように変数に設定したcolorを使用して色を設定しました。 Color変数は /res/values/colors.xml
で宣言することができます。
TextView03の場合 textColor="@android:color/holo_green_dark"
のようにSystem変数を使用しました。 @android:color/
で始まる変数はSystemにすでに宣言された変数に個別に宣言する必要がありません。
Gravity
Gravityは、オブジェクト内のContentの位置を設定する属性です。例をGravity属性が何であるかを説明します。以下のコードを入力して、結果を確認してください。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="com.example.codestudio.myapplication.MainActivity">
<TextView
android:layout_width="150dp"
android:layout_height="50dp"
android:text="TextView01"
android:gravity="left"
android:background="#80cbc4"/>
<TextView
android:layout_width="150dp"
android:layout_height="50dp"
android:text="TextView02"
android:gravity="right"
android:background="#e0e0e0"/>
<TextView
android:layout_width="150dp"
android:layout_height="50dp"
android:text="TextView03"
android:gravity="center_horizontal"
android:background="#ababab"/>
<TextView
android:layout_width="150dp"
android:layout_height="50dp"
android:text="TextView04"
android:gravity="center_vertical"
android:background="#a1887f"/>
<TextView
android:layout_width="150dp"
android:layout_height="50dp"
android:text="TextView05"
android:gravity="center"
android:background="#ff8a65"/>
<TextView
android:layout_width="150dp"
android:layout_height="50dp"
android:text="TextView06"
android:gravity="bottom"
android:background="#81c784"/>
<TextView
android:layout_width="150dp"
android:layout_height="50dp"
android:text="TextView07"
android:gravity="top|center_horizontal"
android:background="#29b6f6"/>
<TextView
android:layout_width="150dp"
android:layout_height="50dp"
android:text="TextView08"
android:gravity="bottom|center_horizontal"
android:background="#5c6bc0"/>
<TextView
android:layout_width="150dp"
android:layout_height="50dp"
android:text="TextView09"
android:gravity="bottom|right"
android:background="#f06292"/>
</LinearLayout>
TextView01の場合 gravity="left"
を設定して、ContentがViewの左側に位置しています。
TextView02の場合 gravity="right"
を設定して、ContentがViewの右側に位置しています。
TextView03の場合 gravity="center_horizontal"
を設定して、ContentがViewの横軸の中央に位置しています。
TextView04の場合 gravity="center_vertical"
を設定して、ContentがViewの縦軸の中央に位置しています。
TextView05の場合 gravity="center"
を設定して、ContentがViewの横軸と縦軸の中央に位置しています。
TextView06の場合 gravity="bottom"
を設定して、ContentがViewの下部に位置しています。
TextView07の場合 gravity="top|center_horizontal"
を設定して、Viewの上部の横軸の中央に位置しています。 TextView07は |
演算子を使用して2つを同時に適用しました。
TextView08の場合 gravity="bottom|center_horizontal"
を設定して、Viewの下側の横軸の中央に位置しています。この場合も、2つを同時に適用しました。
TextView09の場合 gravity="bottom|right"
を設定して、Viewの右下に位置しています。この場合も、2つを同時に適用しました。
layout_gravity
layout_gravityは、オブジェクトがその親ViewGroup内で表示される位置を定義するために使用する属性です。例をlayout_gravityがどの属性であることを説明します。以下のコードを入力して、結果を確認してください。
今まで親VidwGroupはLinearLayoutだったが、今回は親ViewGroupがFrameLayoutになるように設定しました。その理由は、LinearLayoutは上から下に順番にオブジェクトのサイズを計算する属性があってlayout_gravityすべてのプロパティを見て見るの限らできるからです。 FrameLayoutは後で詳しく説明します。この章では、このようなことがあるという程度見てください。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="com.example.codestudio.myapplication.MainActivity">
<FrameLayout
android:layout_width="150dp"
android:layout_height="50dp"
android:background="#e0e0e0">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView01"
android:layout_gravity="left"
android:background="#80cbc4"/>
</FrameLayout>
<FrameLayout
android:layout_width="150dp"
android:layout_height="50dp"
android:background="#a1887f">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView02"
android:layout_gravity="center_horizontal"
android:background="#f8bbd0"/>
</FrameLayout>
<FrameLayout
android:layout_width="150dp"
android:layout_height="50dp"
android:background="#e1bee7">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView03"
android:layout_gravity="right"
android:background="#ff8a65"/>
</FrameLayout>
<FrameLayout
android:layout_width="150dp"
android:layout_height="50dp"
android:background="#bbdefb ">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView04"
android:layout_gravity="center"
android:background="#81c784"/>
</FrameLayout>
<FrameLayout
android:layout_width="150dp"
android:layout_height="50dp"
android:background="#b2dfdb">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView05"
android:layout_gravity="center_vertical"
android:background="#f3e5f5"/>
</FrameLayout>
<FrameLayout
android:layout_width="150dp"
android:layout_height="50dp"
android:background="#ffb74d">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView06"
android:layout_gravity="center_vertical|right"
android:background="#2196f3"/>
</FrameLayout>
<FrameLayout
android:layout_width="150dp"
android:layout_height="50dp"
android:background="#bcaaa4">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView07"
android:layout_gravity="bottom"
android:background="#ff7043"/>
</FrameLayout>
<FrameLayout
android:layout_width="150dp"
android:layout_height="50dp"
android:background="#a5d6a7 ">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView08"
android:layout_gravity="bottom|right"
android:background="#7986cb"/>
</FrameLayout>
<FrameLayout
android:layout_width="150dp"
android:layout_height="50dp"
android:background="#f0f4c3">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView09"
android:layout_gravity="bottom|center_horizontal"
android:background="#f48fb1"/>
</FrameLayout>
</LinearLayout>
TextView01の場合 layout_gravity="left"
を設定しました。 TextView01の親であるViewGroupは横150dp、縦50dpのFrameLayoutオブジェクトです。 leftに設定したため、FrameLayoutの左側にTextView01オブジェクトが位置しています。
TextView02の場合 layout_gravity="center_horizontal"
を設定して、FrameLayoutの横軸の中央にオブジェクトが位置しています。
TextView03の場合 layout_gravity="right"
を設定して、FrameLayoutの右側にオブジェクトが位置しています。
TextView04の場合 layout_gravity="center"
を設定して、FrameLayoutの横側中央とセロチュク中央にオブジェクトが位置しています。
TextView05の場合 layout_gravity="center_vertical"
を設定して、FrameLayoutのセロチュク中央にオブジェクトが位置しています。
TextView06の場合 layout_gravity="center_vertical|right"
を設定して、FrameLayoutの右側のセロチュク中央にオブジェクトが位置しています。
TextView07の場合 layout_gravity="bottom"
を設定して、FrameLayoutの下部にオブジェクトが位置しています。
TextView08の場合 layout_gravity="bottom|right"
を設定して、FrameLayoutの右下にオブジェクトが位置しています。
TextView09の場合 layout_gravity="bottom|center_horizontal"
を設定して、FrameLayoutの下部の横側中央にオブジェクトが位置しています。
まとめ
基本的なViewの属性に対して調べました。自分が意図したとおりUI Layoutを変更するには、Viewの基本的な属性を知っている必要があります。
チュートリアルで使用したコードは、GitHub:Layout基本属性で確認することができます。
参考
Related Posts
- エラー解決:android gradle plugin requires java 11 to run. you are currently using java 1.8.
- Android - コルーチンとRetrofitによる非同期通信の例
- Android - コルーチンでURL画像を読み込む
- Android - 振動、Vibrator、VibrationEffectの例
- Some problems were found with the configuration of task
- Query method parameters should either be a type that can be converted into a database column or a List
- UbuntuでAndroid 12オープンソースをダウンロードしてビルド
- Android - ViewModelを生成する方法
- Android - Transformations.map(), switchMap() の違い
- Android-Transformations.distinctUntilChanged()소개
- Android - TabLayoutの実装方法(+ ViewPager2)
- Android - 携帯電話の電話番号を取得する方法
- Android 12 - Splash Screens
- Android 12 - インクリメンタルインストール
- Android - adbコマンドでbugreportログファイルの抽出
- Android - adbコマンドでAppデータを削除する
- Android - adbコマンドでアプリ無効化、有効化
- Android - adbコマンドで特定のパッケージのPIDを検索
- Android - adbコマンドでパーミッションGrantまたはRevoke
- Android - adbコマンドでapkのインストール、削除、
- Android - adbコマンドで特定のパッケージのプロセスの終了
- Android - adb push、pullでファイルのコピー、ダウンロード
- Android - adbコマンドでscreen capture保存
- Android - adbコマンドでSystemアプリの削除、インストール
- Android - adbコマンドでsettings value確認、変更、
- Android 12 - IntentFilterのexported明示的な宣言
- Android - adbコマンドで工場出荷時の(Factory reset)
- Android - adb logcatコマンドでログ出力
- Android - adbコマンドでメモリダンプ(dump-heap)
- Android - adbコマンドでApp強制終了(force-stop)
- Android - adbコマンドでServiceの実行、終了
- Android - adbコマンドでBroadcast配信
- Android - adbコマンドでActivity実行
- Android - PackageManagerにPackage情報を取得する
- Android - ACTION_BOOT_COMPLETEDイベント受信