Skip to content

Instantly share code, notes, and snippets.

View balachandarlinks's full-sized avatar

Balachandar Kolathur Mani balachandarlinks

View GitHub Profile
@balachandarlinks
balachandarlinks / toolbarcolor
Created November 3, 2021 14:57 — forked from androidcodehunter/toolbarcolor
How to change toolbar back arrow color and title color?
From theme
<style name="SearchToolbar" parent="Theme.AppCompat.Light.NoActionBar">
//toolbar back arrow color
<item name="android:textColorSecondary">@android:color/white</item>
//toolbar title color
<item name="android:textColorPrimary">@android:color/white</item>
</style>
Also we can do it from java code:
/*
* 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 / 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 / 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 / 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,