Skip to content

Instantly share code, notes, and snippets.

View zetazaw's full-sized avatar
🛌
Sleeping at Home

Ko Nyan zetazaw

🛌
Sleeping at Home
View GitHub Profile
@zetazaw
zetazaw / Converter.java
Last active August 29, 2015 14:26 — forked from trhura/Converter.java
Unicode <-> Zawgyi Java Converter
// Zawgyi<>Unicode converter python module
// Based on rules from Parabaik Myanmar Text Converter
// Copyright (C) 2014 Ngwe Tun (Solveware Solution)
// Copyright (C) 2014 Ye Mon Kyaw
// This file is part of Paytan.
// Paytan is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
@zetazaw
zetazaw / colors.xml
Created December 5, 2015 17:53
Material Design Color Palette Colors.xml Resource file for Android
<?xml version="1.0" encoding="utf-8"?>
<!--
Google Material Design Color Palette for Android http://www.google.com/design/spec/style/color.html#color-ui-color-palette
Spreadsheet used to create this reosurce - http://bit.ly/mdcolor_spreadsheet
Link to this colors.xml resource file - http://bit.ly/mdcolorsxml
Harshad Kale
https://github.com/kalehv
harshad.kale@gmail.com
@zetazaw
zetazaw / README.md
Created January 17, 2016 21:57 — forked from shekibobo/README.md
Android: Base Styles for Button (not provided by AppCompat)

How to create custom button styles using Android's AppCompat-v7:21

Introduction

AppCompat is an Android support library to provide backwards-compatible functionality for Material design patterns. It currently comes bundled with a set of styles in the Theme.AppCompat and Widget.AppCompat namespaces. However, there is a critical component missing which I would have thought essential to provide the a default from which we could inherit our styles: Widget.AppCompat.Button. Sure, there's Widget.AppCompat.Light.ActionButton, but that doesn't actually inherit from Widget.ActionButton, which does not inherit from Widget.Button, so we might get some unexpected behavior using that as our base button style, mainly because Widget.ActionButton strictly belongs in the ActionBar.

So, if we want to have a decently normal default button style related to AppCompat, we need to make it ourselves. Let's start by digging into the Android SDK to see how it's doing default styles.

Digging In

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetListItems xmlns="http://schemas.microsoft.com/sharepoint/soap/">
<listName>{XXXXXXXX-D67B-XXXX-83FF-2E7F273D011E}</listName>
<queryOptions><QueryOptions><Paging ListItemCollectionPositionNext='Paged=TRUE&amp;p_SortBehavior=0&amp;p_FileLeafRef=XXXXXXXXX;p_ID=88' /></QueryOptions></queryOptions>
<rowLimit><RowLimit>5</RowLimit></rowLimit>
</GetListItems>
</soap:Body>
</soap:Envelope>
/* this style is very nice retrofit builder but not mine. And I don't remember where I did I get it*/
public static <T> T createRetro(final Class<T> clazz) {
OkHttpClient client = new OkHttpClient
.Builder()
.cache(new Cache(context.getCacheDir(), 10 * 1024 * 1024)) // 10 MB
.addInterceptor(new Interceptor() {
@Override
public Response intercept(Chain chain) throws IOException {
Request request = chain.request();
if (isConnected(context)) {
@zetazaw
zetazaw / Read it later
Last active March 10, 2017 09:37
Good references
https://launchkit.io
https://pusher.com
https://rapidapi.com
http://gunhansancar.com/
http://airbnb.io/projects/mobile/
http://wiresareobsolete.com/
import android.support.v8.renderscript.*;
public class BlurBuilder {
private static final float BITMAP_SCALE = 0.4f;
private static final float BLUR_RADIUS = 7.5f;
public static Bitmap blur(View v) {
return blur(v.getContext(), getScreenshot(v));
}
public static Bitmap blur(Context ctx, Bitmap image) {
public class MainActivity extends AppCompatActivity {
final String URL = "http://techiesjournal.com/";
private ProgressDialog progressBar;
WebView webView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
https://firebase.google.com/docs/cloud-messaging/server
{
"condition": "'security' in topics",
"data": {
"title":"Security Check",
"message": "Sir Are you sure to approve?",
"code":"djidjgfkg"
},
private String getDeviceId(){
return Settings.Secure.getString(getContentResolver(), Settings.Secure.ANDROID_ID);
}