Android: layout weight="1" android: orientation="vertical"
Download 87.41 Kb.
|
Kodlar
android:layout_weight="1" android:orientation="vertical" android:layout_margin="10dp" android:layout_width="match_parent"> android:layout_height="wrap_content" android:layout_width="wrap_content"/> android:layout_weight="1" android:layout_height="match_parent" android:layout_width="match_parent" android:orientation="horizontal"> android:layout_width="match_parent" android:id="@+id/Cla" android:layout_weight="2" android:textSize="20sp" android:textColor="#AC1D1D" android:text="Class"/> android:layout_width="match_parent" android:id="@+id/classas" android:textSize="20sp" android:layout_weight="1" android:textColor="#630404" android:text="5-A" android:textStyle="bold"/> android:layout_weight="1" android:layout_height="match_parent" android:layout_width="match_parent" android:orientation="horizontal"> android:layout_width="match_parent" android:id="@+id/Classa" android:layout_weight="2" android:textSize="20sp" android:textColor="#AC1D1D" android:text="Class"/> android:layout_width="match_parent" android:id="@+id/classs" android:textSize="20sp" android:layout_weight="1" android:textColor="#630404" android:text="5-A" android:textStyle="bold"/> Item_user dagi kod android:layout_margin="10dp" android:layout_height="wrap_content"> android:layout_height="wrap_content"> android:layout_width="wrap_content" android:layout_height="wrap_content"/> android:layout_width="match_parent" android:orientation="vertical" android:layout_height="wrap_content"> android:id="@+id/name" android:layout_margin="20dp" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="#000" android:textSize="18dp"/> android:id="@+id/lavozim" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textStyle="bold" android:layout_margin="20dp" android:textColor="#000" android:textSize="18sp"/> android:layout_margin="20dp" android:text="15-yil" android:id="@+id/staj" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textStyle="bold" android:textColor="#000" android:textSize="18sp"/> Item_darsjadvali dagi kodi; android:orientation="vertical" android:layout_height="match_parent"> android:layout_width="match_parent" android:layout_margin="10dp"> android:layout_height="wrap_content" android:layout_margin="10dp" android:orientation="vertical"> android:layout_height="wrap_content" android:src="@drawable/dars_soati"> android:layout_weight="1" android:background="@color/purple_700" android:layout_height="wrap_content" android:text="9:30-10:15"/> android:layout_height="wrap_content" android:layout_margin="10dp" android:orientation="horizontal"> android:layout_height="match_parent" android:layout_margin="10dp" android:background="@color/teal_200" android:padding="5dp" android:text="Class"/> android:layout_height="match_parent" android:background="@color/purple_200" android:layout_margin="10dp" android:text=" 5-A "/> android:layout_height="wrap_content" android:layout_margin="10dp" android:orientation="horizontal"> android:layout_height="match_parent" android:layout_margin="10dp" android:padding="5dp" android:background="@color/purple_200" android:text="Class"/> android:layout_height="match_parent" android:background="@color/teal_200" android:layout_margin="10dp" android:text=" 5-A "/> Timer uchun kod??? Akbar Dommila, [22.08.2022 14:36] String currentDate = new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault()).format(new Date()); String currentTime = new SimpleDateFormat("HH:mm:ss", Locale.getDefault()).format(new Date()); Hozirgi vaqt va sanani olish Akbar Dommila, [22.08.2022 15:14] new CountDownTimer(30000, 1000) { public void onTick(long millisUntilFinished) { textTimer.setText("" + millisUntilFinished / 1000); } public void onFinish() { textTimer.setText("Done"); } }.start(); Akbar Dommila, [22.08.2022 15:23] package com.example.learningandroid.ui.ui; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle;
import com.example.learningandroid.R; import java.text.SimpleDateFormat;
public class TimerActivity extends AppCompatActivity { Button btn; TextView textTimer; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_timer); textTimer = findViewById(R.id.timerTxt); btn = findViewById(R.id.start_btn); blink(); } private void blink() { final Handler hander = new Handler(); new Thread(new Runnable() { @Override public void run() { hander.post(new Runnable() { @Override public void run() { String currentTime = new SimpleDateFormat("HH:mm:ss", Locale.getDefault()).format(new Date()); textTimer.setText(" " +currentTime); blink(); } }); } }).start(); } } Download 87.41 Kb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling