View MainActivity.java
package com.ssaurel.roulettegame;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.DecelerateInterpolator;
import android.view.animation.RotateAnimation;
import android.widget.Button;
import android.widget.ImageView;
View MainActivity4.java
private String getSector(int degrees) {
int i = 0;
String text = null;
do {
// start and end of each sector on the wheel
float start = HALF_SECTOR * (i * 2 + 1);
float end = HALF_SECTOR * (i * 2 + 3);
if (degrees >= start && degrees < end) {
View MainActivity3.java
@OnClick(R.id.spinBtn)
public void spin(View v) {
degreeOld = degree % 360;
// we calculate random angle for rotation of our wheel
degree = RANDOM.nextInt(360) + 720;
// rotation effect on the center of the wheel
RotateAnimation rotateAnim = new RotateAnimation(degreeOld, degree,
RotateAnimation.RELATIVE_TO_SELF, 0.5f, RotateAnimation.RELATIVE_TO_SELF, 0.5f);
rotateAnim.setDuration(3600);
rotateAnim.setFillAfter(true);
View MainActivity2.java
package com.ssaurel.roulettegame;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.DecelerateInterpolator;
import android.view.animation.RotateAnimation;
import android.widget.Button;
import android.widget.ImageView;
View MainActivity1.java
package com.ssaurel.roulettegame;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.DecelerateInterpolator;
import android.view.animation.RotateAnimation;
import android.widget.Button;
import android.widget.ImageView;
View activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
<Button
android:id="@+id/spinBtn"
android:layout_width="wrap_content"
View build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.ssaurel.roulettegame"
minSdkVersion 15
targetSdkVersion 27
versionCode 1
View MainActivity.java
package com.ssaurel.inappkeyboard;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.InputType;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputConnection;
import android.widget.EditText;
public class MainActivity extends AppCompatActivity {
View MyKeyboard.java
package com.ssaurel.inappkeyboard;
import android.content.Context;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.util.SparseArray;
import android.view.LayoutInflater;
import android.view.View;
import android.view.inputmethod.InputConnection;
import android.widget.Button;
View activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.ssaurel.inappkeyboard.MainActivity">
<EditText
android:id="@+id/editText"