This file contains hidden or 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
| companion object { | |
| @JvmStatic fun createIntent(context: Context) : Intent { | |
| return Intent(context, Activity::class.java); | |
| } | |
| } |
This file contains hidden or 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
| @PerApp | |
| @Component( | |
| modules = { | |
| SampleAppModule.class, | |
| DataModule.class, | |
| NetworkModule.class | |
| } | |
| dependencies = { | |
| OtherComponent.class | |
| } |
This file contains hidden or 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
| /* Build numbers */ | |
| def versionMajor = 1 | |
| def versionMinor = 0 | |
| def versionPatch = 0 | |
| def versionBuild = 1 | |
| /* Build details that can be useful for debugging */ | |
| def gitSha = 'git rev-parse --short HEAD'.execute([], project.rootDir).text.trim() | |
| def buildTime = new Date().format("yyyy-MM-dd'T'HH:mm'Z'", TimeZone.getTimeZone("UTC")) |
This file contains hidden or 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
| /* | |
| * Don't forget to add these to the manifest! | |
| * <receiver | |
| * android:name="ConnectivityReceiver" | |
| * android:enabled="true" | |
| * android:label="ConnectivityActionReceiver" > | |
| * <intent-filter> | |
| * <action android:name="android.net.conn.CONNECTIVITY_CHANGE" /> | |
| * </intent-filter> | |
| * </receiver> |
This file contains hidden or 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) 2013 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 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
This file contains hidden or 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 android.content.res.ColorStateList; | |
| import android.graphics.Bitmap; | |
| import android.graphics.Bitmap.Config; | |
| import android.graphics.BitmapShader; | |
| import android.graphics.Canvas; | |
| import android.graphics.Color; | |
| import android.graphics.ColorFilter; | |
| import android.graphics.Matrix; | |
| import android.graphics.Paint; |
This file contains hidden or 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 java.util.Locale; | |
| public class FormatUtil { | |
| public static final String formatTimeInMillisToHMS(int timeInMillis){ | |
| int s = (timeInMillis / 1000) % 60; | |
| int m = (timeInMillis / (1000 * 60)) % 60; | |
| int h = (timeInMillis) % 24; | |
| return String.format(Locale.US, "%d:%02d:%02d", h, m, s); | |
| } | |
This file contains hidden or 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.myspace.ilike.common.util; | |
| import android.app.Activity; | |
| import android.graphics.Rect; | |
| import android.view.View; | |
| import android.view.ViewTreeObserver; | |
| import android.widget.FrameLayout; | |
| public class AndroidBug5497Workaround { |
This file contains hidden or 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 android.content.Context; | |
| import android.graphics.Bitmap; | |
| import android.util.Log; | |
| public class Blur { | |
| public static Bitmap fastblur(Context context, Bitmap sentBitmap, int radius) { | |
| float scaleFactor = 8; | |
| Bitmap bitmap = Bitmap.createScaledBitmap(sentBitmap, (int) (sentBitmap.getWidth() / scaleFactor), (int) (sentBitmap.getHeight() / scaleFactor), true); |
This file contains hidden or 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
| private Song mSong; | |
| private RemoteControlClient remoteControlClient; | |
| private AudioManager audioManager; | |
| // ... | |
| private void broadcastTrackInfoToLockscreen(){ | |
| MetadataEditor editor = remoteControlClient.editMetadata(false); | |
| editor.putString(MediaMetadataRetriever.METADATA_KEY_ALBUM, mSong.getFullAlbumTitle()); |
NewerOlder