From 2d1248ac6c71c8be9cbee79494cc92083bf8782b Mon Sep 17 00:00:00 2001 From: Ayush Shrivastava Date: Sat, 4 Jan 2020 21:35:11 +0530 Subject: [PATCH] Added Acommodation Fragment Infrastructure (#25) --- .idea/render.experimental.xml | 6 -- .../anwesha/iitp/about/AboutFragment.java | 1 - .../accomodation/AccomodationFragment.java | 65 +++++++++++++++++ .../info/anwesha/iitp/home/MainActivity.java | 2 +- app/src/main/res/drawable/rounded_button.xml | 2 +- .../main/res/layout/fragment_accomodation.xml | 71 +++++++++++++++++++ .../main/res/menu/activity_main_drawer.xml | 4 ++ .../main/res/navigation/mobile_navigation.xml | 5 ++ app/src/main/res/values/strings.xml | 15 ++-- app/src/main/res/values/styles.xml | 5 +- 10 files changed, 162 insertions(+), 14 deletions(-) delete mode 100644 .idea/render.experimental.xml create mode 100644 app/src/main/java/info/anwesha/iitp/accomodation/AccomodationFragment.java create mode 100644 app/src/main/res/layout/fragment_accomodation.xml diff --git a/.idea/render.experimental.xml b/.idea/render.experimental.xml deleted file mode 100644 index 8ec256a..0000000 --- a/.idea/render.experimental.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file diff --git a/app/src/main/java/info/anwesha/iitp/about/AboutFragment.java b/app/src/main/java/info/anwesha/iitp/about/AboutFragment.java index 75aeffc..c805c3c 100644 --- a/app/src/main/java/info/anwesha/iitp/about/AboutFragment.java +++ b/app/src/main/java/info/anwesha/iitp/about/AboutFragment.java @@ -91,7 +91,6 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat Glide.with(context).load("https://scontent.fdel29-1.fna.fbcdn.net/v/t1.0-9/33490969_969879943175001_7316512759087104000_n.jpg?_nc_cat=105&_nc_oc=AQn_AxS6IX1lXlZZyVmn8sBqsAwQuU69Qg3VmDV65xgAmC_J9_zHJ5AkbPWEccCVU3A&_nc_ht=scontent.fdel29-1.fna&oh=871245e026dcfd1041ed75995ebe9deb&oe=5DF6A107") .placeholder(R.mipmap.celesta_icon_round).into(image4); - super.onViewCreated(view, savedInstanceState); } diff --git a/app/src/main/java/info/anwesha/iitp/accomodation/AccomodationFragment.java b/app/src/main/java/info/anwesha/iitp/accomodation/AccomodationFragment.java new file mode 100644 index 0000000..e44f4ec --- /dev/null +++ b/app/src/main/java/info/anwesha/iitp/accomodation/AccomodationFragment.java @@ -0,0 +1,65 @@ +package info.anwesha.iitp.accomodation; + + +import android.os.Bundle; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.AdapterView; +import android.widget.ArrayAdapter; +import android.widget.Button; +import android.widget.Spinner; + +import info.anwesha.iitp.R; + +/** + * A simple {@link Fragment} subclass. + */ + +public class AccomodationFragment extends Fragment implements AdapterView.OnItemSelectedListener { + + private Button submit_button; + private Spinner accomodation_options_spinner; + + + public AccomodationFragment() { + + } + + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + // Inflate the layout for this fragment + View rootview = inflater.inflate(R.layout.fragment_accomodation, container, false); + submit_button = rootview.findViewById(R.id.book_button); + accomodation_options_spinner = rootview.findViewById(R.id.accoomo_spinner); + return rootview; + + } + + @Override + public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { + super.onViewCreated(view, savedInstanceState); + ArrayAdapter adapter = ArrayAdapter.createFromResource(requireContext(), R.array.days_array, android.R.layout.simple_spinner_item); + adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); + accomodation_options_spinner.setAdapter(adapter); + submit_button.setClickable(false); + submit_button.setEnabled(false); + } + + @Override + public void onItemSelected(AdapterView parent, View view, int position, long id) { + accomodation_options_spinner.setOnItemSelectedListener(this); + + } + + @Override + public void onNothingSelected(AdapterView parent) { + } +} diff --git a/app/src/main/java/info/anwesha/iitp/home/MainActivity.java b/app/src/main/java/info/anwesha/iitp/home/MainActivity.java index 81a5346..cb3f433 100644 --- a/app/src/main/java/info/anwesha/iitp/home/MainActivity.java +++ b/app/src/main/java/info/anwesha/iitp/home/MainActivity.java @@ -73,7 +73,7 @@ protected void onCreate(Bundle savedInstanceState) { mAppBarConfiguration = new AppBarConfiguration.Builder( R.id.nav_home, R.id.nav_events_cat, R.id.nav_ongoing, R.id.nav_pronite, R.id.nav_special_cat, - R.id.nav_gallery, R.id.nav_team, R.id.nav_sponsors, R.id.nav_maps, R.id.nav_developers, R.id.nav_account) + R.id.nav_gallery, R.id.nav_team, R.id.nav_sponsors, R.id.nav_maps, R.id.nav_developers, R.id.nav_account, R.id.nav_accomodation) .setDrawerLayout(drawer) .build(); diff --git a/app/src/main/res/drawable/rounded_button.xml b/app/src/main/res/drawable/rounded_button.xml index 1d5f90b..3286e84 100644 --- a/app/src/main/res/drawable/rounded_button.xml +++ b/app/src/main/res/drawable/rounded_button.xml @@ -4,7 +4,7 @@ - + diff --git a/app/src/main/res/layout/fragment_accomodation.xml b/app/src/main/res/layout/fragment_accomodation.xml new file mode 100644 index 0000000..dc59460 --- /dev/null +++ b/app/src/main/res/layout/fragment_accomodation.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + +