Tuesday 8 January 2019

Create Calendar in Android Studio

DialogAdaptor.Java 
 

import android.annotation.TargetApi;
import android.app.Activity;
import android.os.Build;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import java.util.ArrayList;

public class DialogAdaptor extends BaseAdapter {
    Activity activity;

    private Activity context;
    private ArrayList<Dialogpojo> alCustom;
    private String sturl;


    public DialogAdaptor(Activity context, ArrayList<Dialogpojo> alCustom) {
        this.context = context;
        this.alCustom = alCustom;

    }

    @Override    public int getCount() {
        return alCustom.size();

    }

    @Override    public Object getItem(int i) {
        return alCustom.get(i);
    }

    @Override    public long getItemId(int i) {
        return i;
    }

    @TargetApi(Build.VERSION_CODES.O)
    @Override    public View getView(final int position, View convertView, ViewGroup parent) {
        LayoutInflater inflater = context.getLayoutInflater();
        View listViewItem = inflater.inflate(R.layout.row_addapt, null, true);

        TextView tvTitle=(TextView)listViewItem.findViewById(R.id.tv_name);
        TextView tvSubject=(TextView)listViewItem.findViewById(R.id.tv_type);
        TextView tvDuedate=(TextView)listViewItem.findViewById(R.id.tv_desc);
        TextView tvDescription=(TextView)listViewItem.findViewById(R.id.tv_class);


        tvTitle.setText("Title : "+alCustom.get(position).getTitles());
        tvSubject.setText("Subject : "+alCustom.get(position).getSubjects());
        tvDuedate.setText("Due Date : "+alCustom.get(position).getDuedates());
        tvDescription.setText("Description : "+alCustom.get(position).getDescripts());

        return  listViewItem;
    }

}

Dialogpojo.Java
 

public class Dialogpojo {
    private String titles;
    private String subjects;
    private String types;
    private String duedates;
    private String descripts;
    private String attatchmentd;
    private String sections;
    private String classe;

    public void setTitles(String titles) {
        this.titles = titles;
    }

    public void setSubjects(String subjects) {
        this.subjects = subjects;
    }

    public void setTypes(String types) {
        this.types = types;
    }

    public void setDuedates(String duedates) {
        this.duedates = duedates;
    }

    public void setDescripts(String descripts) {
        this.descripts = descripts;
    }

    public void setAttatchmentd(String attatchmentd) {
        this.attatchmentd = attatchmentd;
    }

    public String getTitles() {
        return titles;
    }

    public String getSubjects() {
        return subjects;
    }

    public String getTypes() {
        return types;
    }

    public String getDuedates() {
        return duedates;
    }

    public String getDescripts() {
        return descripts;
    }

    public String getAttatchmentd() {
        return attatchmentd;
    }

    public void setSections(String sections) {
        this.sections = sections;
    }

    public void setClasse(String classe) {
        this.classe = classe;
    }

    public String getClasse() {
        return classe;
    }

    public String getSections() {
        return sections;
    }
}
 

HomeCollection.Java


import java.util.ArrayList;
public class HomeCollection {
    public String date="";
    public String name="";
    public String subject="";
    public String description="";


    public static ArrayList<HomeCollection> date_collection_arr;
    public HomeCollection(String date, String name, String subject, String description){

        this.date=date;
        this.name=name;
        this.subject=subject;
        this.description= description;

    }
}

HwAdapter.Java



import android.widget.BaseAdapter;
import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.graphics.Color;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.GregorianCalendar;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;


public class HwAdapter extends BaseAdapter {
    private Activity context;

    private java.util.Calendar month;
    public GregorianCalendar pmonth;
    /**     * calendar instance for previous month for getting complete view     */    public GregorianCalendar pmonthmaxset;
    private GregorianCalendar selectedDate;
    int firstDay;
    int maxWeeknumber;
    int maxP;
    int calMaxP;
    int mnthlength;
    String itemvalue, curentDateString;
    DateFormat df;

    private ArrayList<String> items;
    public static List<String> day_string;
    public ArrayList<HomeCollection>  date_collection_arr;
    private String gridvalue;
    private ListView listTeachers;
    private ArrayList<Dialogpojo> alCustom=new ArrayList<Dialogpojo>();

    public HwAdapter(Activity context, GregorianCalendar monthCalendar,ArrayList<HomeCollection> date_collection_arr) {
        this.date_collection_arr=date_collection_arr;
        HwAdapter.day_string = new ArrayList<String>();
        Locale.setDefault(Locale.US);
        month = monthCalendar;
        selectedDate = (GregorianCalendar) monthCalendar.clone();
        this.context = context;
        month.set(GregorianCalendar.DAY_OF_MONTH, 1);

        this.items = new ArrayList<String>();
        df = new SimpleDateFormat("yyyy-MM-dd", Locale.US);
        curentDateString = df.format(selectedDate.getTime());
        refreshDays();

    }

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

    public Object getItem(int position) {
        return day_string.get(position);
    }

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

    // create a new view for each item referenced by the Adapter    public View getView(int position, View convertView, ViewGroup parent) {
        View v = convertView;
        TextView dayView;
        if (convertView == null) { // if it's not recycled, initialize some            // attributes            LayoutInflater vi = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            v = vi.inflate(R.layout.cal_item, null);

        }


        dayView = (TextView) v.findViewById(R.id.date);
        String[] separatedTime = day_string.get(position).split("-");


        gridvalue = separatedTime[2].replaceFirst("^0*", "");
        if ((Integer.parseInt(gridvalue) > 1) && (position < firstDay)) {
            dayView.setTextColor(Color.parseColor("#A9A9A9"));
            dayView.setClickable(false);
            dayView.setFocusable(false);
        } else if ((Integer.parseInt(gridvalue) < 7) && (position > 28)) {
            dayView.setTextColor(Color.parseColor("#A9A9A9"));
            dayView.setClickable(false);
            dayView.setFocusable(false);
        } else {
            // setting curent month's days in blue color.            dayView.setTextColor(Color.parseColor("#696969"));
        }


        if (day_string.get(position).equals(curentDateString)) {

            v.setBackgroundColor(Color.parseColor("#ffffff"));
        } else {
            v.setBackgroundColor(Color.parseColor("#ffffff"));
        }


        dayView.setText(gridvalue);

        // create date string for comparison        String date = day_string.get(position);

        if (date.length() == 1) {
            date = "0" + date;
        }
        String monthStr = "" + (month.get(GregorianCalendar.MONTH) + 1);
        if (monthStr.length() == 1) {
            monthStr = "0" + monthStr;
        }

        setEventView(v, position,dayView);

        return v;
    }

    public void refreshDays() {
        // clear items        items.clear();
        day_string.clear();
        Locale.setDefault(Locale.US);
        pmonth = (GregorianCalendar) month.clone();
        // month start day. ie; sun, mon, etc        firstDay = month.get(GregorianCalendar.DAY_OF_WEEK);
        // finding number of weeks in current month.        maxWeeknumber = month.getActualMaximum(GregorianCalendar.WEEK_OF_MONTH);
        // allocating maximum row number for the gridview.        mnthlength = maxWeeknumber * 7;
        maxP = getMaxP(); // previous month maximum day 31,30....        calMaxP = maxP - (firstDay - 1);// calendar offday starting 24,25 ...        pmonthmaxset = (GregorianCalendar) pmonth.clone();

        pmonthmaxset.set(GregorianCalendar.DAY_OF_MONTH, calMaxP + 1);


        for (int n = 0; n < mnthlength; n++) {

            itemvalue = df.format(pmonthmaxset.getTime());
            pmonthmaxset.add(GregorianCalendar.DATE, 1);
            day_string.add(itemvalue);

        }
    }

    private int getMaxP() {
        int maxP;
        if (month.get(GregorianCalendar.MONTH) == month                .getActualMinimum(GregorianCalendar.MONTH)) {
            pmonth.set((month.get(GregorianCalendar.YEAR) - 1),
                    month.getActualMaximum(GregorianCalendar.MONTH), 1);
        } else {
            pmonth.set(GregorianCalendar.MONTH,
                    month.get(GregorianCalendar.MONTH) - 1);
        }
        maxP = pmonth.getActualMaximum(GregorianCalendar.DAY_OF_MONTH);

        return maxP;
    }

    public void setEventView(View v,int pos,TextView txt){

        int len=HomeCollection.date_collection_arr.size();
        for (int i = 0; i < len; i++) {
            HomeCollection cal_obj=HomeCollection.date_collection_arr.get(i);
            String date=cal_obj.date;
            int len1=day_string.size();
            if (len1>pos) {

                if (day_string.get(pos).equals(date)) {
                    if ((Integer.parseInt(gridvalue) > 1) && (pos < firstDay)) {

                    } else if ((Integer.parseInt(gridvalue) < 7) && (pos > 28)) {

                    } else {
                        v.setBackgroundColor(Color.parseColor("#343434"));
                        v.setBackgroundResource(R.drawable.rounded_calender);
                        txt.setTextColor(Color.parseColor("#696969"));
                    }

                }
            }}
    }

    public void getPositionList(String date,final Activity act){

        int len= HomeCollection.date_collection_arr.size();
        JSONArray jbarrays=new JSONArray();
        for (int j=0; j<len; j++){
            if (HomeCollection.date_collection_arr.get(j).date.equals(date)){
                HashMap<String, String> maplist = new HashMap<String, String>();
                maplist.put("hnames",HomeCollection.date_collection_arr.get(j).name);
                maplist.put("hsubject",HomeCollection.date_collection_arr.get(j).subject);
                maplist.put("descript",HomeCollection.date_collection_arr.get(j).description);
                JSONObject json1 = new JSONObject(maplist);
                jbarrays.put(json1);
            }
        }
        if (jbarrays.length()!=0) {
            final Dialog dialogs = new Dialog(context);
            dialogs.setContentView(R.layout.dialog_inform);
            listTeachers = (ListView) dialogs.findViewById(R.id.list_teachers);
            ImageView imgCross = (ImageView) dialogs.findViewById(R.id.img_cross);
            listTeachers.setAdapter(new DialogAdaptor(context, getMatchList(jbarrays + "")));
            imgCross.setOnClickListener(new View.OnClickListener() {
                @Override                public void onClick(View view) {
                    dialogs.dismiss();
                }
            });
            dialogs.show();

        }

    }

    private ArrayList<Dialogpojo> getMatchList(String detail) {
        try {
            JSONArray jsonArray = new JSONArray(detail);
            alCustom = new ArrayList<Dialogpojo>();
            for (int i = 0; i < jsonArray.length(); i++) {

                JSONObject jsonObject = jsonArray.optJSONObject(i);

                Dialogpojo pojo = new Dialogpojo();

                pojo.setTitles(jsonObject.optString("hnames"));
                pojo.setSubjects(jsonObject.optString("hsubject"));
                pojo.setDescripts(jsonObject.optString("descript"));

                alCustom.add(pojo);

            }


        } catch (JSONException e) {
            e.printStackTrace();
        }
        return alCustom;
    }
}

MainActivity.Java


import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.GridView;
import android.widget.ImageButton;
import android.widget.TextView;
import android.widget.Toast;
import java.util.ArrayList;
import java.util.GregorianCalendar;

public class MainActivity extends AppCompatActivity {
    public GregorianCalendar cal_month, cal_month_copy;
    private HwAdapter hwAdapter;
    private TextView tv_month;
    @Override    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        HomeCollection.date_collection_arr=new ArrayList<HomeCollection>();
        HomeCollection.date_collection_arr.add( new HomeCollection("2019-01-01" ,"New Year's Day","Holiday","Today is holiday"));
        HomeCollection.date_collection_arr.add( new HomeCollection("2019-01-14" ,"Makar Sankranti /Pongal","Holiday","Today is holiday"));
        HomeCollection.date_collection_arr.add( new HomeCollection("2019-01-26" ,"Republic Day","Holiday","Today is holiday"));
        HomeCollection.date_collection_arr.add( new HomeCollection("2019-03-04" ,"Maha Shivaratri","Holiday","Today is holiday"));
        HomeCollection.date_collection_arr.add( new HomeCollection("2019-03-21" ,"Holi","Holiday","Today is holiday"));
        HomeCollection.date_collection_arr.add( new HomeCollection("2019-04-06" ,"Ugadi/Gudi Padwa","Holiday","Today is holiday"));
        HomeCollection.date_collection_arr.add( new HomeCollection("2019-04-13" ,"Ram Navami","Holiday","Today is holiday"));
        HomeCollection.date_collection_arr.add( new HomeCollection("2019-04-17" ,"Mahavir Jayanti","Holiday","Today is holiday"));
        HomeCollection.date_collection_arr.add( new HomeCollection("2019-04-19" ,"Good Friday","Holiday","Today is holiday"));
        HomeCollection.date_collection_arr.add( new HomeCollection("2019-05-01" ,"Labor Day","Holiday","Today is holiday"));



        cal_month = (GregorianCalendar) GregorianCalendar.getInstance();
        cal_month_copy = (GregorianCalendar) cal_month.clone();
        hwAdapter = new HwAdapter(this, cal_month,HomeCollection.date_collection_arr);

        tv_month = (TextView) findViewById(R.id.tv_month);
        tv_month.setText(android.text.format.DateFormat.format("MMMM yyyy", cal_month));


        ImageButton previous = (ImageButton) findViewById(R.id.ib_prev);
        previous.setOnClickListener(new View.OnClickListener() {
            @Override            public void onClick(View v) {
                if (cal_month.get(GregorianCalendar.MONTH) == 4&&cal_month.get(GregorianCalendar.YEAR)==2017) {
                    //cal_month.set((cal_month.get(GregorianCalendar.YEAR) - 1), cal_month.getActualMaximum(GregorianCalendar.MONTH), 1);                    Toast.makeText(MainActivity.this, "Event Detail is available for current session only.", Toast.LENGTH_SHORT).show();
                }
                else {
                    setPreviousMonth();
                    refreshCalendar();
                }


            }
        });
        ImageButton next = (ImageButton) findViewById(R.id.Ib_next);
        next.setOnClickListener(new View.OnClickListener() {
            @Override            public void onClick(View v) {
                if (cal_month.get(GregorianCalendar.MONTH) == 5&&cal_month.get(GregorianCalendar.YEAR)==2018) {
                    //cal_month.set((cal_month.get(GregorianCalendar.YEAR) + 1), cal_month.getActualMinimum(GregorianCalendar.MONTH), 1);                    Toast.makeText(MainActivity.this, "Event Detail is available for current session only.", Toast.LENGTH_SHORT).show();
                }
                else {
                    setNextMonth();
                    refreshCalendar();
                }
            }
        });
        GridView gridview = (GridView) findViewById(R.id.gv_calendar);
        gridview.setAdapter(hwAdapter);
        gridview.setOnItemClickListener(new AdapterView.OnItemClickListener() {

            public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
                String selectedGridDate = HwAdapter.day_string.get(position);
                ((HwAdapter) parent.getAdapter()).getPositionList(selectedGridDate, MainActivity.this);
            }

        });
    }
    protected void setNextMonth() {
        if (cal_month.get(GregorianCalendar.MONTH) == cal_month.getActualMaximum(GregorianCalendar.MONTH)) {
            cal_month.set((cal_month.get(GregorianCalendar.YEAR) + 1), cal_month.getActualMinimum(GregorianCalendar.MONTH), 1);
        } else {
            cal_month.set(GregorianCalendar.MONTH,
                    cal_month.get(GregorianCalendar.MONTH) + 1);
        }
    }

    protected void setPreviousMonth() {
        if (cal_month.get(GregorianCalendar.MONTH) == cal_month.getActualMinimum(GregorianCalendar.MONTH)) {
            cal_month.set((cal_month.get(GregorianCalendar.YEAR) - 1), cal_month.getActualMaximum(GregorianCalendar.MONTH), 1);
        } else {
            cal_month.set(GregorianCalendar.MONTH, cal_month.get(GregorianCalendar.MONTH) - 1);
        }
    }

    public void refreshCalendar() {
        hwAdapter.refreshDays();
        hwAdapter.notifyDataSetChanged();
        tv_month.setText(android.text.format.DateFormat.format("MMMM yyyy", cal_month));
    }
}

Activity_main.xml

<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"    xmlns:app="http://schemas.android.com/apk/res-auto"    xmlns:tools="http://schemas.android.com/tools"    android:layout_width="match_parent"    android:layout_height="match_parent"    tools:context=".MainActivity">

    <LinearLayout        android:layout_width="match_parent"        android:layout_height="wrap_content"        android:layout_margin="4dp"        android:background="#343434"        android:id="@+id/ll_calendar"        android:orientation="vertical" >

        <LinearLayout            android:id="@+id/header"            android:layout_width="fill_parent"            android:layout_height="wrap_content"            android:background="#ffffff"            android:gravity="center"            android:orientation="horizontal"            android:padding="10dp" >

            <FrameLayout                android:layout_width="45dp"                android:layout_height="45dp" >

                <ImageButton                    android:id="@+id/ib_prev"                    android:layout_width="wrap_content"                    android:layout_height="wrap_content"                    android:layout_gravity="center"                    android:layout_margin="2dp"                    android:background="@drawable/left_arrow" />

            </FrameLayout>

            <RelativeLayout                android:layout_width="wrap_content"                android:layout_height="wrap_content"                android:layout_weight="1" >

                <TextView                    android:id="@+id/tv_month"                    android:layout_width="wrap_content"                    android:layout_height="wrap_content"                    android:layout_centerHorizontal="true"                    android:text="January"                    android:textColor="#4b4a4a"                    android:textSize="20dip"                    android:textStyle="bold" />
                <TextView                    android:layout_width="wrap_content"                    android:layout_height="wrap_content"                    android:layout_below="@+id/tv_month"                    android:text="Tap on day to see its detail"                    android:layout_centerHorizontal="true"                    android:textColor="#4b4a4a"                    android:textSize="12dp"                    android:textStyle="normal" />
            </RelativeLayout>

            <FrameLayout                android:layout_width="45dp"                android:layout_height="45dp" >

                <ImageButton                    android:id="@+id/Ib_next"                    android:layout_width="wrap_content"                    android:layout_height="wrap_content"                    android:layout_margin="2dp"                    android:background="@drawable/right_arrow" />

            </FrameLayout>
        </LinearLayout>

        <TableRow            android:id="@+id/tableRow1"            android:layout_width="match_parent"            android:layout_height="wrap_content"            android:paddingBottom="5dp"            android:background="#ffffff"            android:paddingLeft="2dp"            android:paddingRight="2dp"            android:paddingTop="6dp" >

            <TextView                android:id="@+id/TextView06"                android:layout_width="wrap_content"                android:layout_height="wrap_content"                android:layout_weight="1"                android:gravity="center"                android:text="S"                android:textColor="#4b4a4a" />

            <TextView                android:id="@+id/TextView05"                android:layout_width="wrap_content"                android:layout_height="wrap_content"                android:layout_weight="1"                android:gravity="center"                android:text="M"                android:textColor="#4b4a4a" />

            <TextView                android:id="@+id/TextView04"                android:layout_width="wrap_content"                android:layout_height="wrap_content"                android:layout_weight="1"                android:gravity="center"                android:text="T"                android:textColor="#4b4a4a" />

            <TextView                android:id="@+id/TextView03"                android:layout_width="wrap_content"                android:layout_height="wrap_content"                android:layout_weight="1"                android:gravity="center"                android:text="W"                android:textColor="#4b4a4a" />

            <TextView                android:id="@+id/TextView02"                android:layout_width="wrap_content"                android:layout_height="wrap_content"                android:layout_weight="1"                android:gravity="center"                android:text="T"                android:textColor="#4b4a4a" />

            <TextView                android:id="@+id/TextView01"                android:layout_width="wrap_content"                android:layout_height="wrap_content"                android:layout_weight="1"                android:gravity="center"                android:text="F"                android:textColor="#4b4a4a" />

            <TextView                android:id="@+id/textView1"                android:layout_width="wrap_content"                android:layout_height="wrap_content"                android:layout_weight="1"                android:gravity="center"                android:text="S"                android:textColor="#4b4a4a" />

        </TableRow>

        <TextView            android:id="@+id/textView2"            android:layout_width="match_parent"            android:layout_height="2dp"            android:background="#dfdfdf"            android:padding="1dp" />

        <GridView            android:id="@+id/gv_calendar"            android:layout_width="match_parent"            android:layout_height="wrap_content"            android:background="#ffffff"            android:cacheColorHint="#ffffff"            android:gravity="center"            android:listSelector="@android:color/transparent"            android:numColumns="7"            android:padding="2dp"            android:stretchMode="columnWidth"            android:textAlignment="gravity" >

        </GridView>

    </LinearLayout>
    <RelativeLayout        android:layout_width="match_parent"        android:layout_below="@+id/ll_calendar"        android:layout_height="match_parent">


    </RelativeLayout>

    <TextView        android:id="@+id/text_view_difficulty"        android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:layout_below="@id/ll_calendar"        android:freezesText="true"        android:gravity="center"        android:textSize="20dp"        android:layout_marginTop="80dp"        android:text="All Circle are Holiday!!"        android:textColor="@android:color/black" />

</RelativeLayout>
 
cal_item.xml
 
 
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:layout_width="fill_parent"    android:layout_height="fill_parent"    android:layout_gravity="center"    android:background="#ffffff"    android:gravity="center"    android:orientation="vertical"    android:padding="4dp" >

    <LinearLayout        android:layout_width="match_parent"        android:layout_height="wrap_content"        android:layout_gravity="center"        android:gravity="center"        android:orientation="vertical"        android:padding="1dp" >

        <TextView            android:id="@+id/date"            android:layout_width="wrap_content"            android:layout_height="wrap_content"            android:layout_margin="2dp"            android:gravity="center_vertical"            android:padding="2dp"            android:textColor="#3d3c3c"            android:textSize="14dip"            android:textStyle="bold" />

        <ImageView            android:id="@+id/date_icon"            android:layout_width="wrap_content"            android:layout_height="wrap_content"            android:visibility="gone" />

    </LinearLayout>

</LinearLayout>

dialog_inform.xml

<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:layout_width="match_parent"    android:layout_height="match_parent">

    <RelativeLayout        android:layout_width="match_parent"        android:id="@+id/tv_title"        android:layout_height="60dp">
        <ImageView            android:layout_width="20dp"            android:layout_height="20dp"            android:id="@+id/img_cross"            android:layout_marginLeft="10dp"            android:layout_marginTop="10dp"            android:src="@drawable/multiply"/>
        <TextView            android:layout_width="match_parent"            android:layout_height="wrap_content"            android:gravity="center"            android:layout_centerHorizontal="true"            android:layout_centerInParent="true"            android:text="Holiday"            android:layout_marginRight="10dp"            android:layout_marginLeft="10dp"            android:layout_toRightOf="@+id/img_cross"            android:textSize="18dp"            android:textColor="@color/colorPrimary"            android:id="@+id/tv_date"/>
        <View            android:layout_width="match_parent"            android:layout_marginTop="10dp"            android:layout_alignParentBottom="true"            android:background="#939393"            android:layout_height="0.2dp"/>

    </RelativeLayout>
    <ListView        android:layout_width="wrap_content"        android:id="@+id/list_teachers"        android:divider="#004e4e4e"        android:layout_below="@+id/tv_title"        android:dividerHeight="0dp"        android:layout_height="wrap_content">
    </ListView>

</RelativeLayout>

row_addapt.xml


<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:layout_width="match_parent"    android:layout_height="match_parent">

    <TextView        android:layout_width="match_parent"        android:layout_height="wrap_content"        android:paddingLeft="10dp"        android:layout_marginLeft="10dp"        android:layout_marginRight="10dp"        android:layout_centerHorizontal="true"        android:text="event on "        android:textColor="#696969"        android:layout_marginTop="10dp"        android:layout_below="@+id/tv_title"        android:textSize="16dp"        android:id="@+id/tv_name"/>
    <TextView        android:layout_width="match_parent"        android:layout_height="wrap_content"        android:paddingLeft="10dp"        android:layout_marginLeft="10dp"        android:layout_marginRight="10dp"        android:layout_centerHorizontal="true"        android:text="event on "        android:textColor="#696969"        android:layout_marginTop="5dp"        android:layout_below="@+id/tv_name"        android:textSize="16dp"        android:id="@+id/tv_type"/>
    <TextView        android:layout_width="match_parent"        android:layout_height="wrap_content"        android:paddingLeft="10dp"        android:visibility="gone"        android:layout_marginLeft="10dp"        android:layout_marginRight="10dp"        android:layout_centerHorizontal="true"        android:text="event on "        android:textColor="#696969"        android:layout_marginTop="5dp"        android:layout_below="@+id/tv_type"        android:textSize="16dp"        android:id="@+id/tv_desc"/>
    <TextView        android:layout_width="match_parent"        android:layout_height="wrap_content"        android:paddingLeft="10dp"        android:layout_marginLeft="10dp"        android:layout_marginRight="10dp"        android:layout_centerHorizontal="true"        android:text="event on "        android:textColor="#696969"        android:layout_marginTop="5dp"        android:layout_below="@+id/tv_desc"        android:textSize="16dp"        android:id="@+id/tv_class"/>
    <TextView        android:layout_width="match_parent"        android:layout_height="wrap_content"        android:paddingLeft="10dp"        android:layout_marginLeft="10dp"        android:layout_marginRight="10dp"        android:visibility="gone"        android:layout_centerHorizontal="true"        android:text="event on "        android:textColor="#696969"        android:layout_marginTop="5dp"        android:layout_below="@+id/tv_class"        android:textSize="16dp"        android:id="@+id/tv_section"/>
    <View        android:layout_width="match_parent"        android:background="#8f8e8e"        android:layout_below="@+id/tv_section"        android:id="@+id/visdf"        android:layout_marginRight="20dp"        android:layout_marginLeft="20dp"        android:layout_marginTop="10dp"        android:layout_height="1.5dp"/>
    <ImageView        android:layout_width="match_parent"        android:layout_height="65dp"        android:id="@+id/img_save"        android:layout_marginRight="20dp"        android:layout_below="@+id/visdf"        android:layout_marginLeft="20dp"        android:visibility="gone"        android:layout_marginTop="20dp"        />
    <View        android:layout_width="match_parent"        android:layout_marginTop="20dp"        android:visibility="gone"        android:background="#393939"        android:layout_marginLeft="20dp"        android:layout_marginRight="20dp"        android:layout_below="@+id/img_save"        android:layout_marginBottom="20dp"        android:layout_height="0.2dp"/>


</RelativeLayout>

Popular Posts

Categories

AI (27) Android (24) AngularJS (1) Assembly Language (2) aws (17) Azure (7) BI (10) book (4) Books (113) C (77) C# (12) C++ (82) Course (60) Coursera (176) coursewra (1) Cybersecurity (22) data management (11) Data Science (85) Data Strucures (6) Deep Learning (9) Django (6) Downloads (3) edx (2) Engineering (14) Excel (13) Factorial (1) Finance (5) flutter (1) FPL (17) Google (18) Hadoop (3) HTML&CSS (46) IBM (25) IoT (1) IS (25) Java (92) Leet Code (4) Machine Learning (43) Meta (18) MICHIGAN (4) microsoft (3) Pandas (3) PHP (20) Projects (29) Python (726) Python Coding Challenge (170) Questions (2) R (70) React (6) Scripting (1) security (3) Selenium Webdriver (2) Software (17) SQL (40) UX Research (1) web application (8)

Followers

Person climbing a staircase. Learn Data Science from Scratch: online program with 21 courses