Project Uas Pemrograman Java: Dosen Pengampu: Edy Subowo, ST., M.Kom

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 8

PROJECT UAS PEMROGRAMAN JAVA

Dosen Pengampu : Edy Subowo, ST., M.Kom

Disusun Oleh :

Aditia widianto

201903010011

PROGRAM STUDI MANAJEMEN INFORMATIKA

FAKULTAS TEKNIK DAN ILMU KOMPUTER

UNIVERSITAS MUHAMMADIYAH PEKAJANGAN PEKALONGAN

2021
1. Tampilan Pemutar Youtube
2. Tampilan Resep Masakan Nusantara
3. Tampilan Biodata Pribadi
4. Tampilan Tebak Buah
<?xml version="1.0" encoding="utf-8"?> <com.google.android.youtube.player.You
TubePlayerView
<LinearLayout
xmlns:android="http://schemas.android.co android:id="@+id/youtube_player"
m/apk/res/android"
android:layout_width="match_parent"
xmlns:tools="http://schemas.android.co
m/tools" android:layout_height="match_parent"></
com.google.android.youtube.player.YouTu
android:id="@+id/activity_main" bePlayerView>

android:layout_width="match_parent"

android:layout_height="match_parent" </LinearLayout>

android:paddingBottom="@dimen/activity package subowo.edy.aplikasiresep;


_vertical_margin"  
import android.app.Activity;
android:paddingLeft="@dimen/activity_h import android.content.Intent;
orizontal_margin" import android.os.Bundle;
import
android:paddingRight="@dimen/activity_ android.support.v7.widget.RecyclerView;
horizontal_margin" import android.view.LayoutInflater;
import android.view.View;
android:paddingTop="@dimen/activity_ve import android.view.ViewGroup;
rtical_margin" import android.widget.TextView;
 
android:orientation="vertical" import java.util.ArrayList;
 
tools:context="com.subowo.youtubeplayer /**
onapps.MainActivity"> * Created by subowo.edy on 24/11/2017.
*/
 
public class DataAdapter extends
<TextView RecyclerView.Adapter<RecyclerView.Vie
wHolder> {
android:textStyle="bold"     private ArrayList<DataModel>
dataModelArrayList;
android:gravity="center"     private Activity activity;
    public DataAdapter(Activity activity,
android:layout_width="wrap_content"
ArrayList<DataModel>
android:layout_height="wrap_content" dataModelArrayList) {
        this.activity = activity;
android:text="Subscribe :         this.dataModelArrayList =
url/channel/UCt7a2o143ngbccCuV0ZMrp dataModelArrayList;
    }
Q"
 
android:layout_marginBottom="10dp"/>     @Override
    public RecyclerView.ViewHolder     public static class HeaderHolder extends
onCreateViewHolder(ViewGroup parent, RecyclerView.ViewHolder {
int viewType) {         public HeaderHolder(View view) {
        RecyclerView.ViewHolder             super(view);
viewHolder = null;         }
        LayoutInflater inflater =     }
LayoutInflater.from(parent.getContext());     public static class FooterHolder extends
        switch(viewType){ RecyclerView.ViewHolder {
            case 1:{         public FooterHolder(View view) {
                View v =             super(view);
inflater.inflate(R.layout.list_item, parent,         }
false);     }
                viewHolder = new  
ItemHolder(v);     @Override
                break;     public void onBindViewHolder(final
            } RecyclerView.ViewHolder viewHolder,
            case 2:{ final int position) {
                View v =         switch(getItem(position).getViewTyp
inflater.inflate(R.layout.list_header, parent, e()){
false);             case 1:{
                viewHolder = new                 ItemHolder holder =
HeaderHolder(v); (ItemHolder) viewHolder;
                break;                 holder.txtJudul.setText(getItem(
            } position).getJudul());
            case 3:{  
                View v =                 holder.itemView.setOnClickList
inflater.inflate(R.layout.list_footer, parent, ener(new View.OnClickListener() {
false);                     @Override
                viewHolder = new                     public void onClick(final
FooterHolder(v); View v) {
                break; //ke halaman detail
                          Intent intent = new
  Intent(activity, DetailActivity.class);
            }                         Bundle bundle = new
  Bundle();
        }                         bundle.putSerializable("dat
        return viewHolder; aModel", getItem(position));
    }                         intent.putExtras(bundle);
                          activity.startActivity(intent)
    public static class ItemHolder extends ;
RecyclerView.ViewHolder {                     }
        public TextView txtJudul;                 });
        public ItemHolder(View view) {  
            super(view);                 break;
            txtJudul = (TextView)             }
view.findViewById(R.id.txtJudul);         }
        }     }
    }  
   
      @Override
    public int getItemViewType(int
position) {
        return
dataModelArrayList.get(position).getView
Type();
    }
 
 
    public DataModel getItem(int position)
{
        return
dataModelArrayList.get(position);
    }
 
 
    @Override
    public int getItemCount() {
        return dataModelArrayList.size();
    }
 
}

You might also like