Skip to content

Instantly share code, notes, and snippets.

View wizmea's full-sized avatar

Arcadius TCHOKPODO wizmea

View GitHub Profile
@wizmea
wizmea / README.md
Created January 27, 2017 15:14 — forked from lopspower/README.md
Material Animations

Material Animations

Android Arsenal

[Android Transition Framework][transition-framework] can be used for three main things:

  1. Animate activity layout content when transitioning from one activity to another.
  2. Animate shared elements (Hero views) in transitions between activities.
  3. Animate view changes within same activity.
@wizmea
wizmea / newapp.java
Last active May 31, 2020 16:36
check android app version playstore and force update
private void checkNewAppVersion(Context context,int view){
final String link = "https://play.google.com/store/apps/details?id="+getPackageName() + "&hl=en";
new AsyncTask<Void, Void, String>() {
@Override
protected String doInBackground(Void... strings) {
try {
Log.e("startVersion","start");
String newVersion = Jsoup
.connect(link)
.timeout(30000)
@wizmea
wizmea / App.java
Created September 5, 2017 09:45
Handle all android app exception
public class App extends Application {
// Called when the application is starting, before any other application objects have been created.
// Overriding this method is totally optional!
@Override
public void onCreate() {
super.onCreate();
Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
public void uncaughtException(Thread paramThread, Throwable paramThrowable) {
Log.e("Error"+Thread.currentThread().getStackTrace()[2],paramThrowable.getLocalizedMessage());
}
@wizmea
wizmea / hide.java
Created October 17, 2017 08:21
Hide status bar
public class hide{
public void maker(){
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
getWindow().requestFeature(Window.FEATURE_NO_TITLE);
//for hide status bar
WindowManager manager = ((WindowManager) getApplicationContext()
.getSystemService(Context.WINDOW_SERVICE));
WindowManager.LayoutParams localLayoutParams = new WindowManager.LayoutParams();
@wizmea
wizmea / RSACipher.java
Created February 14, 2018 00:02 — forked from awesometic/RSACipher.java
RSA encryption example for android
/**
* Created by Awesometic
* It's encrypt returns Base64 encoded, and also decrypt for Base64 encoded cipher
* references: http://stackoverflow.com/questions/12471999/rsa-encryption-decryption-in-android
*/
import android.util.Base64;
import java.nio.charset.StandardCharsets;
import java.security.InvalidKeyException;
import java.security.KeyFactory;
@wizmea
wizmea / event.java
Created April 10, 2018 20:10
Add event to agenda (android app)
public class Agenda {
AppCompatActivity context;
ViewGroup viewGroup;
DemandeRdv demandeRdv;
Action listener;
public Agenda(AppCompatActivity context, ViewGroup viewGroup) {
this.context = context;
this.viewGroup = viewGroup;
@wizmea
wizmea / Downloader.kt
Created August 28, 2018 10:42
Download any file with retrofit rxjava and okio
interface ApiService {
@GET("api/apk-download/5b84691a312bdc094694cada")
fun download(@Query("access-token") token: String): Observable<Response<ResponseBody>>
}
//initialize api service with retrofit
fun download(service: ApiService,id: String) {
service.download(id)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
@wizmea
wizmea / BaseRecyclerViewAdapter.kt
Last active August 30, 2018 12:18
Base Template for RecyclerView with it own adapter with databinding
class BaseRecyclerViewAdapter<BIND: ViewDataBinding>(val ressource: Int,val variableId: Int) : RecyclerView.Adapter<BaseRecyclerViewAdapter<BIND>.Holder>() {
private var layoutInflater: LayoutInflater? = null
private var items: MutableList<Any> = ArrayList()
private lateinit var callback: (data: Any) -> Unit
constructor(ressource: Int,variableId: Int,items: MutableList<Any>) : this(ressource, variableId){
this.items = items
}
@wizmea
wizmea / bold_string.kt
Last active August 14, 2019 15:35
[Kotlin] bold format string temple with args
/*
string ressource
<string name="app_bold_arg">Bonjour &lt;b>%s&lt;/b></string>
*/
val text = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
Html.fromHtml(getString(R.string.app_bold_arg, "Arcadius"),
Html.FROM_HTML_MODE_LEGACY)
} else {
Html.fromHtml(getString(R.string.app_bold_arg, "Arcadius"))
@wizmea
wizmea / counter.dart
Created December 6, 2019 09:47
Counter app flutter+ mobx sample
#get started