Buttons
sketchware pro မှာပါတဲ့ material button widget ရဲ့ attribute လေးတွေသုံးပြီး button design လေးတွေ အလွယ်တကူ ပြောင်းကြည့်မယ်။attribute တွေကို inject button သုံးပြီး ထည့်ရတယ် Icon တွေကိုတော့ မိမိ project ထဲမှာ image file တစ်ခုထည့်ပြီး အဲဒီ image နာမည်ခေါ်သုံးပေးရတယ်။ နားမလည်ရင် လုပ်နည်းအဆင့်ဆင့်ကို အောက်က video ကိုကြည့်ပါ။
Raised Button
style="@style/Widget.MaterialComponents.Button"
Raised Button with icon
style="@style/Widget.MaterialComponents.Button.Icon" app:icon="@drawable/ic_favorite_white"
Outlined Button
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
Outlined Button with icon
style="@style/Widget.MaterialComponents.Button.OutlinedButton.Icon" app:icon="@drawable/ic_favorite_white"
Flat Button
style="@style/Widget.MaterialComponents.Button.TextButton"
Flat Button with icon
style="@style/Widget.MaterialComponents.Button.TextButton.Icon" app:icon="@drawable/ic_favorite_white"
Normal button ကို background drawable ကိုသုံးပြီး အလှဆင်နည်း -
normal button တစ်ခု မှာ အောက်က code ကို inject လုပ်ပြီးသုံးနိုင်တယ် gradient1 ဆိုတာကတော့ drawable folder ထဲမှာ ထည့်ထားတဲ့ gradient1.xml ဆိုတဲ့ file နာမည်ပါ မိမိကြိုက်ရာ နာမည်ပေးနိုင်ပါတယ် ။
android:background="@drawable/gradient1"
gradient1.xml ထဲမှာတော့ အောက်က code ကို ထည့်ပေးပါ။
<shape xmlns:android="http://schemas.android.com/apk/res/android"> <corners android:radius="19dp" /> <gradient android:angle="45" android:endColor="#FBC7D4" android:startColor="#9796F0" android:type="linear" /> </shape>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <gradient android:startColor="#77A1D3" android:centerColor="#79CBCA" android:endColor="#E684AE" android:angle="45" /> </shape>
Comments