Search in sources :

Example 1 with DashboardSlideAdapter

use of com.manan.dev.ec2018app.Adapters.DashboardSlideAdapter 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);
}
Also used : NavigationView(android.support.design.widget.NavigationView) ActionBarDrawerToggle(android.support.v7.app.ActionBarDrawerToggle) DashboardCategoryScrollerAdapter(com.manan.dev.ec2018app.Adapters.DashboardCategoryScrollerAdapter) DatabaseController(com.manan.dev.ec2018app.DatabaseHandler.DatabaseController) Intent(android.content.Intent) ProgressDialog(android.app.ProgressDialog) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) NavigationView(android.support.design.widget.NavigationView) ImageView(android.widget.ImageView) View(android.view.View) TextView(android.widget.TextView) RecyclerView(android.support.v7.widget.RecyclerView) Uri(android.net.Uri) QRTicketModel(com.manan.dev.ec2018app.Models.QRTicketModel) DashboardSlideAdapter(com.manan.dev.ec2018app.Adapters.DashboardSlideAdapter) RecyclerView(android.support.v7.widget.RecyclerView) ImageView(android.widget.ImageView)

Aggregations

ProgressDialog (android.app.ProgressDialog)1 Intent (android.content.Intent)1 Uri (android.net.Uri)1 NavigationView (android.support.design.widget.NavigationView)1 ActionBarDrawerToggle (android.support.v7.app.ActionBarDrawerToggle)1 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1 RecyclerView (android.support.v7.widget.RecyclerView)1 View (android.view.View)1 ImageView (android.widget.ImageView)1 TextView (android.widget.TextView)1 DashboardCategoryScrollerAdapter (com.manan.dev.ec2018app.Adapters.DashboardCategoryScrollerAdapter)1 DashboardSlideAdapter (com.manan.dev.ec2018app.Adapters.DashboardSlideAdapter)1 DatabaseController (com.manan.dev.ec2018app.DatabaseHandler.DatabaseController)1 QRTicketModel (com.manan.dev.ec2018app.Models.QRTicketModel)1