use of com.manan.dev.ec2018app.DatabaseHandler.DatabaseController in project EC2018App by Manan-YMCA.
the class EventRegister method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_event_register);
this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
eventName = getIntent().getStringExtra("eventName");
eventId = getIntent().getStringExtra("eventId");
eventType = getIntent().getStringExtra("eventType");
userDetails = new UserDetails();
// barLoader = (ProgressBar) findViewById(R.id.pb_register);
// barLoader.setVisibility(View.VISIBLE);
pd = new ProgressDialog(EventRegister.this);
pd.setMessage("Making your Ticket...");
pd.setCancelable(false);
pd.setCanceledOnTouchOutside(false);
pd1 = new ProgressDialog(EventRegister.this);
pd1.setMessage("Loading your details...");
pd1.setCancelable(true);
alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);
Button Add = (Button) findViewById(R.id.add_mem_button);
personNo = (TextView) findViewById(R.id.current_team_mem);
layPar = personNo.getLayoutParams();
memberno = new ArrayList<>();
nameText = new ArrayList<>();
collegeText = new ArrayList<>();
databaseController = new DatabaseController(EventRegister.this);
eventTypeView = (TextView) findViewById(R.id.max_team_mem);
eventTypeView.setText(eventType);
eventNameView = (TextView) findViewById(R.id.tv_event_name);
eventNameView.setText(eventName);
mainName = (EditText) findViewById(R.id.ld_reg_name);
mainClg = (EditText) findViewById(R.id.ld_reg_clg);
mainPhone = (EditText) findViewById(R.id.ld_mobile);
mainmail = (EditText) findViewById(R.id.ld_email);
nameText.add(mainName);
collegeText.add(mainClg);
final LinearLayout layout = findViewById(R.id.layout_infater);
text = new TextView(this);
if (eventType.equals("solo"))
Add.setVisibility(View.GONE);
if (eventType.equals("solo"))
Add.setVisibility(View.GONE);
SharedPreferences prefs = getSharedPreferences(getResources().getString(R.string.sharedPrefName), MODE_PRIVATE);
final String phoneNumber = prefs.getString("Phone", null);
if (phoneNumber == null) {
}
if (isNetworkAvailable()) {
pd1.show();
getDetails(phoneNumber);
}
Add.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
personNo.setVisibility(View.VISIBLE);
final View v = LayoutInflater.from(EventRegister.this).inflate(R.layout.register_inflater, layout, false);
name = (EditText) v.findViewById(R.id.inflate_reg_name);
college = (EditText) v.findViewById(R.id.inflate_reg_clg);
final ImageView remove = (ImageView) v.findViewById(R.id.bt_remove);
final TextView tv_2 = (TextView) v.findViewById(R.id.member_no_count);
remove.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ViewGroup p1 = (ViewGroup) v.getParent();
ViewGroup p2 = (ViewGroup) p1.getParent();
ViewGroup p3 = (ViewGroup) p2.getParent();
Integer remove_member = Integer.parseInt(tv_2.getText().toString());
nameText.remove(remove_member - 1);
collegeText.remove(remove_member - 1);
memberno.remove(tv_2);
update();
p3.removeView(p2);
count--;
personNo.setText(String.valueOf(count));
}
});
count++;
personNo.setText(String.valueOf(count));
tv_2.setText(String.valueOf(count));
memberno.add(tv_2);
nameText.add(name);
collegeText.add(college);
layout.addView(v);
}
});
Button bt = (Button) findViewById(R.id.register_button);
bt.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
intentName = "";
intentClg = "";
intentMail = "";
intentPhone = "";
intentPhone += mainPhone.getText().toString();
intentMail += mainmail.getText().toString();
for (int i = 0; i < nameText.size(); i++) {
intentName += nameText.get(i).getText().toString() + ",";
}
intentName = intentName.substring(0, intentName.length() - 1);
for (int i = 0; i < collegeText.size(); i++) {
intentClg += collegeText.get(i).getText().toString() + ",";
}
intentClg = intentClg.substring(0, intentClg.length() - 1);
//
Boolean checker = validateCredentials();
if (checker) {
pd.show();
registerEvent();
}
}
});
}
use of com.manan.dev.ec2018app.DatabaseHandler.DatabaseController in project EC2018App by Manan-YMCA.
the class Tickets method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_tickets);
SharedPreferences preferences = getSharedPreferences(getResources().getString(R.string.sharedPrefName), MODE_PRIVATE);
phoneNumber = preferences.getString("Phone", null);
mProgress = new ProgressDialog(this);
mProgress.setMessage("Showing your ticket.");
mProgress.setTitle("Loading...");
mProgress.setCanceledOnTouchOutside(false);
noTickets = (TextView) findViewById(R.id.tv_no_tickets);
userTicketsView = (RecyclerView) findViewById(R.id.gl_user_tickets);
userTicketsView.setLayoutManager(new LinearLayoutManager(Tickets.this));
userTickets = new ArrayList<>();
mIncomingHandler = new IncomingHandler(Tickets.this);
databaseController = new DatabaseController(Tickets.this);
mAdapter = new TicketLayoutAdapter(Tickets.this, userTickets);
if (userTickets.size() > 0) {
noTickets.setVisibility(View.GONE);
}
userTicketsView.setAdapter(mAdapter);
tickback = findViewById(R.id.tic_back_button);
s = findViewById(R.id.swipe_refresh_layout);
s.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
if (isNetworkAvailable())
new LoadTickets().execute(phoneNumber);
else
MDToast.makeText(Tickets.this, "No Internet Connection", Toast.LENGTH_SHORT, MDToast.TYPE_ERROR).show();
s.setRefreshing(false);
}
});
if (phoneNumber == null) {
} else {
new DisplayTickets().execute(phoneNumber);
}
tickback.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed();
}
});
}
use of com.manan.dev.ec2018app.DatabaseHandler.DatabaseController in project EC2018App by Manan-YMCA.
the class CategoryEventDisplayActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_category_event_display);
flag = false;
backButton = findViewById(R.id.iv_back_button);
clubName = getIntent().getStringExtra("clubname");
databaseController = new DatabaseController(getApplicationContext());
eventList = databaseController.retreiveCategory(clubName);
byte[] byteArray = getIntent().getByteArrayExtra("clubPhoto");
Bitmap clubphoto = BitmapFactory.decodeByteArray(byteArray, 0, byteArray.length);
String displayName = getIntent().getStringExtra("clubdisplay");
clubImage = (ImageView) findViewById(R.id.iv_category_image);
clubDisplayName = (TextView) findViewById(R.id.tv_category_name_heading);
if (clubName.equals("Jhalak")) {
clubDisplayName.setText("Photography");
} else {
clubDisplayName.setText(displayName);
}
Drawable drawable = new BitmapDrawable(this.getResources(), clubphoto);
clubImage.setImageDrawable(drawable);
clubDescpTextView = findViewById(R.id.tv_category_descp_heading);
if (clubName.equals("Manan")) {
clubDescpTextView.setText("01010011 01010111 \n01000001 01000111");
clubDescpTextView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (!flag) {
flag = true;
clubDescpTextView.setText("You just touched SWAG of Manan!");
MDToast.makeText(CategoryEventDisplayActivity.this, "You just touched SWAG of Manan!", Toast.LENGTH_SHORT, MDToast.TYPE_SUCCESS).show();
}
}
});
} else if (clubName.equals("Ananya")) {
clubDescpTextView.setText("We can break the world into words.");
} else if (clubName.equals("Vividha")) {
clubDescpTextView.setText("Dramatics is what that keeps you in the seats");
} else if (clubName.equals("Jhalak")) {
clubDescpTextView.setText("The word “photography” is derived from the Greek words photos (light) and graphé (representation by means of lines)....");
} else if (clubName.equals("Eklavya")) {
clubDescpTextView.setText("If you can't have fun there is no sense of doing it. So, Ask yourself, 'Am I having fun?'");
} else if (clubName.equals("IEEE")) {
clubDescpTextView.setText("People who are crazy enough enough to think they can change the world are the ones who do.");
} else if (clubName.equals("Mechnext")) {
clubDescpTextView.setText("Blood, Sweat and Tears? Nah! Blood, Swear and Gears. ;)");
} else if (clubName.equals("Microbird")) {
clubDescpTextView.setText("Oh, come on! You are going to compile codes for some MNC all your life anyway. Try hands-on these robotic beasts this year!");
} else if (clubName.equals("Nataraja")) {
clubDescpTextView.setText("Dance dance dance till your feet will follow your heart.");
} else if (clubName.equals("SAE/BAJA")) {
clubDescpTextView.setText("We create! We destroy! But when we screw, even metals would cry.");
} else if (clubName.equals("Samarpan")) {
clubDescpTextView.setText("The different merited people who gets together and extends the technical bond to family bond.");
} else if (clubName.equals("Srijan")) {
clubDescpTextView.setText("People here play with colours and experiment with varied forms of art to embrace the hidden artistic element in every sphere of life as what are days with no colours...");
} else if (clubName.equals("Taranuum")) {
clubDescpTextView.setText("Tarannum originated in India meaning 'melody' and justifying the name we give melody to the words; calling it music.");
} else if (clubName.equals("Vivekanand Manch")) {
clubDescpTextView.setText("Inspired by Swami Vivekanand this is the category where cultural and fun activities fuse with social values. Witness the Social Bonanza.");
}
myRecyclerView = (RecyclerView) findViewById(R.id.events_list);
myRecyclerView.setHasFixedSize(true);
myRecyclerView.setLayoutManager(new LinearLayoutManager(this));
myRecyclerView.setAdapter(new eventAdapter(this, eventList));
backButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed();
}
});
}
use of com.manan.dev.ec2018app.DatabaseHandler.DatabaseController in project EC2018App by Manan-YMCA.
the class ContentActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.navbar_content);
cotainer_root_frame = (RelativeLayout) findViewById(R.id.content_frame);
//
dotsLayout = (LinearLayout) findViewById(R.id.layoutDots);
drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(ContentActivity.this, drawer, null, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
drawer.addDrawerListener(toggle);
toggle.syncState();
mProgress = new ProgressDialog(ContentActivity.this);
mProgress.setMessage("I am working");
mProgress.setTitle("yes i am");
mProgress.setCanceledOnTouchOutside(false);
nav_view = (NavigationView) findViewById(R.id.nav_view);
pdfTextView = (TextView) findViewById(R.id.tv_pdf);
nav_view.setNavigationItemSelectedListener((NavigationView.OnNavigationItemSelectedListener) this);
nav_view.setCheckedItem(R.id.nav_home);
userTickets = new ArrayList<QRTicketModel>();
databaseController = new DatabaseController(ContentActivity.this);
mIncomingHandler = new IncomingHandler(ContentActivity.this);
categoriesHeadingTextView = findViewById(R.id.text_viewcategories);
viewPager = (ViewPager) findViewById(R.id.slliderview_pager);
myViewPagerAdapter = new DashboardSlideAdapter(getSupportFragmentManager());
viewPager.setAdapter(myViewPagerAdapter);
viewPager.addOnPageChangeListener(viewPagerPageChangeListener);
ImageView img = findViewById(R.id.drawerTogglebtn);
img.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (!drawer.isDrawerOpen(GravityCompat.START)) {
drawer.openDrawer(GravityCompat.START);
}
}
});
pdfTextView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// missing 'http://' will cause crashed
Uri uri = Uri.parse("http://www.elementsculmyca.com/schedule");
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
}
});
addBottomDots(0);
addData();
RecyclerView categoryRecycleview = (RecyclerView) findViewById(R.id.category_recycler_view);
categoryRecycleview.setHasFixedSize(true);
DashboardCategoryScrollerAdapter adapter = new DashboardCategoryScrollerAdapter(ContentActivity.this, allSampleData);
categoryRecycleview.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false));
categoryRecycleview.setAdapter(adapter);
}
use of com.manan.dev.ec2018app.DatabaseHandler.DatabaseController in project EC2018App by Manan-YMCA.
the class LoginActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
parent = "default";
setContentView(R.layout.activity_login);
parent = getIntent().getStringExtra("parent");
userTickets = new ArrayList<>();
userDetails = new UserDetails();
pbLogin = (ProgressBar) findViewById(R.id.pb_login);
mobileNum = (EditText) findViewById(R.id.mobileNum);
loginMobileNum = (Button) findViewById(R.id.login_mobileNum);
RelativeView = (RelativeLayout) findViewById(R.id.rl_main_view);
NeedHelp = (TextView) findViewById(R.id.need_help);
registerView = (TextView) findViewById(R.id.tv_register_option);
databaseController = new DatabaseController(LoginActivity.this);
String first = "Haven't completed the details? ";
String next = "<font color='#f55246'>Click Here!</font>";
registerView.setText(Html.fromHtml(first + next));
NeedHelp.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String to = "manantechnosurge@gmail.com";
String subject = "Need Help";
String messg = "I am facing a problem regarding...\n";
sendEmailBug(to, subject, messg);
}
});
registerView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (parent.equals("xunbao") || parent.equals("ct")) {
startActivity(new Intent(LoginActivity.this, RegisterActivity.class).putExtra("parent", "xunbao"));
finish();
} else {
finish();
}
}
});
loginMobileNum.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Boolean checker = validateCredentials();
if (checker) {
pbLogin.setVisibility(View.VISIBLE);
userDetails.setmPhone(mobileNum.getText().toString());
checkOTP(mobileNum.getText().toString());
}
}
});
}
Aggregations