Skip to content

Instantly share code, notes, and snippets.

function displayUI(_response) {
var buttonView;
var response_keys = _.keys(_response);
if (response_keys.length === 0) {
$.vw_row_fn.add(addText("Contact's first name", "txt_firstname"));
$.vw_row_ln.add(addText("Contact's last name", "txt_lastname"));
$.vw_row_dept.add(addText("Department", "txt_department"));
$.vw_row_purpose.add(addText("Purpose of visit", "txt_purpose"));
} else if (response_keys.length > 0) {
<View layout="vertical">
<!-- <ScrollView layout="vertical"> -->
<View class="rx_box vw_form" layout="vertical" id="main_box" top="0" height="90%" >
<Label id="lbl_facility_name" class="heading" text="Facility Name" block="no"/>
<Label id="lbl_facility_address" textAlign="center" block="no"/>
<View class="rx_box" id="fn_ln_box" layout="vertical" height="Ti.UI.SIZE" top="3%" block="yes">
<Label text="Who will you be meeting with?" left="0" bottom="2%" class="boldText"/>
<View class="vw_row" id="vw_row_fn" top="2%" bubbleParent="false" left="0" inner_block="yes"/>
<View class="vw_row" id="vw_row_ln" bubbleParent="false" left="0" inner_block="yes"/>
@Ayyagaries
Ayyagaries / jsfile.js
Created July 10, 2019 15:13
Javascript file
function displayUI(_response) {
var buttonView;
var response_keys = _.keys(_response);
if (response_keys.length === 0) {
$.vw_row_fn.add(addText("Contact's first name", "txt_firstname"));
$.vw_row_ln.add(addText("Contact's last name", "txt_lastname"));
$.vw_row_dept.add(addText("Department", "txt_department"));
$.vw_row_purpose.add(addText("Purpose of visit", "txt_purpose"));
} else if (response_keys.length > 0) {
@Ayyagaries
Ayyagaries / myxml.xml
Created July 10, 2019 15:12
xml file
<View layout="vertical">
<!-- <ScrollView layout="vertical"> -->
<View class="rx_box vw_form" layout="vertical" id="main_box" top="0" height="90%" >
<Label id="lbl_facility_name" class="heading" text="Facility Name" block="no"/>
<Label id="lbl_facility_address" textAlign="center" block="no"/>
<View class="rx_box" id="fn_ln_box" layout="vertical" height="Ti.UI.SIZE" top="3%" block="yes">
<Label text="Who will you be meeting with?" left="0" bottom="2%" class="boldText"/>
<View class="vw_row" id="vw_row_fn" top="2%" bubbleParent="false" left="0" inner_block="yes">
package com.intellicentrics.sec3ure_badge;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.util.Log;
import com.ix.ebadgesdk.bean.ImageConfig;
import com.ix.ebadgesdk.bean.ImageData;
@Ayyagaries
Ayyagaries / location.js
Created May 23, 2019 22:11
Location file
if (OS_ANDROID) {
// Setup GPS
var providerGps = Ti.Geolocation.Android.createLocationProvider({
name: Ti.Geolocation.PROVIDER_GPS,
minUpdateDistance: 0.0,
minUpdateTime: 0
});
Ti.Geolocation.Android.addLocationProvider(providerGps);
BatchProcess batchProcess = new BatchProcess(mBleManager,MainActivity.this);
ArrayList<ebadgeJob> jobs = new ArrayList<>();
ebadgeJob job = new ebadgeJob();
ArrayList<Integer> idsTodelete=new ArrayList<>();
Log.d("TEST","IDS TO DELETE ARE " + idsTodelete.toString());
for(int i=0;i<list.size();i++){
idsTodelete.add(list.get(i).getImageid());
}
Log.d("TEST","Deleteting the images from bdge "+ idsTodelete.toString());
package com.intellicentrics.sec3ure_badge;
import android.content.Context;
import android.content.Intent;
import android.os.AsyncTask;
import android.util.Log;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import com.ix.ebadgesdk.EBadgeBleManager;
@Ayyagaries
Ayyagaries / MainActivity.java
Created April 1, 2019 15:03
Java file in my module
/**
* This file was auto-generated by the Titanium Module SDK helper for Android
* Appcelerator Titanium Mobile
* Copyright (c) 2009-2017 by Appcelerator, Inc. All Rights Reserved.
* Licensed under the terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
*
*/
package com.example.ble;
@Ayyagaries
Ayyagaries / bitmapTo8BitImage.java
Created April 1, 2019 13:52
bitmapTo8BitImage
private byte[] bitmapTo8BitImage(Bitmap bitmap) {
int[] pixels = new int[bitmap.getWidth() * bitmap.getHeight()];
bitmap.getPixels(pixels, 0, bitmap.getWidth(), 0, 0,
bitmap.getWidth(), bitmap.getHeight());
ByteBuffer eightByteBuffer = ByteBuffer.allocate(pixels.length);
for (int i = 0; i < pixels.length; i++) {
int p = pixels[i];