Skip to content

Instantly share code, notes, and snippets.

View KeizerDev's full-sized avatar

Robert-Jan Keizer KeizerDev

View GitHub Profile
@alphamu
alphamu / AA Transition App theme between light and dark themes
Last active September 9, 2022 21:59
Example of how to change themes at runtime with a smooth animation. In this example, we just switch between a light and a dark theme. The activity animation is defined in the theme and as such will be default on all activities with the set theme. [Demo Video here](http://youtu.be/Ps0phswbHls).
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ListView;
public class TransitionThemeActivity extends AppCompatActivity implements View.OnClickListener {
@vavrecan
vavrecan / rename-apk-namespace
Last active March 20, 2022 08:53
Script that allows renaming namespace of Android APK so you can install same application multiple times
#!/bin/bash
# author Marek Vavrecan (vavrecan@gmail.com)
# show usage
[ $# -eq 0 ] && { echo "Usage: $0 [apk path] [source namespace] [target namespace]"; exit 1; }
APK_PATH="$1"
NAMESPACE_FROM="$2"
NAMESPACE_TO="$3"
@tyvsmith
tyvsmith / App.java
Last active October 26, 2018 19:15
If you have multiple Android apps that need to report to the same Crashlytics app endpoint. This allows overriding the package name that Crashlytics discovers and reports.
public class MyApp extends Application {
private final String PACKAGE="me.tysmith.app";
@Override
public void onCreate() {
super.onCreate();
Crashlytics.start(new CrashContextWrapper(this, PACKAGE));
}
}