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
package ***.***.android.utils; | |
import android.Manifest; | |
import android.app.Activity; | |
import android.app.Fragment; | |
import android.content.Context; | |
import android.content.pm.PackageManager; | |
import android.support.v13.app.FragmentCompat; | |
import android.support.v4.app.ActivityCompat; | |
import android.support.v4.content.ContextCompat; |
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
/* | |
Approach similar to approach for Common ancestor for BST. Keep going down on one side(right or left) if both the nodes | |
are in the same side(right or left), else the current node is the lowest common ancestor*/ | |
public Tree commonAncestor(Node root, Node p, Node q) { | |
// 1st check if p and q, both belong to the left of the current root node, if yes then recurse on the left side | |
if (covers(root.left, p) && covers(root.left, q)) // check out the covers subroutine, can be used elsewhere too! | |
return commonAncestor(root.left, p, q); | |
// else, check if both p and q are children of right side of the root, if yes, then recurse on the right side | |
if (covers(root.right, p) && covers(root.right, q)) |
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
package com.ewintory.udacity.popularmovies.ui.adapter; | |
import android.graphics.PorterDuff; | |
import android.support.annotation.NonNull; | |
import android.support.v4.app.Fragment; | |
import android.support.v7.graphics.Palette; | |
import android.support.v7.widget.RecyclerView; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.widget.ImageButton; |
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
// Adds extra tasks to improve android usage | |
project.android.applicationVariants.all { variant -> | |
def adb = new File(project.android.sdkDirectory as File, '/platform-tools/adb') | |
def variantName = variant.name.capitalize() | |
def flavor = variant.flavorName | |
def buildType = variant.buildType.name |
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
package ai.cometandroid.network; | |
import com.google.gson.Gson; | |
import com.google.gson.GsonBuilder; | |
import com.google.gson.internal.LinkedHashTreeMap; | |
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.InputStreamReader; |
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
source 'https://rubygems.org' | |
gem 'asciidoctor' | |
gem 'guard-asciidoc', :github => 'asciidoctor/guard-asciidoc' | |
gem 'guard-livereload' | |
gem 'rb-inotify', '~> 0.9.0' |
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
import org.junit.runners.model.InitializationError; | |
import org.robolectric.RobolectricTestRunner; | |
import org.robolectric.annotation.Config; | |
import org.robolectric.internal.bytecode.InstrumentationConfiguration; | |
import org.robolectric.manifest.AndroidManifest; | |
import org.robolectric.res.FileFsFile; | |
import org.robolectric.res.FsFile; | |
public class LibraryProjectTestRunner extends RobolectricTestRunner { |
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
/* | |
* Copyright (C) 2015 Jared Rummler <jared.rummler@gmail.com | |
* | |
* 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 |
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
if (project.android.hasProperty('libraryVariants')) { | |
android.libraryVariants.all { variant -> | |
Task javadocTask = task("generate${variant.name.capitalize()}Javadoc", type: Javadoc) { | |
group = 'artifact' | |
description "Generates Javadoc for $variant.name" | |
// Source files from the variant | |
source = variant.javaCompiler.source | |
// Classpath from the variant + android.jar |
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
package com.msvs.bookshelf.adapters; | |
import android.os.Handler; | |
import android.support.v7.widget.RecyclerView; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.widget.ImageView; | |
import android.widget.TextView; |
OlderNewer