Skip to content

Instantly share code, notes, and snippets.

View pdegand's full-sized avatar

Pierre Degand pdegand

  • Octo Technology
  • Paris, France
View GitHub Profile
@pdegand
pdegand / Android Sample - TestViewPagerWithFixedFooter.md
Last active August 15, 2023 22:52
Android Sample that contains a ViewPager with a fixed footer below it. The footer should disappear when the last Fragment of the ViewPager is shown.

TestViewPagerWithFixedFooter

See it in action on an Android 2.2 (API 8) emulator :

@pdegand
pdegand / NavigationDrawerFragment.java
Created June 10, 2014 20:41
Sample of pure Java StackBlur usage
/**
* Based on a generated NavigationDrawerFragment from AndroidStudio ...
*/
public class NavigationDrawerFragment extends Fragment {
private static final int BLUR_RADIUS_RATIO = 20;
private static final float BLUR_THRESHOLD = 0.1f;
...
@pdegand
pdegand / :mobile - AndroidManifest.xml
Last active August 29, 2015 14:08
Gists for Android Wear packaging for real world applications
<!-- WEAR APP DESCRIPTION -->
<meta-data android:name="com.google.android.wearable.beta.app"
android:resource="@xml/wear_desc"/>
buildscript {
...
dependencies {
classpath 'com.android.tools.build:gradle:0.13.2'
}
...
}
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.0.1"
defaultConfig {
applicationId "com.octo.app"
minSdkVersion 18
targetSdkVersion 21
versionCode 1
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.0.1"
defaultConfig {
applicationId "com.octo.app"
minSdkVersion 20
targetSdkVersion 21
>> ./gradlew mobile:assembleRelease
:mobile:preBuild
:mobile:preReleaseBuild
...
:mobile:generateReleaseResValues UP-TO-DATE
:wear:preBuild
...
:wear:validateProductionSigning
:wear:packageRelease
:wear:zipalignRelease
android {
...
productFlavors {
brandA {
applicationId "com.octo.app.a"
}
brandB {
applicationId "com.octo.app.b"
}
}
// wearApp project(':wear')
<?xml version="1.0" encoding="utf-8"?>
<wearableApp package="com.octo.app.a">
<versionCode>1</versionCode>
<versionName>1.0</versionName>
<path>wear-brandA-release.apk</path>
</wearableApp>