Madmicro Report
Madmicro Report
Of
Mobile Application Development
4351604
Ttitle:-
“Event management app”
By:-
Devaliya jenish k.(216200316001)
Of
Sem5-it-A
Under Guidance of
Khayati Kalaria Ma’am
Abstact
This Event Rental System allows users to find and book event rental
equipment and services. Users can search for local rental providers, and
compare prices and reviews from other users. The app also offers a
scheduling feature for users to set up rental periods and delivery times.
The app is designed for event planners and organizers who want to rent
equipment and services for their events, such as tents, tables, chairs,
lighting, and sound systems.
Event Planning: Users can create and manage events
by specifying details such as date, time, location, and
the type of event.
Key feature:-
1. Guest Management: The app allows for efficient
guest list management, including sending invitations,
tracking RSVPs, and managing guest preferences.
2. Agenda and Schedule: Users can design event
schedules and agendas, ensuring that attendees are
informed about all activities and sessions.
3. Ticketing and Registration: The app facilitates
ticket sales and event registration, making it easy for
both organizers and attendees to participate.
4. Vendor and Sponsor Management: Event
organizers can coordinate with vendors and
sponsors, manage contracts, and handle logistics
seamlessly.
5. Seating Arrangement: For events requiring seating
arrangements, the app offers tools to design floor
plans and optimize seating for guests.
6. Communication Tools: Users can send event
updates, notifications, and announcements to
attendees through the app.
7. Analytics and Reporting: Robust data analytics
help organizers track attendee engagement, ticket
sales, and other key metrics.
8. Mobile Accessibility: The app is accessible on
mobile devices, ensuring that event organizers can
manage their events on the go.
10.Security and Privacy: Robust security measures
protect sensitive event data and ensure the privacy of
organizers and attendees.
Activity_mainxml
Code:-
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/main_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white"
android:fitsSystemWindows="true">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="@dimen/detail_backdrop_height"
android:fitsSystemWindows="true"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
app:contentScrim="?attr/colorPrimary"
app:expandedTitleMarginEnd="64dp"
app:expandedTitleMarginStart="48dp"
app:expandedTitleTextAppearance="@android:color/transparent"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/backdrop"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:scaleType="centerCrop"
app:layout_collapseMode="parallax" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:gravity="center_horizontal"
android:orientation="vertical">
<TextView
android:id="@+id/love_music"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textColor="@android:color/white"
android:textSize="@dimen/backdrop_title"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textColor="@android:color/white"
android:textSize="@dimen/backdrop_subtitle" />
</LinearLayout>
</RelativeLayout>
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
Acticvitymain.xml
Code:-
</RelativeLayout>
Activitymain.java
Code:-
package event.management;
import android.content.res.Resources;
import android.graphics.Rect;
import android.os.Bundle;
import android.util.TypedValue;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.ImageView;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.recyclerview.widget.DefaultItemAnimator;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import com.google.android.material.appbar.AppBarLayout;
import
com.google.android.material.appbar.CollapsingToolbarLayout;
import java.util.ArrayList;
import java.util.List;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
initCollapsingToolbar();
recyclerView = (RecyclerView)
findViewById(R.id.recycler_view);
prepareAlbums();
try {
Glide.with(this).load(R.drawable.pic1).into((ImageView)
findViewById(R.id.backdrop));
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.menu_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle item selection
switch (item.getItemId()) {
case R.id.action_notif:
Toast.makeText(MainActivity.this, "Notification
On",
Toast.LENGTH_LONG).show();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
/**
* Initializing collapsing toolbar
* Will show and hide the toolbar title on scroll
*/
private void initCollapsingToolbar() {
final CollapsingToolbarLayout collapsingToolbar =
(CollapsingToolbarLayout)
findViewById(R.id.collapsing_toolbar);
collapsingToolbar.setTitle(" ");
AppBarLayout appBarLayout = (AppBarLayout)
findViewById(R.id.appbar);
appBarLayout.setExpanded(true);
@Override
public void onOffsetChanged(AppBarLayout
appBarLayout, int verticalOffset) {
if (scrollRange == -1) {
scrollRange =
appBarLayout.getTotalScrollRange();
}
if (scrollRange + verticalOffset == 0) {
collapsingToolbar.setTitle(getString(R.string.app_name));
isShow = true;
} else if (isShow) {
collapsingToolbar.setTitle(" ");
isShow = false;
}
}
});
}
/**
* Adding few albums for testing
*/
private void prepareAlbums() {
int[] covers = new int[]{
R.drawable.general,
R.drawable.aue,
R.drawable.cse,
R.drawable.ec,
R.drawable.eee,
R.drawable.me,
R.drawable.mtr,
R.drawable.mca,
R.drawable.album9,
R.drawable.album10,
R.drawable.album11};
adapter.notifyDataSetChanged();
}
/**
* RecyclerView item decoration - give equal margin around
grid item
*/
public class GridSpacingItemDecoration extends
RecyclerView.ItemDecoration {
@Override
public void getItemOffsets(Rect outRect, View view,
RecyclerView parent, RecyclerView.State state) {
int position = parent.getChildAdapterPosition(view);
// item position
int column = position % spanCount; // item column
if (includeEdge) {
outRect.left = spacing - column * spacing /
spanCount; // spacing - column * ((1f / spanCount) * spacing)
outRect.right = (column + 1) * spacing /
spanCount; // (column + 1) * ((1f / spanCount) * spacing)
/**
* Converting dp to pixel
*/
private int dpToPx(int dp) {
Resources r = getResources();
return
Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
dp, r.getDisplayMetrics()));
}
Output:-
Splash.screen_xml
Code:-
<ImageView
android:id="@+id/imgLogo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:foregroundGravity="center_horizontal"
android:src="@drawable/edgeicon" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="10dp"
android:gravity="center_horizontal"
android:text="NSITE 2k19"
android:textColor="@color/viewBg"
android:textSize="12dp" />
</RelativeLayout>
Splash activity.java
Code:-
package event.management;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);
/*
* Showing splash screen with a timer. This will be
useful when you
* want to show case your app logo / company
*/
@Override
public void run() {
// This method will be executed once the timer
is over
// Start your app main activity
Intent i = new Intent(SplashScreen.this,
MainActivity.class);
startActivity(i);
Album_card.xml
Code:-
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.cardview.widget.CardView
android:id="@+id/card_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_margin="@dimen/card_margin"
android:elevation="3dp"
card_view:cardCornerRadius="@dimen/card_album_radius">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/thumbnail"
android:layout_width="match_parent"
android:layout_height="@dimen/album_cover_height"
android:background="?attr/selectableItemBackgroundBorderless"
android:clickable="true"
android:scaleType="fitXY" />
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/thumbnail"
android:paddingLeft="@dimen/album_title_padding"
android:paddingRight="@dimen/album_title_padding"
android:paddingTop="@dimen/album_title_padding"
android:textColor="@color/album_title"
android:textSize="@dimen/album_title" />
<TextView
android:id="@+id/count"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/title"
android:paddingBottom="@dimen/songs_count_padding_bottom"
android:paddingLeft="@dimen/album_title_padding"
android:paddingRight="@dimen/album_title_padding"
android:textSize="@dimen/songs_count" />
<ImageView
android:id="@+id/overflow"
android:layout_width="@dimen/ic_album_overflow_width"
android:layout_height="@dimen/ic_album_overflow_height"
android:layout_alignParentRight="true"
android:layout_below="@id/thumbnail"
android:layout_marginTop="@dimen/ic_album_overflow_margin_top"
android:layout_marginRight="5dp"
android:scaleType="centerCrop"
android:src="@drawable/ic_insta" />
</RelativeLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>
Album.java
Code:-
package event.management;
/**
* Created by Lincoln on 18/05/16.
*/
public class Album {
private String name;
private int numOfSongs;
private int thumbnail;
public Album() {
}
Output:-
Code:-
package event.management;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import java.util.List;
/**
* Created by Ravi Tamada on 18/05/16.
*/
public class AlbumsAdapter extends
RecyclerView.Adapter<AlbumsAdapter.MyViewHolder> {
@Override
public MyViewHolder onCreateViewHolder(ViewGroup parent, int
viewType) {
View itemView = LayoutInflater.from(parent.getContext())
.inflate(R.layout.album_card, parent, false);
Glide.with(mContext).load(album.getThumbnail()).into(holder.thumb
nail);
holder.thumbnail.setOnClickListener(new
View.OnClickListener() {
@Override
public void onClick(View v) {
// Do something
Intent editintent = new Intent(mContext,
EventActivity.class);
editintent.putExtra("deptname", getname);
mContext.startActivity(editintent);
}
});
holder.itemView.setOnClickListener(new
View.OnClickListener() {
@Override
public void onClick(View v) {
// Do something
Intent editintent = new Intent(mContext,
EventActivity.class);
editintent.putExtra("deptname", getname);
mContext.startActivity(editintent);
}
});
holder.overflow.setOnClickListener(new
View.OnClickListener() {
@Override
public void onClick(View view) {
//showPopupMenu(holder.overflow);
Uri uri =
Uri.parse("https://instagram.com/nsite2k19?
utm_source=ig_profile_share&igshid=vmqpaurfflt3");
String getname =
holder.title.getText().toString();
if( getname.equals( "COMPUTER SCIENCE" ) ) {
uri =
Uri.parse("https://instagram.com/brocode2k19?
utm_source=ig_profile_share&igshid=122widnt5ycks");
}
else if( getname.equals( "MECHANICAL" ) ) {
uri =
Uri.parse("https://instagram.com/mechmerize2019?
utm_source=ig_profile_share&igshid=16ry9c2bgqx1n");
}
else if( getname.equals( "MECHATRONICS" ) ) {
uri =
Uri.parse("https://instagram.com/yantrikxix?
utm_source=ig_profile_share&igshid=5pigno1tfx0k");
}
else if( getname.equals( "ELECTRONICS AND
COMMUNICATION" ) ) {
uri =
Uri.parse("https://www.instagram.com/eclectique2k19_/");
}
else {
uri =
Uri.parse("https://instagram.com/nsite2k19?
utm_source=ig_profile_share&igshid=vmqpaurfflt3");
}
try {
mContext.startActivity(likeIng);
} catch (ActivityNotFoundException e) {
mContext.startActivity(new
Intent(Intent.ACTION_VIEW,
Uri.parse("http://instagram.com/")));
}
}
});
}
/**
* Showing popup menu when tapping on 3 dots
*/
/*
private void showPopupMenu(View view) {
// inflate menu
PopupMenu popup = new PopupMenu(mContext, view);
MenuInflater inflater = popup.getMenuInflater();
inflater.inflate(R.menu.menu_album, popup.getMenu());
popup.setOnMenuItemClickListener(new
MyMenuItemClickListener());
popup.show();
}
*/
/**
* Click listener for popup menu items
*/
/*
class MyMenuItemClickListener implements
PopupMenu.OnMenuItemClickListener {
public MyMenuItemClickListener() {
}
@Override
public boolean onMenuItemClick(MenuItem menuItem) {
switch (menuItem.getItemId()) {
case R.id.action_add_favourite:
Toast.makeText(mContext, "Add to favourite",
Toast.LENGTH_SHORT).show();
return true;
case R.id.action_play_next:
Toast.makeText(mContext, "Play next",
Toast.LENGTH_SHORT).show();
return true;
default:
}
return false;
}
}
*/
@Override
public int getItemCount() {
return albumList.size();
}
}
Album_card.xml
Code:-
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.cardview.widget.CardView
android:id="@+id/card_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_margin="@dimen/card_margin"
android:elevation="3dp"
card_view:cardCornerRadius="@dimen/card_album_radius">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/thumbnail"
android:layout_width="match_parent"
android:layout_height="@dimen/album_cover_height"
android:background="?attr/selectableItemBackgroundBorderless"
android:clickable="true"
android:scaleType="fitXY" />
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/thumbnail"
android:paddingLeft="@dimen/album_title_padding"
android:paddingRight="@dimen/album_title_padding"
android:paddingTop="@dimen/album_title_padding"
android:textColor="@color/album_title"
android:textSize="@dimen/album_title" />
<TextView
android:id="@+id/count"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/title"
android:paddingBottom="@dimen/songs_count_padding_bottom"
android:paddingLeft="@dimen/album_title_padding"
android:paddingRight="@dimen/album_title_padding"
android:textSize="@dimen/songs_count" />
<ImageView
android:id="@+id/overflow"
android:layout_width="@dimen/ic_album_overflow_width"
android:layout_height="@dimen/ic_album_overflow_height"
android:layout_alignParentRight="true"
android:layout_below="@id/thumbnail"
android:layout_marginTop="@dimen/ic_album_overflow_margin_top"
android:layout_marginRight="5dp"
android:scaleType="centerCrop"
android:src="@drawable/ic_call" />
</RelativeLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>
Album card2_xml
Code:-
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.cardview.widget.CardView
android:id="@+id/card_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_margin="@dimen/card_margin"
android:elevation="3dp"
card_view:cardCornerRadius="@dimen/card_album_radius">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/thumbnail"
android:layout_width="match_parent"
android:layout_height="@dimen/album_cover_height"
android:background="?attr/selectableItemBackgroundBorderless"
android:clickable="true"
android:scaleType="fitXY" />
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/thumbnail"
android:paddingLeft="@dimen/album_title_padding"
android:paddingRight="@dimen/album_title_padding"
android:paddingTop="@dimen/album_title_padding"
android:textColor="@color/album_title"
android:textSize="@dimen/album_title" />
<TextView
android:id="@+id/count"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/title"
android:paddingBottom="@dimen/songs_count_padding_bottom"
android:paddingLeft="@dimen/album_title_padding"
android:paddingRight="@dimen/album_title_padding"
android:textSize="@dimen/songs_count" />
<ImageView
android:id="@+id/overflow"
android:layout_width="@dimen/ic_album_overflow_width"
android:layout_height="@dimen/ic_album_overflow_height"
android:layout_alignParentRight="true"
android:layout_below="@id/thumbnail"
android:layout_marginTop="@dimen/ic_album_overflow_margin_top"
android:layout_marginRight="5dp"
android:scaleType="centerCrop"
android:src="@drawable/ic_call" />
</RelativeLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>
Albums adapter2.java
Code:-
package event.management;
import android.content.Context;
import android.content.Intent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import java.util.List;
/**
* Created by Ravi Tamada on 18/05/16.
*/
public class AlbumsAdapter2 extends
RecyclerView.Adapter<AlbumsAdapter2.MyViewHolder> {
@Override
public MyViewHolder onCreateViewHolder(ViewGroup parent, int
viewType) {
View itemView = LayoutInflater.from(parent.getContext())
.inflate(R.layout.album_card2, parent, false);
@Override
public void onBindViewHolder(final MyViewHolder holder, int
position) {
Album album = albumList.get(position);
holder.title.setText(album.getName());
//holder.count.setText(album.getNumOfSongs() + "
songs");
Glide.with(mContext).load(album.getThumbnail()).into(holder.thumb
nail);
holder.thumbnail.setOnClickListener(new
View.OnClickListener() {
@Override
public void onClick(View v) {
// Do something
Intent editintent = new Intent(mContext,
DescActivity.class);
editintent.putExtra("eventname", getname);
mContext.startActivity(editintent);
}
});
holder.itemView.setOnClickListener(new
View.OnClickListener() {
@Override
public void onClick(View v) {
// Do something
Intent editintent = new Intent(mContext,
DescActivity.class);
editintent.putExtra("eventname", getname);
mContext.startActivity(editintent);
}
});
holder.overflow.setOnClickListener(new
View.OnClickListener() {
@Override
public void onClick(View view) {
//showPopupMenu(holder.overflow);
}
});
}
/**
* Showing popup menu when tapping on 3 dots
*/
/*
private void showPopupMenu(View view) {
// inflate menu
PopupMenu popup = new PopupMenu(mContext, view);
MenuInflater inflater = popup.getMenuInflater();
inflater.inflate(R.menu.menu_album, popup.getMenu());
popup.setOnMenuItemClickListener(new
MyMenuItemClickListener());
popup.show();
}
*/
/**
* Click listener for popup menu items
*/
/*
class MyMenuItemClickListener implements
PopupMenu.OnMenuItemClickListener {
public MyMenuItemClickListener() {
}
@Override
public boolean onMenuItemClick(MenuItem menuItem) {
switch (menuItem.getItemId()) {
case R.id.action_add_favourite:
Toast.makeText(mContext, "Add to favourite",
Toast.LENGTH_SHORT).show();
return true;
case R.id.action_play_next:
Toast.makeText(mContext, "Play next",
Toast.LENGTH_SHORT).show();
return true;
default:
}
return false;
}
}
*/
@Override
public int getItemCount() {
return albumList.size();
}
}
Output:-
Descactivity_xml
Code:-
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/cardview_dark_background">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center|start"
android:orientation="vertical">
<androidx.appcompat.widget.Toolbar
android:id="@+id/my_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:elevation="4dp"
android:theme="@style/ThemeOverlay.AppCompat.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
/>
<TextView
android:id="@+id/textView6"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_marginLeft="25dp"
android:layout_marginTop="20dp"
android:layout_marginRight="25dp"
android:text="Heading"
android:textColor="@color/cardview_light_background"
android:textSize="30sp" />
<ImageView
android:id="@+id/imageView2"
android:layout_width="wrap_content"
android:layout_height="400dp"
android:layout_gravity="center_horizontal"
app:srcCompat="@drawable/album1" />
<TextView
android:id="@+id/textView7"
android:layout_width="match_parent"
android:layout_height="223dp"
android:layout_marginLeft="15dp"
android:layout_marginTop="15dp"
android:layout_marginRight="10dp"
android:text="TextView"
android:textColor="@android:color/darker_gray" />
</LinearLayout>
</ScrollView>
Descactivity_java
Code:-
package event.management;
import android.content.Intent;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.desc_main);
Toolbar toolbar = (Toolbar)
findViewById(R.id.my_toolbar);
setSupportActionBar(toolbar);
TextView t6 = (TextView) findViewById(R.id.textView6);
ImageView i = (ImageView) findViewById(R.id.imageView2);
TextView t7 = (TextView) findViewById(R.id.textView7);
if (b != null) {
eventname = (String) b.get("eventname");
//eventname = j;
/* Toast.makeText(DescActivity.this, eventname,
Toast.LENGTH_LONG).show();*/
}
if (eventname.equals("QUIZ")) {
t6.setText(eventname);
i.setImageResource(R.drawable.quiz);
t7.setText("“Qriosity” The General Quiz Competition\
n" +
"“The only source of knowledge is
experience”-Albert Einstein\n" +
"\n" +
"Details below : \n" +
"\n" +
"Date: Wednesday,13 February 2019\n" +
"\n" +
"Timings :Registration begins at 10AM.Prelims
of the quiz begins at 12AM,followed by finals.\n" +
"\n" +
"Prizes worth over Rs.3000/-\n" +
"\n" +
"Venue:Brahmaguptha Hall,NCERC \n" +
"\n" +
"\n" +
"\n" +
"\n" +
"Cordinators:\n" +
"\n" +
"Rafeek T S: 9946289298\n" +
"\n" +
"Rahul .R : 8111976193\n" +
"\n" +
"Expect questions from any topic under the
sun!!!\n" +
"\n" +
"General Rules And Regulations:\n" +
"\n" +
"1.\tA team can consist of maximum 2
members .Lone wolves are permitted.\n" +
"\n" +
"2.\tThere will be a preliminary round
followed by the finals.\n" +
"\n" +
"3.\tTop 6 teams from the prelims will
qualify to the finals.\n" +
"\n" +
"4.\tAny numbers of teams from an institution
are allowed.\n" +
"\n" +
"5.\tRegistration for event will be separate
and the registration fee per team is Rs.50.\n" +
"\n" +
"6.\tParticipants must produce a valid ID
card during registration.\n" +
"\n" +
"7.\tThe rules of the quiz and it’s format
for each round will be explained by the quizmaster on the day of
the event prior to the round.\n" +
"\n" +
"8.\tAll decisions of the quiz master shall
be final and binding.\n" +
"\n" +
"\n" +
"Hope to see you all participate and win
amazing prizes at Qriosity 2019.Till then ,happy quizzing!");
}
}
}
Output:-
eventmain.xml
code:-
<androidx.appcompat.widget.Toolbar
android:id="@+id/my_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:elevation="4dp"
android:theme="@style/ThemeOverlay.AppCompat.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
<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"
android:background="@color/viewBg"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="event.management.EventActivity">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="60dp"
android:clipToPadding="false"
android:scrollbars="vertical" />
</RelativeLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
Eventactivity.java
Code:-
package event.management;
import android.content.Intent;
import android.content.res.Resources;
import android.graphics.Rect;
import android.os.Bundle;
import android.util.TypedValue;
import android.view.View;
import android.widget.ImageView;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.recyclerview.widget.DefaultItemAnimator;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import java.util.ArrayList;
import java.util.List;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.event_main);
if(b!=null)
{
deptname =(String) b.get("deptname");
//eventname = j;
/*Toast.makeText(EventActivity.this, deptname,
Toast.LENGTH_LONG).show();*/
}
recyclerView = (RecyclerView)
findViewById(R.id.recycler_view2);
if( deptname.equals("GENERAL") ) {
prepareAlbums1();
}
else if ( deptname.equals("AUTOMOBILE") ) {
prepareAlbums2();
}
else if ( deptname.equals("COMPUTER SCIENCE") ) {
prepareAlbums3();
}
else if ( deptname.equals("ELECTRONICS AND
COMMUNICATION") ) {
prepareAlbums4();
}
else if ( deptname.equals("ELECTRICAL AND ELECTRONICS") )
{
prepareAlbums5();
}
else if ( deptname.equals("MECHANICAL") ) {
prepareAlbums6();
}
else if ( deptname.equals("MECHATRONICS") ) {
prepareAlbums7();
}
else if ( deptname.equals("MASTER OF COMPUTER
APPLICATIONS") ) {
prepareAlbums8();
}
try {
Glide.with(this).load(R.drawable.cover).into((ImageView)
findViewById(R.id.backdrop));
} catch (Exception e) {
e.printStackTrace();
}
}
private void prepareAlbums1() {
int[] covers = new int[]{
R.drawable.expo,
R.drawable.quiz,
R.drawable.strike,
R.drawable.p1,
R.drawable.p2,
R.drawable.album6,
R.drawable.album7,
R.drawable.album8,
R.drawable.album9,
R.drawable.album10,
R.drawable.album11};
adapter.notifyDataSetChanged();
}
/**
* Adding few albums for testing
*/
private void prepareAlbums2() {
int[] covers = new int[]{
R.drawable.gear,
R.drawable.deci,
R.drawable.skill,
R.drawable.hill,
R.drawable.offro,
R.drawable.lady,
R.drawable.gokart,
R.drawable.motography,
R.drawable.auto,
R.drawable.stuntshow,
R.drawable.projectpresent};
adapter.notifyDataSetChanged();
}
adapter.notifyDataSetChanged();
}
adapter.notifyDataSetChanged();
}
adapter.notifyDataSetChanged();
}
adapter.notifyDataSetChanged();
}
adapter.notifyDataSetChanged();
}
/**
* RecyclerView item decoration - give equal margin around
grid item
*/
public class GridSpacingItemDecoration extends
RecyclerView.ItemDecoration {
if (includeEdge) {
outRect.left = spacing - column * spacing /
spanCount; // spacing - column * ((1f / spanCount) * spacing)
outRect.right = (column + 1) * spacing /
spanCount; // (column + 1) * ((1f / spanCount) * spacing)
/**
* Converting dp to pixel
*/
private int dpToPx(int dp) {
Resources r = getResources();
return
Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
dp, r.getDisplayMetrics()));
}
}
Output:-
Content_main.xml
Code:-
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipToPadding="false"
android:scrollbars="vertical" />
</RelativeLayout>
Content_main.xml
Code:-
</RelativeLayout>
Output:-
Android manifest.xml
Code:-
<application
android:allowBackup="true"
android:icon="@drawable/edgeicon"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<!-- Splash screen -->
<activity
android:name=".SplashScreen"
android:exported="true"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.Black.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN"
/>
<category
android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:exported="false"
android:theme="@style/AppTheme.NoActionBar"></activity>
<activity
android:name=".EventActivity"
android:exported="false"
android:theme="@style/AppTheme.NoActionBar"></activity>
<activity
android:name=".DescActivity"
android:exported="false"
android:theme="@style/AppTheme.NoActionBar"></activity>
</application>
</manifest>
Gradle script:-
plugins {
id 'com.android.application'
}
android {
namespace 'event.management'
compileSdk 33
defaultConfig {
applicationId "event.management"
minSdk 24
targetSdk 33
versionCode 1
versionName "1.0"
testInstrumentationRunner
"androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-
android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.8.0'
implementation
'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'com.github.bumptech.glide:glide:4.15.1'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-
core:3.5.1'