Android: layout weight="1" android: orientation="vertical"


Download 87.41 Kb.
Sana30.04.2023
Hajmi87.41 Kb.
#1404290
Bog'liq
Kodlar




android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical"
android:layout_margin="10dp"
android:layout_width="match_parent">

android:src="@drawable/dars_soati"
android:layout_height="wrap_content"
android:layout_width="wrap_content"/>

android:layout_margin="5dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:orientation="horizontal">

android:layout_height="wrap_content"
android:layout_width="match_parent"
android:id="@+id/Cla"
android:layout_weight="2"
android:textSize="20sp"
android:textColor="#AC1D1D"
android:text="Class"/>
android:layout_height="wrap_content"
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_margin="5dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:orientation="horizontal">

android:layout_height="wrap_content"
android:layout_width="match_parent"
android:id="@+id/Classa"
android:layout_weight="2"
android:textSize="20sp"
android:textColor="#AC1D1D"
android:text="Class"/>

android:layout_height="wrap_content"
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_width="match_parent"
android:layout_margin="10dp"
android:layout_height="wrap_content">

android:layout_width="match_parent"
android:layout_height="wrap_content">

android:src="@drawable/user"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
android:gravity="start|center"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="wrap_content">
android:text="Name"
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:text="lavozim"
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_gravity="end"
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:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="match_parent">


android:layout_height="wrap_content"

android:layout_width="match_parent"


android:layout_margin="10dp">
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="vertical">

android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@drawable/dars_soati">



android:layout_width="wrap_content"
android:layout_weight="1"
android:background="@color/purple_700"
android:layout_height="wrap_content"
android:text="9:30-10:15"/>



android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="horizontal">
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="10dp"
android:background="@color/teal_200"
android:padding="5dp"
android:text="Class"/>
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/purple_200"
android:layout_margin="10dp"
android:text=" 5-A "/>


android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="horizontal">
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="10dp"
android:padding="5dp"
android:background="@color/purple_200"
android:text="Class"/>
android:layout_width="match_parent"
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 android.os.CountDownTimer;
import android.os.Handler;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.example.learningandroid.R;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

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