Profile image

Wheel Spinner

두둥 | 조회 수 3 | 2021.02.07. 10:24
Category Free

 

Setup

  1. Add it in your root build.gradle at the end of repositories:
allprojects {
  repositories {
   ...
   maven { url 'https://jitpack.io' }
  }
 }

  1. Add the dependency:
dependencies {
  implementation 'com.github.rehmanmuradali:wheel-spinner:1.0.0'
 }

<com.spin.wheelspinner.WheelSpinner
        android:id="@+id/wheelSpinner"
        android:layout_width="0dp"
        android:layout_height="0dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:m_arc_stroke_color="@android:color/white"
        app:m_circle_stroke_color="@android:color/white" />



<ImageView
        android:id="@+id/ivArrow"
        android:layout_width="70dp"
        android:layout_height="70dp"
        android:src="@drawable/wheel_pin"
        app:layout_constraintCircle="@id/wheelSpinner"
        app:layout_constraintCircleAngle="40"
        tools:ignore="MissingConstraints" />
        



wheelSpinner = findViewById(R.id.wheelSpinner);
ivArrow = findViewById(R.id.ivArrow);
 
List<Integer> bitmaps = new ArrayList<>();
        bitmaps.add(R.drawable.tatoo_1);
        bitmaps.add(R.drawable.tatoo_2);
        bitmaps.add(R.drawable.tatoo_3);
        bitmaps.add(R.drawable.tatoo_4);
        bitmaps.add(R.drawable.tatoo_5);
        bitmaps.add(R.drawable.tatoo_6);
        wheelSpinner.setArrowPointer(ivArrow);
        wheelSpinner.setBitmapsId(bitmaps);
        wheelSpinner.setOnItemSelectListener(bitmap -> {
        
            // On Item selected
            ivSelectedTattoo.setImageBitmap(bitmap);
            ivSelectedTattoo.setVisibility(View.VISIBLE);
        });

        btnSpin.setOnClickListener(v -> {
            ivSelectedTattoo.setVisibility(View.GONE);
            wheelSpinner.rotateWheel();
        });
        
        

LICENSE

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Author

Rehman Murad Ali

  • |
facebook twitter google plus pinterest kakao story band
사진 및 파일 첨부

여기에 파일을 끌어 놓거나 왼쪽의 버튼을 클릭하세요.

파일 용량 제한 : 0MB (허용 확장자 : *.*)

0개 첨부 됨 ( / )
번호 제목 글쓴이 날짜 조회 수
5 Line Graph file 아빠뎁 21.02.07. 7
4 3d View file 아빠뎁 21.02.07. 6
3 HorizontalWheelView file 두둥 21.02.07. 4
» Wheel Spinner 두둥 21.02.07. 3
1 Unicorn File Picker file 두둥 21.02.07. 5