Skip to content

Instantly share code, notes, and snippets.

View layerlre's full-sized avatar

Sutachad Wichai layerlre

View GitHub Profile
<script type="text/javascript">
var map; // กำหนดตัวแปร map ไว้ด้านนอกฟังก์ชัน เพื่อให้สามารถเรียกใช้งาน จากส่วนอื่นได้
var GGM; // กำหนดตัวแปร GGM ไว้เก็บ google.maps Object จะได้เรียกใช้งานได้ง่ายขึ้น
function initialize() { // ฟังก์ชันแสดงแผนที่
GGM=new Object(google.maps); // เก็บตัวแปร google.maps Object ไว้ในตัวแปร GGM
// กำหนดจุดเริ่มต้นของแผนที่
var my_Latlng = new GGM.LatLng(19.169977866142748,99.90623474121094);
var my_mapTypeId=GGM.MapTypeId.ROADMAP; // กำหนดรูปแบบแผนที่ที่แสดง
// กำหนด DOM object ที่จะเอาแผนที่ไปแสดง ที่นี้คือ div id=map_canvas
var my_DivObj=$("#map_canvas")[0];
{
"RedemptionRepetitionType": "UNLIMITED",
"PeriodStartDateType": "UNLIMITED",
"CreateDate": "/Date(1400485246763)/",
"Description": "",
"Disclaimer": "",
"PeriodStartDate": "/Date(1392784040047)/",
"PeriodEndDateType": "FIXED",
"PeriodEndDate": "/Date(1392784040047)/",
"ModifyDate": "/Date(1400485246763)/",
{
\"Agent\":\"\",
\"Start\":\"\/Date(1402587263404)\/\",
\"SaleNumber\":\"\",
\"IpAddress\":\"\",
\"Isp\":\"\",
\"QuestionResponses\":[
{
\"Start\":\"\/Date(1402587263404)\/\",
\"QuestionItems\":[
{
"rewardQRKey":"FB108:REWARD_KEY::635381949851949613:12",
"RedemptionRepetitionType":"UNLIMITED",
"ReceiverEmail":"testqr@android.com",
"CreateDate":"\/Date(1403163224028)\/",
"Description":"PRE_CREATE_REWARD_TEMPLATE_DEFAULT_DESCRIPTION_ENG",
"Disclaimer":"PRE_CREATE_REWARD_TEMPLATE_DEFAULT_DISCLAIMER_ENG",
"PeriodStartDateType":"UNLIMITED",
"PeriodStartDate":"\/Date(1402669824367)\/",
"PeriodEndDateType":"UNLIMITED",
String validfrom = "";
Date startDate = new Date(Long.valueOf(App.getReward().getPeriodStartDate().substring(6, 19)));
Date endDate = new Date(Long.valueOf(App.getReward().getPeriodEndDate().substring(6, 19)));
Date dateNow = new Date();
if (App.getReward().getPeriodStartType()==0) {
validfrom += "Unlimit";
}else {
validfrom += formatter.format(startDate);
}
validfrom += " to ";
@layerlre
layerlre / gist:793f9386a38c19e30a33
Last active August 29, 2015 14:05
Custom font textview
package com.layer.view;
import android.content.Context;
import android.graphics.Typeface;
import android.util.AttributeSet;
import android.widget.TextView;
public class TextViewRoboto extends TextView {
int pagerIndex = 2; //ลำดับ pager ที่จะอ้างถึง
MyFragment currentFragment = (MyFragment)getSupportFragmentManager()
.findFragmentByTag("android:switcher:" + R.id.viewpager + ":" + pagerIndex);
currentFragment.getMyListview();
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity">
<WebView android:id="@+id/webview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/edt_layout"
{
"Status": true,
"ErrorMessage": null,
"Body": {
"DefaultApplicationLanguageID": 1,
"AppLanguages": [
{
"Language": {
"ID": 10,
"Code": "en",
public class TextViewTH extends TextView {
public TextViewTH(Context context) {
super(context);
//mContext = context;
setFont();
}
public TextViewTH(Context context, AttributeSet attrs) {