Sayohat rejasi ilovasi


AdapterFlipper_BaseAdapter klasi



Download 348,13 Kb.
bet7/9
Sana02.07.2023
Hajmi348,13 Kb.
#953512
1   2   3   4   5   6   7   8   9
Bog'liq
Sayohatni rejalashtirish kurs ishi

AdapterFlipper_BaseAdapter klasi:
package com.example.kursishi;
import android.content.Context;
import android.graphics.Typeface;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.core.content.res.ResourcesCompat;

import java.util.ArrayList;

public class AdapterFlipper_BaseAdapter extends BaseAdapter {

Context context;
ArrayList models_list;
LayoutInflater inflater;

public AdapterFlipper_BaseAdapter(Context context, ArrayList models_list) {


this.context = context;
this.models_list = models_list;
inflater = LayoutInflater.from(context.getApplicationContext());
}

@Override


public int getCount() {
return models_list.size();
}

@Override


public Object getItem(int i) {
return models_list.get(i);
}

@Override


public long getItemId(int i) {
return 0;
}

@Override


public View getView(int i, View view, ViewGroup viewGroup) {

view = inflater.inflate(R.layout.homeadapterflipper, null);

ImageView picture, favourite;
TextView name, state;

picture = view.findViewById(R.id.adapterflipper_image);


name = view.findViewById(R.id.adapterflipper_name);
state = view.findViewById(R.id.adapterflipper_state);
favourite=view.findViewById(R.id.adapterflipper_fav);

AdapterFlipperModel model = models_list.get(i);

name.setText(model.name);
state.setText(model.state);
picture.setImageResource(model.image);
favourite.setImageResource(R.drawable.ic_baseline_favorite_24);

Typeface latoblack = ResourcesCompat.getFont(context, R.font.lato_black);


Typeface latobold = ResourcesCompat.getFont(context, R.font.lato_bold);

name.setTypeface(latoblack);


state.setTypeface(latobold);

return view;


}
}



Download 348,13 Kb.

Do'stlaringiz bilan baham:
1   2   3   4   5   6   7   8   9




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish