This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ObjectAnimator animator = ObjectAnimator.ofPropertyValuesHolder( | |
container, | |
PropertyValuesHolder.ofFloat("scaleX", 0.5f), | |
PropertyValuesHolder.ofFloat("scaleY", 0.5f) | |
); | |
animator.setDuration(300); | |
animator.setRepeatCount(ObjectAnimator.RESTART); | |
animator.setRepeatMode(ObjectAnimator.REVERSE); | |
animator.setInterpolator(new FastOutSlowInInterpolator()); | |
animator.start(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AdViewHelper { | |
private static AdViewHelper Instance; | |
private Context context; | |
ConsentForm consentForm; | |
AdView adView; | |
public static AdViewHelper getInstance(Context context, AdView adView){ | |
if (Instance == null){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SwipeGestureDetector implements View.OnTouchListener { | |
private GestureDetector gestureDetector; | |
public SwipeGestureDetector(Context context) { | |
gestureDetector = new GestureDetector(context, new GestureListener()); | |
} | |
public SwipeGestureDetector() { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface onDataListener{ | |
void returnData(String data); | |
} | |
public String setResponse(String url){ | |
OkHttpClient client = new OkHttpClient(); | |
Request request = new Request.Builder() | |
.url(url) | |
.build(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Observable.just(obj) | |
.delay(500, TimeUnit.MILLISECONDS) | |
.subscribe(obj -> { | |
//do something | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
overridePendingTransition(R.anim.fadein, R.anim.fadeout); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Anim { | |
public void fadeIn(View view){ | |
ObjectAnimator animator = ObjectAnimator.ofPropertyValuesHolder( | |
view, | |
PropertyValuesHolder.ofFloat("alpha", 0f, 1f) | |
); | |
animator.setDuration(4500); | |
animator.setInterpolator(new FastOutSlowInInterpolator()); | |
animator.start(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private boolean isNetworkConnected() { | |
ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE); | |
return cm.getActiveNetworkInfo() != null && cm.getActiveNetworkInfo().isConnected(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MainActivity extends AppCompatActivity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
BottomNavigationView navigationView = findViewById(R.id.navView); | |
loadFragment(new RouletteFragment()); | |
navigationView.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener() { | |
@Override |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ActivityGameBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_game); |
OlderNewer