Skip to content

Instantly share code, notes, and snippets.

View balachandarlinks's full-sized avatar

Balachandar Kolathur Mani balachandarlinks

View GitHub Profile
@balachandarlinks
balachandarlinks / ViewAnimationUtilsCircularReveal.java
Last active June 15, 2019 21:31
ViewAnimationUtils - Circular Reveal Effect
//Reveal View. Note: View should be invisible before revealing
currentTubeStatusContainer.setVisibility(View.INVISIBLE);
// Do the API compatibility check
new Timer().schedule(new TimerTask() {
@Override
public void run() {
getActivity().runOnUiThread(new Runnable() {
@Override
@balachandarlinks
balachandarlinks / ImageFlipper.java
Last active June 15, 2019 21:31
ImageFlipper helps you to run a flip animation with a series of images on any ImageView.
public class ImageFlipper{
private static final int START_ANGLE = 90;
private static final int END_ANGLE = 270;
private int animationDuration = 800;
private ObjectAnimator flipObjectAnimator;
public ImageFlipper(final View targetView, final int[] drawableResources){
((ImageView)targetView).setImageResource(drawableResources[0]);
flipObjectAnimator = ObjectAnimator.ofFloat(targetView, "rotationY", START_ANGLE, END_ANGLE);
@balachandarlinks
balachandarlinks / contact_name_lookup.java
Last active June 15, 2019 21:30
Retrieve contact name by giving a phone number
/**
*
* @param context
* @param phoneNumber
* @return contactName
*/
public static String getContactName(Context context, String phoneNumber) {
Uri uri = Uri.withAppendedPath(
PhoneLookup.CONTENT_FILTER_URI,
@balachandarlinks
balachandarlinks / RecorderService.java
Created January 21, 2016 19:12 — forked from qihnus/RecorderService.java
a minimalist example of Android accessibility service
import android.accessibilityservice.AccessibilityService;
import android.accessibilityservice.AccessibilityServiceInfo;
import android.util.Log;
import android.view.accessibility.AccessibilityEvent;
public class RecorderService extends AccessibilityService {
static final String TAG = "RecorderService";
private String getEventType(AccessibilityEvent event) {
@balachandarlinks
balachandarlinks / mobile-AndroidManifest.xml
Created April 8, 2016 14:48 — forked from nschwermann/mobile-AndroidManifest.xml
Android Wearable Message API example
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="schwiz.net.weartest" >
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
@balachandarlinks
balachandarlinks / Dockerfile
Last active November 27, 2020 14:20
Dockerfile for https://github.com/gojuno/mainframer remote android build system.
FROM ubuntu:16.04
MAINTAINER Balachandar KM "[email protected]"
# Install java7
RUN apt-get update && \
apt-get install -y software-properties-common && \
add-apt-repository -y ppa:webupd8team/java && \
(echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections) && \
apt-get update && \
/*
* Copyright (C) 2014 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
@balachandarlinks
balachandarlinks / TestRunner.kt
Last active May 21, 2020 17:21
Disable animations for Android UI tests
import android.app.Application
import android.content.Context
import android.os.Bundle
import android.provider.Settings.Global.*
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.runner.AndroidJUnitRunner
class TestRunner : AndroidJUnitRunner() {
override fun onCreate(arguments: Bundle?) {
super.onCreate(arguments)
@balachandarlinks
balachandarlinks / tvusage_grant_permissions.sh
Last active May 21, 2023 09:29
ADB Commands to grant permissions for TVUsage app.
> adb shell pm grant --user <USER_ID> in.codeseed.tvusage android.permission.PACKAGE_USAGE_STATS
> adb shell appops set --user <USER_ID> in.codeseed.tvusage GET_USAGE_STATS allow
> adb shell dumpsys deviceidle whitelist +in.codeseed.tvusage
> adb shell pm grant --user <USER_ID> in.codeseed.tvusage android.permission.SYSTEM_ALERT_WINDOW