Skip to content

Instantly share code, notes, and snippets.

View ajithvgiri's full-sized avatar
👨‍💻
waiting for gradle to finish

Ajith v Giri ajithvgiri

👨‍💻
waiting for gradle to finish
View GitHub Profile
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="oval">
<size android:width="100dp"
android:height="100dp"/>
<solid android:color="#59d5fe"/>
</shape>
</item>
</selector>
@ajithvgiri
ajithvgiri / clear text
Created March 5, 2019 05:44
Network Clear Text
// create network_security_config.xml file
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">192.168.11.155:8000</domain>
<domain includeSubdomains="true">192.168.11.155</domain>
</domain-config>
</network-security-config>
@ajithvgiri
ajithvgiri / notification.kt
Created October 17, 2018 11:41
Notification Handler
val notificationBuilder = NotificationCompat.Builder(this, notificationChannel)
.setSmallIcon(R.drawable.ic_stat_notification)
.setChannelId(notificationChannel)
.setLargeIcon(BitmapFactory.decodeResource(resources, R.mipmap.ic_launcher))
//Notification title
.setContentTitle(if (notification.title.isNotEmpty()) {
notification.title
} else {
getString(R.string.app_name)
@ajithvgiri
ajithvgiri / .gitignore
Created May 22, 2018 03:09
React native gitignore
### Android ###
# Built application files
*.apk
*.ap_
# Files for the ART/Dalvik VM
*.dex
# Java class files
@ajithvgiri
ajithvgiri / DatePicker.java
Last active April 26, 2018 05:25
DatePicker Dialog in Java
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
// Get Current Date
final Calendar c = Calendar.getInstance();
int mYear = c.get(Calendar.YEAR);
int mMonth = c.get(Calendar.MONTH);
int mDay = c.get(Calendar.DAY_OF_MONTH);
package softfruit.solutions.virtuedriver;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
import android.os.Handler;
@ajithvgiri
ajithvgiri / twotableviewsInOneView.swift
Created February 21, 2018 08:07 — forked from mchirico/twotableviewsInOneView.swift
Creating multiple tableViews in one ViewController...this just starts out as a view controller
//
// ViewController.swift
// Delete
//
// Created by Mike Chirico on 10/21/15.
// Copyright © 2015 Mike Chirico. All rights reserved.
//
import UIKit
/* Smartphones (portrait and landscape) ----------- */
@media only screen
and (min-device-width : 320px)
and (max-device-width : 480px) {
/* Styles */
}
/* Smartphones (landscape) ----------- */
@media only screen
and (min-width : 321px) {