Skip to content

Instantly share code, notes, and snippets.

View AVINASH21AK's full-sized avatar

Avinash AVINASH21AK

  • Ahmedabad, Gujarat, India
View GitHub Profile
@AVINASH21AK
AVINASH21AK / GrideLayout_Dynamic_Programatically.java
Last active October 24, 2018 09:53 — forked from shivamsriva31093/sample.java
Dynamically add a gridlayout
package com.testapp;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.CardView;
import android.support.v7.widget.GridLayout;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.view.ViewGroup;
@AVINASH21AK
AVINASH21AK / Custom font in WebView
Created January 2, 2018 06:15 — forked from andrea-ale-sbarra/Custom font in WebView
How to add custom font in Android WebView.
//View container..
View rootView = inflater.inflate(R.layout.fragment1, container, false);
//Global WebView
mWebView = (WebView) rootView.findViewById(R.id.enter_text);
//Font must be placed in assets/fonts folder
String text = "<html><style type='text/css'>@font-face { font-family: spqr; src: url('fonts/spqr.ttf'); } body p {font-family: spqr;}</style>"
+ "<body >" + "<p align=\"justify\" style=\"font-size: 22px; font-family: spqr;\">" + getString(R.string.enter_text) + "</p> "+ "</body></html>";