(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| import android.support.v4.app.Fragment; | |
| public class FragmentUtils { | |
| /** | |
| * @param fragment | |
| * The Fragment whose parent is to be found | |
| * @param parentClass | |
| * The interface that the parent should implement | |
| * @return The parent of fragment that implements parentClass, |
| NOTE: Easier way is the X86 way, described on https://www.genymotion.com/help/desktop/faq/#google-play-services | |
| Download the following ZIPs: | |
| ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links) | |
| Download the correct GApps for your Android version: | |
| Google Apps for Android 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip) | |
| Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip) | |
| Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip) |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| AppCompat-v7:21 provides a very useful way of dealing with pressed/focused/activated states maintaining backwards compatibility downto API-7, but there's a small issue (big for some) with the default selectableItemBackground: It uses some PNGs and/or default values for API<21. | |
| The main reason is that android drawable resource definitions (prior API 21) CANNOT use theme attributes at all, so there's no way of making something like: | |
| <shape android:shape="rectangle"> | |
| <solid android:color="?attr/colorControlHighlight" /> | |
| </shape> | |
| For this, I've put this simple mockup on how to give your app better drawables that the appcompat defaults. |
| /* | |
| * Copyright 2014 Chris Banes | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
| import android.graphics.PointF; | |
| import android.view.animation.Interpolator; | |
| /** | |
| * From https://github.com/codesoup/android-cubic-bezier-interpolator | |
| * Derived from: https://github.com/rdallasgray/bez | |
| */ | |
| public class CubicBezierInterpolator implements Interpolator { |
| package com.materialdesign.chris.materialdesignexperimenting; | |
| import android.animation.Animator; | |
| import android.animation.AnimatorListenerAdapter; | |
| import android.animation.ObjectAnimator; | |
| import android.app.Activity; | |
| import android.os.Bundle; | |
| import android.os.Handler; | |
| import android.view.View; | |
| import android.view.ViewAnimationUtils; |
| <?xml version="1.0" encoding="utf-8"?> | |
| <!-- | |
| Copyright (C) 2015 The Android Open Source Project | |
| Licensed under the Apache License, Version 2.0 (the "License"); | |
| you may not use this file except in compliance with the License. | |
| You may obtain a copy of the License at | |
| http://www.apache.org/licenses/LICENSE-2.0 |
| #!/usr/bin/env ruby | |
| toc = "# Table of Contents\n" | |
| newmd = "" | |
| ARGF.each_line do |line| | |
| newmd << line | |
| next if !line.start_with?("#") | |
| heading = line.gsub("#", "").strip |