Skip to content

Instantly share code, notes, and snippets.

View derysudrajat's full-sized avatar

Dery Sudrajat derysudrajat

View GitHub Profile
@derysudrajat
derysudrajat / activity_main.xml
Last active February 19, 2020 07:27
Example of Firebase ML-KIT On-Device Translation
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="16dp"
tools:context=".MainActivity">
public class main {
public static void main(String[] args) {
System.out.println("Halo, Dunia!");
}
}
@derysudrajat
derysudrajat / WebActivity.java
Last active October 4, 2019 15:04
Custom Web View
package com.derysudrajat.myintentapp;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.AppCompatImageButton;
import android.annotation.SuppressLint;
import android.os.Bundle;
import android.view.View;
import android.webkit.WebChromeClient;
import android.webkit.WebSettings;
@derysudrajat
derysudrajat / NumSeperate.java
Last active August 11, 2019 06:19
Code to separate the value of int according to the unit
import java.util.Scanner;
/**
*
* @author derysudrajat
*/
public class NumSeperate {
/**
* @param args the command line arguments
@derysudrajat
derysudrajat / CardImage.xml
Last active August 4, 2019 13:51
Create Custom ImageView with CardView
<!-- Image -->
<androidx.cardview.widget.CardView
android:layout_width="100dp"
android:layout_height="100dp"
app:cardBackgroundColor="@color/colorAccentDark"
app:cardCornerRadius="16dp">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"