BÖLÜM 1 / 2
Görsel Arayüz (ProgressBar XML)
Kullanıcıdan yenilen kaloriyi almak için Input, bütçeyi göstermek için yatay ilerleme çubuğu ayarlıyoruz.
Unity Editör Adımları
xml dosyasına ProgressBar (style="?android:attr/progressBarStyleHorizontal") ekle.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="match_parent"
android:orientation="vertical" android:padding="20dp" android:gravity="center_horizontal">
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Günlük Hedef: 2500 kcal" android:textSize="20sp"/>
<ProgressBar android:id="@+id/kaloriProgress" style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent" android:layout_height="30dp"
android:max="2500" android:progress="0" android:layout_marginTop="20dp"/>
<TextView android:id="@+id/txtKalan" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Kalan: 2500"/>
<EditText android:id="@+id/editYiyecek" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="Kalori Gir (örn: 300)" android:inputType="number"/>
<Button android:id="@+id/btnEkle" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Listeye Ekle"/>
</LinearLayout>