⬆️ ⬇️

Songsterr - now on Android

C half a year ago, songsterr wrote about the results of three years. And now the team is glad to notify Habrahabr on the release of the application for Android!



Basic functionality




- Access to a huge tablature catalog (400,000)

- Toolkits for each song. Guitars, bass, drums, voice, etc.

- List of "Popular"

- Ability to search songs by artist or title

')

Plans to add music playback, favorites and much more. Follow the news here on facebook and twitter .



Download from the market:



QR:







Technical points




1. In 2.3.1, it became possible to use rubber lists in the sense that the list is delayed and the background is visible, as is done in the iPhone. To add such an effect to your ListView, you need to subclass and override one method:



public class BounceListView extends ListView { private int maxYOverscroll; private static final float MAX_Y_OVERSCROLL_DISTANCE = 200; public BounceListView(Context context) { super(context); initBounceListView(); } public BounceListView(Context context, AttributeSet attrs) { super(context, attrs); initBounceListView(); } public BounceListView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); initBounceListView(); } private void initBounceListView() { //get the density of the screen and do some maths with it on the max overscroll distance //variable so that you get similar behaviors no matter what the screen size final DisplayMetrics metrics = getContext().getResources().getDisplayMetrics(); final float density = metrics.density; maxYOverscroll = (int) (density * MAX_Y_OVERSCROLL_DISTANCE); } @Override protected boolean overScrollBy(int deltaX, int deltaY, int scrollX, int scrollY, int scrollRangeX, int scrollRangeY, int maxOverScrollX, int maxOverScrollY, boolean isTouchEvent) { //This is where the magic happens, we have replaced the incoming maxOverScrollY with our own custom variable maxYOverscroll; return super.overScrollBy(deltaX, deltaY, scrollX, scrollY, scrollRangeX, scrollRangeY, maxOverScrollX, maxYOverscroll, isTouchEvent); } 




2. Again, in 2.3.1, it was possible to specify a reverse orientation for the screen, based on the sensor signal. This is convenient if you want one of the activity to be only in landscape orientation, but at the same time dependent on the sensor.



screenOrientation = "sensorLandscape". Be careful, because at 2.2 this attribute behaves not as a landscape, but as the absence of an attribute at all!



3. In order for the TextView, which is part of the entry in the ListView, to change its state according to the selection and click on this item (selected = "true" or clicked = "true"), the dublicateParentState attribute must be used. Otherwise, the background of the element will change, but the text color will not.



With moments so far all! Have fun learning your favorite songs!



We will also welcome any constructive criticism and expressed wishes.



Thank!



PS: Do you want to work in our team? Email us at hq@songsterr.com

Source: https://habr.com/ru/post/137098/



All Articles