Android

CricketZ an Android Application using free API from crickapi.com part 1

CricketZ an android application using cricapi API

CricketZ an Android Application using free API from crickapi.com

CricketZ an android application using cricapi API
CricketZ an android application using cricapi API

 

Feature:

-> Live Score of all game

-> Next 3 days matches

-> live bpl using Youtube API

 

Happy Coding

Add this below code in your  build.gradle (Module.app)

Add this below code in your colors.xml that is in your values folder

Add this below code in your strings.xml

 

Add this below code in your styles.xml

 

Add this below code in your AndroidManifest.xml

 

Put this below code in your MainActivity.class

In this above code first we add the toolbar then add our view pager adapter to enable pages in our app.

add this below code to enable swap through pages.

Then we check isnetworkconnected. if it returns false. We need to enable our internet service.

 

Put this below code in your activity_main.xml file

In this above code we add Coordinate layout. When we go down toolbar and tablayout will hide from the screen.

in the above code make sure that happens.

In the above, we nest the Toolbar and TabLayout in an AppBarLayout. The AppBarLayout allows the Toolbar and other views (such as tabs provided by TabLayout) to react to scroll events in a sibling view marked with a ScrollingViewBehavior. When the user scrolls through the RecyclerView, the AppBarLayout responds by using its children’s scroll flags to control how they enter (scroll on screen) and exit (scroll off screen).

Flags include:

  • scroll: This flag should be set for all views that want to scroll off the screen. For views that do not use this flag, they’ll remain pinned to the top of the screen
  • enterAlways: This flag ensures that any downward scroll will cause this view to become visible, enabling the ‘quick return’ pattern
  • enterAlwaysCollapsed: When your view has declared a minHeight and you use this flag, your View will only enter at its minimum height (i.e., ‘collapsed’), only re-expanding to its full height when the scrolling view has reached it’s top.
  • exitUntilCollapsed: This flag causes the view to scroll off until it is ‘collapsed’ (its minHeight) before exiting

Note that all views using the scroll flag must be declared before views that do not use the flag. This ensures that all views exit from the top, leaving the fixed elements behind.

In our app we use the scroll and enterAlways flags on the Toolbar which will result in the Toolbar scrolling off screen when scrolling upwards and come back on screen on the downward scroll. Notice the use of app:layout_behavior="@string/appbar_scrolling_view_behavior" on the ViewPager. The support library contains a special string resource @string/appbar_scrolling_view_behavior that maps to AppBarLayout.ScrollingViewBehavior, which is used to notify the AppBarLayout when scroll events occur on a particular view. The behavior must be established on the view that triggers the event.

 

1 Comment

  1. post to o sumporno vai. adapter,model kno class e to nai full code ta soho complete tutorial korle uporar hoto.thanks

Leave a Reply

Your email address will not be published.

5 × four =