Skip to content

Instantly share code, notes, and snippets.

View kalvian1060's full-sized avatar

kalvian1060 kalvian1060

View GitHub Profile
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
return super.onCreateView(inflater, container, savedInstanceState);
}
https://gist.github.com/kalvian1060/94da3a6d58e0de5240a6966e07fff8ad
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
return super.onCreateView(inflater, container, savedInstanceState);
}
@kalvian1060
kalvian1060 / ContohFragment2.Java
Created May 20, 2017 08:00
Contoh Fragment 2
package id.kalviansofian.belajarfragment;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
/**
@kalvian1060
kalvian1060 / fragment2.xml
Created May 20, 2017 08:00
Layout XML Fragment2
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorPrimary"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorAccent"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
@kalvian1060
kalvian1060 / ContohFragment1.Java
Created May 20, 2017 07:58
Contoh Fragment 1 Tutorial
package id.kalviansofian.belajarfragment;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
/**
@kalvian1060
kalvian1060 / MainActivity.java
Created May 20, 2017 07:57
Main Activity untuk transaksi
package id.kalviansofian.belajarfragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
@kalvian1060
kalvian1060 / main_activity.xml
Created May 20, 2017 07:56
Main Activirty untuk container
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="id.kalviansofian.belajarfragment.MainActivity">
<LinearLayout
if((lang.compareTo("en")) == 0){
SimpleDateFormat formatter = new SimpleDateFormat ("yyyy/MM/dd/ HH:mm:ss ");
Date curDate = new Date(System.currentTimeMillis());//获取当前时间
String str = formatter.format(curDate);
String date = str + "\n\n\n\n\n\n";
if (is58mm) {
try {
byte[] qrcode = PrinterCommand.getBarCommand("Zijiang Electronic Thermal Receipt Printer!", 0, 3, 6);//
Command.ESC_Align[2] = 0x01;